From ebea623976ffac4b84fe356ea81123fc9979b58e Mon Sep 17 00:00:00 2001 From: khanhduytran0 Date: Mon, 22 Apr 2024 21:25:55 +0700 Subject: [PATCH] Cleanup --- LCJITLessSetupViewController.m | 2 ++ LCUtils.m | 21 +++++++-------------- 2 files changed, 9 insertions(+), 14 deletions(-) diff --git a/LCJITLessSetupViewController.m b/LCJITLessSetupViewController.m index 6f14ff6..e8825af 100644 --- a/LCJITLessSetupViewController.m +++ b/LCJITLessSetupViewController.m @@ -19,9 +19,11 @@ - (void)loadView { self.title = @"LiveContainer JIT-less setup"; NSData *certData = [LCUtils keychainItem:@"signingCertificate" ofStore:@"com.SideStore.SideStore"]; +/* TODO: support AltStore if (!certData) { certData = [LCUtils keychainItem:@"signingCertificate" ofStore:@"com.rileytestut.AltStore"]; } +*/ if (!certData) { [self showDialogTitle:@"Error" message:@"Failed to find certificate" handler:nil]; return; diff --git a/LCUtils.m b/LCUtils.m index bbc22e8..6ec319a 100644 --- a/LCUtils.m +++ b/LCUtils.m @@ -133,20 +133,13 @@ + (NSProgress *)signAppBundle:(NSURL *)path completionHandler:(void (^)(BOOL suc NSURL *profilePath = [NSBundle.mainBundle URLForResource:@"embedded" withExtension:@"mobileprovision"]; // Load libraries from Documents, yeah - [[NSBundle bundleWithURL:[storeFrameworksPath URLByAppendingPathComponent:@"OpenSSL.framework"]] loadAndReturnError:&error]; - if (error) { - completionHandler(NO, error); - return nil; - } - [[NSBundle bundleWithURL:[storeFrameworksPath URLByAppendingPathComponent:@"Roxas.framework"]] loadAndReturnError:&error]; - if (error) { - completionHandler(NO, error); - return nil; - } - [[NSBundle bundleWithURL:[storeFrameworksPath URLByAppendingPathComponent:@"AltStoreCore.framework"]] loadAndReturnError:&error]; - if (error) { - completionHandler(NO, error); - return nil; + NSArray *signerFrameworks = @[@"OpenSSL.framework", @"Roxas.framework", @"AltStoreCore.framework"]; + for (NSString *framework in signerFrameworks) { + [[NSBundle bundleWithURL:[storeFrameworksPath URLByAppendingPathComponent:framework]] loadAndReturnError:&error]; + if (error) { + completionHandler(NO, error); + return nil; + } } ALTCertificate *cert = [[NSClassFromString(@"ALTCertificate") alloc] initWithP12Data:self.certificateData password:@""];