Skip to content

Commit

Permalink
add .tipa support (to debug)
Browse files Browse the repository at this point in the history
  • Loading branch information
gzz2000 committed Dec 23, 2023
1 parent ffdf21f commit 3294c2f
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 6 deletions.
4 changes: 2 additions & 2 deletions ProvisionQL/GeneratePreviewForURL.m
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ OSStatus GeneratePreviewForURL(void *thisInterface, QLPreviewRequestRef preview,
NSData *codesignEntitlementsData = nil;
NSImage *appIcon = nil;

if ([dataType isEqualToString:kDataType_ipa]) {
if ([dataType isEqualToString:kDataType_ipa] || [dataType isEqualToString:kDataType_tipa]) {
// get the embedded provisioning & plist from an app archive using: unzip -u -j -d <currentTempDirFolder> <URL> <files to unzip>
NSTask *unzipTask = [NSTask new];
[unzipTask setLaunchPath:@"/usr/bin/unzip"];
Expand Down Expand Up @@ -343,7 +343,7 @@ OSStatus GeneratePreviewForURL(void *thisInterface, QLPreviewRequestRef preview,
id value = nil;
NSString *synthesizedValue = nil;

if ([dataType isEqualToString:kDataType_ipa]) {
if ([dataType isEqualToString:kDataType_ipa] || [dataType isEqualToString:kDataType_tipa]) {
[synthesizedInfo setObject:@"App info" forKey:@"AppInfoTitle"];
} else if ([dataType isEqualToString:kDataType_app_extension]) {
[synthesizedInfo setObject:@"App extension info" forKey:@"AppInfoTitle"];
Expand Down
6 changes: 3 additions & 3 deletions ProvisionQL/GenerateThumbnailForURL.m
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ OSStatus GenerateThumbnailForURL(void *thisInterface, QLThumbnailRequestRef thum
appPlist = [NSData dataWithContentsOfURL:[appsDir URLByAppendingPathComponent:[NSString stringWithFormat:@"%@/Info.plist", dirFiles[0]]]];
}
}
} else if([dataType isEqualToString:kDataType_ipa]) {
} else if([dataType isEqualToString:kDataType_ipa] || [dataType isEqualToString:kDataType_tipa]) {
// get the embedded plist from an app archive using: unzip -p <URL> 'Payload/*.app/Info.plist' (piped to standard output)
NSTask *unzipTask = [NSTask new];
[unzipTask setLaunchPath:@"/usr/bin/unzip"];
Expand All @@ -67,7 +67,7 @@ OSStatus GenerateThumbnailForURL(void *thisInterface, QLThumbnailRequestRef thum
}

NSDictionary *propertiesDict = nil;
if ([dataType isEqualToString:kDataType_ipa] || [dataType isEqualToString:kDataType_xcode_archive]) {
if ([dataType isEqualToString:kDataType_ipa] || [dataType isEqualToString:kDataType_tipa] || [dataType isEqualToString:kDataType_xcode_archive]) {
NSDictionary *appPropertyList = [NSPropertyListSerialization propertyListWithData:appPlist options:0 format:NULL error:NULL];
NSString *iconName = mainIconNameForApp(appPropertyList);
appIcon = imageFromApp(URL, dataType, iconName);
Expand Down Expand Up @@ -133,7 +133,7 @@ OSStatus GenerateThumbnailForURL(void *thisInterface, QLThumbnailRequestRef thum
NSGraphicsContext *_graphicsContext = [NSGraphicsContext graphicsContextWithCGContext:(void *)_context flipped:NO];

[NSGraphicsContext setCurrentContext:_graphicsContext];
if ([dataType isEqualToString:kDataType_ipa] || [dataType isEqualToString:kDataType_xcode_archive]) {
if ([dataType isEqualToString:kDataType_ipa] || [dataType isEqualToString:kDataType_tipa] || [dataType isEqualToString:kDataType_xcode_archive]) {
[appIcon drawInRect:renderRect];
} else {
[appIcon drawInRect:renderRect];
Expand Down
1 change: 1 addition & 0 deletions ProvisionQL/Shared.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

static NSString * const kPluginBundleId = @"com.ealeksandrov.ProvisionQL";
static NSString * const kDataType_ipa = @"com.apple.itunes.ipa";
static NSString * const kDataType_tipa = @"com.opa334.trollstore.tipa";
static NSString * const kDataType_ios_provision = @"com.apple.mobileprovision";
static NSString * const kDataType_ios_provision_old = @"com.apple.iphone.mobileprovision";
static NSString * const kDataType_osx_provision = @"com.apple.provisionprofile";
Expand Down
2 changes: 1 addition & 1 deletion ProvisionQL/Shared.m
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ int expirationStatus(NSDate *date, NSCalendar *calendar) {

NSURL *appIconFullURL = [appURL URLByAppendingPathComponent:appIconFullName];
appIcon = [[NSImage alloc] initWithContentsOfURL:appIconFullURL];
} else if([dataType isEqualToString:kDataType_ipa]) {
} else if([dataType isEqualToString:kDataType_ipa] || [dataType isEqualToString:kDataType_tipa]) {
// get the embedded icon from an app arcive using: unzip -p <URL> 'Payload/*.app/<fileName>' (piped to standard output)
NSTask *unzipTask = [NSTask new];
[unzipTask setLaunchPath:@"/usr/bin/unzip"];
Expand Down
1 change: 1 addition & 0 deletions ProvisionQL/Supporting-files/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
<key>LSItemContentTypes</key>
<array>
<string>com.apple.itunes.ipa</string>
<string>com.opa334.trollstore.tipa</string>
<string>com.apple.iphone.mobileprovision</string>
<string>com.apple.mobileprovision</string>
<string>com.apple.provisionprofile</string>
Expand Down

0 comments on commit 3294c2f

Please sign in to comment.