Info.plist fast path for apps already CT-signed

Apps declaring TSBundlePreSigned = YES in their Info.plist will not be signed by TrollStore
This commit is contained in:
Luke Noble 2022-09-04 19:48:20 +01:00
parent a685c9e07c
commit 5659a84c57
No known key found for this signature in database
GPG Key ID: 03AA6DA204DE950D
1 changed files with 13 additions and 0 deletions

View File

@ -347,6 +347,19 @@ BOOL signApp(NSString* appPath, NSError** error)
if(![[NSFileManager defaultManager] fileExistsAtPath:executablePath]) return NO;
NSObject *tsBundleIsPreSigned = appInfoDict[@"TSBundlePreSigned"];
if([tsBundleIsPreSigned isKindOfClass:[NSNumber class]])
{
// if TSBundlePreSigned = YES, this bundle has been externally signed so we can skip over signing it now
NSNumber *tsBundleIsPreSignedNum = (NSNumber *)tsBundleIsPreSigned;
if([tsBundleIsPreSignedNum boolValue] == YES)
{
NSLog(@"[signApp] taking fast path for app which declares it has already been CT-signed (%@)", executablePath);
return YES;
}
}
NSString* certPath = [trollStoreAppPath() stringByAppendingPathComponent:@"cert.p12"];
NSString* certArg = [@"-K" stringByAppendingPathComponent:certPath];
NSString* errorOutput;