From 0dc5fcb8e02cac2c7438b13883b7ec444809300d Mon Sep 17 00:00:00 2001 From: "J. Craft" Date: Thu, 5 Jul 2018 23:11:11 -0400 Subject: [PATCH 1/2] Allows "opening in" disk images from other apps (Files, Safari, etc.). Refresh option from tapping "My 2GS" title now adds any just-added disk images to the Favorites list. --- ActiveGS_iOS/activegs.plist | 123 ++++++++++++++++++++++++++++++++++ Common.iphone/activegsList.mm | 23 ++++++- 2 files changed, 145 insertions(+), 1 deletion(-) diff --git a/ActiveGS_iOS/activegs.plist b/ActiveGS_iOS/activegs.plist index c10be4a..332f5fd 100644 --- a/ActiveGS_iOS/activegs.plist +++ b/ActiveGS_iOS/activegs.plist @@ -6,6 +6,63 @@ English CFBundleDisplayName ActiveGS + CFBundleDocumentTypes + + + CFBundleTypeIconFiles + + CFBundleTypeName + Apple // 2MG Image + CFBundleTypeRole + Editor + LSHandlerRank + Owner + LSItemContentTypes + + com.apple.disk-image-2mg + + + + CFBundleTypeIconFiles + + CFBundleTypeName + Apple // DSK Image + CFBundleTypeRole + Editor + LSHandlerRank + Owner + LSItemContentTypes + + com.apple.disk-image-dsk + + + + CFBundleTypeIconFiles + + CFBundleTypeName + Apple // ZIP Disk Image + CFBundleTypeRole + Editor + LSHandlerRank + Owner + LSItemContentTypes + + com.apple.disk-image-zip + + + + CFBundleTypeIconFiles + + CFBundleTypeName + Unknown File + LSHandlerRank + Alternate + LSItemContentTypes + + public.item + + + CFBundleExecutable ${EXECUTABLE_NAME} CFBundleIdentifier @@ -50,5 +107,71 @@ UIViewControllerBasedStatusBarAppearance + UTExportedTypeDeclarations + + + UTTypeConformsTo + + public.archive + public-data + public.disk-image + + UTTypeDescription + Apple // Disk Image - 2MG + UTTypeIconFiles + + UTTypeIdentifier + com.apple.disk-image-2mg + UTTypeTagSpecification + + Item 0 + 2MG + public.filename-extension + + + + + UTTypeConformsTo + + public.archive + public-data + public.disk-image + + UTTypeDescription + Apple // Disk Image - DSK + UTTypeIconFiles + + UTTypeIdentifier + com.apple.disk-image-dsk + UTTypeTagSpecification + + public.filename-extension + + DSK + + + + + UTTypeConformsTo + + public.archive + public-data + public.disk-image + + UTTypeDescription + Apple // Disk Image -ZIP + UTTypeIconFiles + + UTTypeIdentifier + com.apple.disk-image-zip + UTTypeTagSpecification + + public.filename-extension + + ZIP + + + + diff --git a/Common.iphone/activegsList.mm b/Common.iphone/activegsList.mm index dc662b0..44f51cd 100644 --- a/Common.iphone/activegsList.mm +++ b/Common.iphone/activegsList.mm @@ -572,7 +572,27 @@ static NSInteger compareImagesUsingSelector(id p1, id p2, void *context) { NSLog(@"activeGSList viewWillAppear %@",self); - + + // Move files from Documents/Inbox to Documents (Items arriving through iOS "Open In" + NSLog(@"Moving files from Documents/Inbox to Documents so they're visible"); + //Turn every file inside the directory into an array + // Note to self: remember to actually put files in the Documents folder. Use the code in the apparopriately marked file + NSArray *path = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); + //strings to actually get the directories + NSString *appFolderPath = [path objectAtIndex:0]; + NSString *inboxAppFolderPath = [appFolderPath stringByAppendingString:@"/Inbox"]; //add ".plist" to the end of the recipe name + + NSString *documentsDirectory = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0]; + + NSArray *inboxContents = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:[NSString stringWithFormat:inboxAppFolderPath, documentsDirectory] error:nil]; + + //move all the files over + for (int i = 0; i != [inboxContents count]; i++) { + NSString *oldPath = [NSString stringWithFormat:@"%@/%@", inboxAppFolderPath, [inboxContents objectAtIndex:i]]; + NSString *newPath = [NSString stringWithFormat:@"%@/%@", appFolderPath, [inboxContents objectAtIndex:i]]; + [[NSFileManager defaultManager] moveItemAtPath:oldPath toPath:newPath error:nil]; + } + if (self.sourceName) { #ifndef ACTIVEGS_BACKGROUNDIMAGE @@ -592,6 +612,7 @@ static NSInteger compareImagesUsingSelector(id p1, id p2, void *context) [super viewDidLoad]; + // IOS8 ISSUE !!!!! DefaultRawHeight = UITableViewAutomaticDimension CGFloat h = 44 * [pManager resolutionRatio]; From fc28805c485d212bad013ec1b2f68aaaf53fefcd Mon Sep 17 00:00:00 2001 From: studio Date: Sun, 9 Jun 2019 20:31:22 -0400 Subject: [PATCH 2/2] Added LSSupportsOpeningDocumentInPlace into activegs.plist to allow access to document folder in Files app. Put your disk images in there. --- ActiveGS_iOS/activegs.plist | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ActiveGS_iOS/activegs.plist b/ActiveGS_iOS/activegs.plist index 332f5fd..53dcbf5 100644 --- a/ActiveGS_iOS/activegs.plist +++ b/ActiveGS_iOS/activegs.plist @@ -2,6 +2,8 @@ + LSSupportsOpeningDocumentsInPlace + CFBundleDevelopmentRegion English CFBundleDisplayName