1
0
mirror of https://github.com/opa334/TrollStore.git synced 2025-02-20 12:15:42 +08:00

Compare commits

..

No commits in common. "3913abfd8d137bc775d18179afdbddc828b66120" and "ac24773858c470893aace6e14281710a9c44862c" have entirely different histories.

4 changed files with 9 additions and 30 deletions

2
ChOma

@ -1 +1 @@
Subproject commit 985302d7c14ba38e7275927b56a10887e899f594 Subproject commit b819acbad86eae7a187062d344a1cb62c60daa9b

View File

@ -127,18 +127,6 @@ int apply_coretrust_bypass(const char *machoPath)
macho_free(macho); macho_free(macho);
return 2; return 2;
} }
if (macho->machHeader.filetype == MH_OBJECT) {
printf("Error: MachO is an object file, please use a MachO executable or dynamic library!\n");
macho_free(macho);
return 3;
}
if (macho->machHeader.filetype == MH_DSYM) {
printf("Error: MachO is a dSYM file, please use a MachO executable or dynamic library!\n");
macho_free(macho);
return 3;
}
CS_SuperBlob *superblob = macho_read_code_signature(macho); CS_SuperBlob *superblob = macho_read_code_signature(macho);
if (!superblob) { if (!superblob) {

View File

@ -72,10 +72,6 @@ int main(int argc, char *argv[]) {
} }
char *machoPath = extract_preferred_slice(input); char *machoPath = extract_preferred_slice(input);
if (!machoPath) {
printf("Failed extracting best slice\n");
return -1;
}
printf("Extracted best slice to %s\n", machoPath); printf("Extracted best slice to %s\n", machoPath);
printf("Applying CoreTrust bypass...\n"); printf("Applying CoreTrust bypass...\n");

View File

@ -709,8 +709,6 @@ int signApp(NSString* appPath)
// If not, we can continue but want to show a warning after the app is installed // If not, we can continue but want to show a warning after the app is installed
hasAdditionalEncryptedBinaries = YES; hasAdditionalEncryptedBinaries = YES;
} }
} else if (r == 3) { // Non-fatal - unsupported MachO type
NSLog(@"[%@] Cannot apply CoreTrust bypass on an unsupported MachO type!", filePath);
} }
else { else {
NSLog(@"[%@] CoreTrust bypass failed!!! :(", filePath); NSLog(@"[%@] CoreTrust bypass failed!!! :(", filePath);
@ -798,7 +796,7 @@ void applyPatchesToInfoDictionary(NSString* appPath)
// 180: tried to sign app where the main binary is encrypted // 180: tried to sign app where the main binary is encrypted
// 184: tried to sign app where an additional binary is encrypted // 184: tried to sign app where an additional binary is encrypted
int installApp(NSString* appPackagePath, BOOL sign, BOOL force, BOOL isTSUpdate, BOOL useInstalldMethod, BOOL skipUICache) int installApp(NSString* appPackagePath, BOOL sign, BOOL force, BOOL isTSUpdate, BOOL useInstalldMethod)
{ {
NSLog(@"[installApp force = %d]", force); NSLog(@"[installApp force = %d]", force);
@ -980,11 +978,9 @@ int installApp(NSString* appPackagePath, BOOL sign, BOOL force, BOOL isTSUpdate,
// Also permissions need to be fixed // Also permissions need to be fixed
NSURL* updatedAppURL = findAppURLInBundleURL(appContainer.url); NSURL* updatedAppURL = findAppURLInBundleURL(appContainer.url);
fixPermissionsOfAppBundle(updatedAppURL.path); fixPermissionsOfAppBundle(updatedAppURL.path);
if (!skipUICache) { if (!registerPath(updatedAppURL.path, 0, YES)) {
if (!registerPath(updatedAppURL.path, 0, YES)) { [[NSFileManager defaultManager] removeItemAtURL:appContainer.url error:nil];
[[NSFileManager defaultManager] removeItemAtURL:appContainer.url error:nil]; return 181;
return 181;
}
} }
// Handle developer mode after installing and registering the app, to ensure that we // Handle developer mode after installing and registering the app, to ensure that we
@ -1116,7 +1112,7 @@ int uninstallAppById(NSString* appId, BOOL useCustomMethod)
// 167: IPA does not appear to contain an app // 167: IPA does not appear to contain an app
// 180: IPA's main binary is encrypted // 180: IPA's main binary is encrypted
// 184: IPA contains additional encrypted binaries // 184: IPA contains additional encrypted binaries
int installIpa(NSString* ipaPath, BOOL force, BOOL useInstalldMethod, BOOL skipUICache) int installIpa(NSString* ipaPath, BOOL force, BOOL useInstalldMethod)
{ {
cleanRestrictions(); cleanRestrictions();
@ -1135,7 +1131,7 @@ int installIpa(NSString* ipaPath, BOOL force, BOOL useInstalldMethod, BOOL skipU
return 168; return 168;
} }
int ret = installApp(tmpPackagePath, YES, force, NO, useInstalldMethod, skipUICache); int ret = installApp(tmpPackagePath, YES, force, NO, useInstalldMethod);
[[NSFileManager defaultManager] removeItemAtPath:tmpPackagePath error:nil]; [[NSFileManager defaultManager] removeItemAtPath:tmpPackagePath error:nil];
@ -1238,7 +1234,7 @@ int installTrollStore(NSString* pathToTar)
_installPersistenceHelper(persistenceHelperApp, trollStorePersistenceHelper, trollStoreRootHelper); _installPersistenceHelper(persistenceHelperApp, trollStorePersistenceHelper, trollStoreRootHelper);
} }
int ret = installApp(tmpPackagePath, NO, YES, YES, YES, NO); int ret = installApp(tmpPackagePath, NO, YES, YES, YES);
NSLog(@"[installTrollStore] installApp => %d", ret); NSLog(@"[installTrollStore] installApp => %d", ret);
[[NSFileManager defaultManager] removeItemAtPath:tmpPackagePath error:nil]; [[NSFileManager defaultManager] removeItemAtPath:tmpPackagePath error:nil];
return ret; return ret;
@ -1468,9 +1464,8 @@ int MAIN_NAME(int argc, char *argv[], char *envp[])
// use system method when specified, otherwise use custom method // use system method when specified, otherwise use custom method
BOOL useInstalldMethod = [args containsObject:@"installd"]; BOOL useInstalldMethod = [args containsObject:@"installd"];
BOOL force = [args containsObject:@"force"]; BOOL force = [args containsObject:@"force"];
BOOL skipUICache = [args containsObject:@"skip-uicache"];
NSString* ipaPath = args.lastObject; NSString* ipaPath = args.lastObject;
ret = installIpa(ipaPath, force, useInstalldMethod, skipUICache); ret = installIpa(ipaPath, force, useInstalldMethod);
} }
else if([cmd isEqualToString:@"uninstall"]) else if([cmd isEqualToString:@"uninstall"])
{ {