From 9c6fe83f3afc446dbf0323488dc43de6a3cf64f5 Mon Sep 17 00:00:00 2001 From: hslee Date: Tue, 8 Dec 2015 19:50:03 +0900 Subject: [PATCH 1/7] for pull request 1 --- Classes/ContainerController.m | 7 ++++++ Classes/ContainerListController.m | 24 +++++++++++++----- Classes/drmInitialize.h | 30 +++++++++++++++++++++++ SDKLauncher-iOS-Info.plist | 5 ++++ SDKLauncher-iOS.xcodeproj/project.pbxproj | 2 ++ 5 files changed, 62 insertions(+), 6 deletions(-) create mode 100644 Classes/drmInitialize.h diff --git a/Classes/ContainerController.m b/Classes/ContainerController.m index 77ba19e..953ab3f 100644 --- a/Classes/ContainerController.m +++ b/Classes/ContainerController.m @@ -36,6 +36,7 @@ #import "RDPackage.h" #import "SpineItemListController.h" +#import "drmInitialize.h" @interface ContainerController () < RDContainerDelegate, @@ -290,5 +291,11 @@ - (void)viewWillAppear:(BOOL)animated { } } +- (void)containerRegisterContentModules:(RDContainer *)container{ +#ifdef _READIUM_DRM_ + [[[DrmInitialize alloc] init] initialize]; +#endif +} + @end diff --git a/Classes/ContainerListController.m b/Classes/ContainerListController.m index 6bc8eb5..9f23377 100644 --- a/Classes/ContainerListController.m +++ b/Classes/ContainerListController.m @@ -89,15 +89,27 @@ - (void)onContainerListDidChange { tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { - [tableView deselectRowAtIndexPath:indexPath animated:YES]; - NSString *path = [m_paths objectAtIndex:indexPath.row]; - ContainerController *c = [[ContainerController alloc] initWithPath:path]; +// [tableView deselectRowAtIndexPath:indexPath animated:YES]; +// NSString *path = [m_paths objectAtIndex:indexPath.row]; +// ContainerController *c = [[ContainerController alloc] initWithPath:path]; +// +// if (c != nil) { +// [self.navigationController pushViewController:c animated:YES]; +// } - if (c != nil) { - [self.navigationController pushViewController:c animated:YES]; - } + [tableView deselectRowAtIndexPath:indexPath animated:YES]; + [NSThread detachNewThreadSelector:@selector(openWithThread:) toTarget:self withObject:indexPath]; } +-(void)openWithThread:(NSIndexPath *)indexPath +{ + NSString *path = [m_paths objectAtIndex:indexPath.row]; + ContainerController *c = [[ContainerController alloc] initWithPath:path]; + + if (c != nil) { + [self.navigationController pushViewController:c animated:YES]; + } +} - (NSInteger) tableView:(UITableView *)tableView diff --git a/Classes/drmInitialize.h b/Classes/drmInitialize.h new file mode 100644 index 0000000..8389a59 --- /dev/null +++ b/Classes/drmInitialize.h @@ -0,0 +1,30 @@ +// +// DrmInitialize.h +// SDKLauncher-OSX +// +// Created by DRM inside Development Team on 2015-08-16. +// ( T.H. Kim, H.D. Yoon, H.S. Lee and C.H. Yu ) +// +// Copyright (c) 2015 The Readium Foundation and contributors. All rights reserved. +// +// The Readium SDK is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see +// +#import + +@interface DrmInitialize : NSObject + +- (void)initialize; + +@end + diff --git a/SDKLauncher-iOS-Info.plist b/SDKLauncher-iOS-Info.plist index 5f2f8d4..7faaeed 100644 --- a/SDKLauncher-iOS-Info.plist +++ b/SDKLauncher-iOS-Info.plist @@ -55,6 +55,11 @@ 0.18.0 LSRequiresIPhoneOS + NSAppTransportSecurity + + NSAllowsArbitraryLoads + + UIFileSharingEnabled UIRequiredDeviceCapabilities diff --git a/SDKLauncher-iOS.xcodeproj/project.pbxproj b/SDKLauncher-iOS.xcodeproj/project.pbxproj index 4a164a4..6c86a21 100644 --- a/SDKLauncher-iOS.xcodeproj/project.pbxproj +++ b/SDKLauncher-iOS.xcodeproj/project.pbxproj @@ -335,6 +335,7 @@ A250D54A5C423A86C6099037 /* epub30-test-0220-20131022.epub */ = {isa = PBXFileReference; lastKnownFileType = file.epub; path = "epub30-test-0220-20131022.epub"; sourceTree = ""; }; A250D58D34D67FC218608A1F /* epub30-test-0120-20131022.epub */ = {isa = PBXFileReference; lastKnownFileType = file.epub; path = "epub30-test-0120-20131022.epub"; sourceTree = ""; }; A250DD41B691E2CA16B1735D /* epubReadingSystem.epub */ = {isa = PBXFileReference; lastKnownFileType = file.epub; path = epubReadingSystem.epub; sourceTree = ""; }; + FFE961DC1C16E73100FA2A5C /* drmInitialize.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = drmInitialize.h; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -611,6 +612,7 @@ 345CA3E116C00EE100B8B56A /* Main */ = { isa = PBXGroup; children = ( + FFE961DC1C16E73100FA2A5C /* drmInitialize.h */, 3462FBBA16BC3C43003C79E1 /* AppDelegate.h */, 3462FBBB16BC3C43003C79E1 /* AppDelegate.m */, 340535A816BC5DD100D4A802 /* BaseViewController.h */, From e0135db1b662a7df1cf71b49c6701fce3af22d2c Mon Sep 17 00:00:00 2001 From: danielweck Date: Mon, 14 Dec 2015 20:35:55 +0000 Subject: [PATCH 2/7] submodule --- readium-sdk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/readium-sdk b/readium-sdk index 8a86531..1649a9a 160000 --- a/readium-sdk +++ b/readium-sdk @@ -1 +1 @@ -Subproject commit 8a86531c4fc65edd8443f935a286ea51a4ae268f +Subproject commit 1649a9aed283a25782272cbca4cad45fa309ef03 From 473e7897298cb54d7ca4dbb810df86805c341ade Mon Sep 17 00:00:00 2001 From: hslee Date: Thu, 17 Dec 2015 10:37:44 +0900 Subject: [PATCH 3/7] for pull request 2 --- readium-sdk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/readium-sdk b/readium-sdk index 80fdd57..238b5b8 160000 --- a/readium-sdk +++ b/readium-sdk @@ -1 +1 @@ -Subproject commit 80fdd5726efbaa621765c6b07619cd8559c065b0 +Subproject commit 238b5b88b4920f0444b619eb07c3f4ec35f32d4b From 671b1ba59323e9348e00ae57906492dd49b4824e Mon Sep 17 00:00:00 2001 From: DRMinside Date: Thu, 17 Dec 2015 14:40:40 +0900 Subject: [PATCH 4/7] Update ContainerListController.m --- Classes/ContainerListController.m | 8 -------- 1 file changed, 8 deletions(-) diff --git a/Classes/ContainerListController.m b/Classes/ContainerListController.m index 9f23377..e2e6515 100644 --- a/Classes/ContainerListController.m +++ b/Classes/ContainerListController.m @@ -89,14 +89,6 @@ - (void)onContainerListDidChange { tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { -// [tableView deselectRowAtIndexPath:indexPath animated:YES]; -// NSString *path = [m_paths objectAtIndex:indexPath.row]; -// ContainerController *c = [[ContainerController alloc] initWithPath:path]; -// -// if (c != nil) { -// [self.navigationController pushViewController:c animated:YES]; -// } - [tableView deselectRowAtIndexPath:indexPath animated:YES]; [NSThread detachNewThreadSelector:@selector(openWithThread:) toTarget:self withObject:indexPath]; } From 655d39b433e7d6ad78f57ae17a09b82eb313a1ca Mon Sep 17 00:00:00 2001 From: hslee Date: Thu, 17 Dec 2015 15:25:05 +0900 Subject: [PATCH 5/7] no message --- Resources/readium-shared-js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Resources/readium-shared-js b/Resources/readium-shared-js index 76ccb0b..b371d7d 160000 --- a/Resources/readium-shared-js +++ b/Resources/readium-shared-js @@ -1 +1 @@ -Subproject commit 76ccb0bb32971a8083ff5ae4f98d48fc3eee1d08 +Subproject commit b371d7d9ce0acd73cd959763bf41ff17653b1689 From 0d5ae9504012e580acc55e21f5e04605fed10212 Mon Sep 17 00:00:00 2001 From: hslee Date: Thu, 17 Dec 2015 15:49:32 +0900 Subject: [PATCH 6/7] no message --- readium-sdk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/readium-sdk b/readium-sdk index 238b5b8..3c9fe52 160000 --- a/readium-sdk +++ b/readium-sdk @@ -1 +1 @@ -Subproject commit 238b5b88b4920f0444b619eb07c3f4ec35f32d4b +Subproject commit 3c9fe52e5be7c2b93e4fe5bf132ec015f07c5b3a From f4b395701b26cc923a778d0aea7b96f575668b8f Mon Sep 17 00:00:00 2001 From: hslee Date: Mon, 11 Jan 2016 14:21:45 +0900 Subject: [PATCH 7/7] thread change to dispatch_queue --- Classes/ContainerListController.m | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/Classes/ContainerListController.m b/Classes/ContainerListController.m index e2e6515..93efbf7 100644 --- a/Classes/ContainerListController.m +++ b/Classes/ContainerListController.m @@ -89,19 +89,21 @@ - (void)onContainerListDidChange { tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { - [tableView deselectRowAtIndexPath:indexPath animated:YES]; - [NSThread detachNewThreadSelector:@selector(openWithThread:) toTarget:self withObject:indexPath]; + dispatch_queue_t backgroundQueue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0); + dispatch_async(backgroundQueue, ^{ + + [tableView deselectRowAtIndexPath:indexPath animated:YES]; + NSString *path = [m_paths objectAtIndex:indexPath.row]; + ContainerController *c = [[ContainerController alloc] initWithPath:path]; + + dispatch_async(dispatch_get_main_queue(), ^{ + if (c != nil) { + [self.navigationController pushViewController:c animated:YES]; + } + }); + }); } --(void)openWithThread:(NSIndexPath *)indexPath -{ - NSString *path = [m_paths objectAtIndex:indexPath.row]; - ContainerController *c = [[ContainerController alloc] initWithPath:path]; - - if (c != nil) { - [self.navigationController pushViewController:c animated:YES]; - } -} - (NSInteger) tableView:(UITableView *)tableView