diff --git a/RootHelper/control b/RootHelper/control index 4a82fb8..8799025 100644 --- a/RootHelper/control +++ b/RootHelper/control @@ -1,6 +1,6 @@ Package: com.opa334.trollstoreroothelper Name: trollstoreroothelper -Version: 1.2 +Version: 1.2.1 Architecture: iphoneos-arm Description: An awesome tool of some sort!! Maintainer: opa334 diff --git a/RootHelper/main.m b/RootHelper/main.m index 558d040..32e3f77 100644 --- a/RootHelper/main.m +++ b/RootHelper/main.m @@ -80,6 +80,20 @@ NSSet* appleURLSchemes(void) return systemURLSchemes.copy; } +NSSet* appleAppBundleIdentifiers(void) +{ + LSEnumerator* enumerator = [LSEnumerator enumeratorForApplicationProxiesWithOptions:0]; + enumerator.predicate = [NSPredicate predicateWithFormat:@"bundleIdentifier BEGINSWITH 'com.apple'"]; + + NSMutableSet* systemAppIdentifiers = [NSMutableSet new]; + LSApplicationProxy* proxy; + while(proxy = [enumerator nextObject]) + { + [systemAppIdentifiers addObject:proxy.bundleIdentifier.lowercaseString]; + } + + return systemAppIdentifiers.copy; +} NSDictionary* infoDictionaryForAppPath(NSString* appPath) { @@ -583,8 +597,15 @@ int installApp(NSString* appPath, BOOL sign, BOOL force) NSString* appId = appIdForAppPath(appPath); if(!appId) return 176; + if([appleAppBundleIdentifiers() containsObject:appId.lowercaseString]) + { + return 179; + } - applyPatchesToInfoDictionary(appPath); + if(![appId isEqualToString:@"com.opa334.TrollStore"]) + { + applyPatchesToInfoDictionary(appPath); + } if(sign) { @@ -875,6 +896,12 @@ int installIpa(NSString* ipaPath, BOOL force) } } if(!tmpAppPath) return 167; + + NSString* appId = appIdForAppPath(tmpAppPath); + if([appId.lowercaseString isEqualToString:@"com.opa334.trollstore"]) + { + return 179; + } int ret = installApp(tmpAppPath, YES, force); diff --git a/RootHelper/uicache.m b/RootHelper/uicache.m index f50e214..636148e 100644 --- a/RootHelper/uicache.m +++ b/RootHelper/uicache.m @@ -6,6 +6,7 @@ // uicache on steroids +extern NSSet* appleAppBundleIdentifiers(void); extern NSDictionary* dumpEntitlementsFromBinaryAtPath(NSString* binaryPath); NSDictionary* constructGroupsContainersForEntitlements(NSDictionary* entitlements, BOOL systemGroups) @@ -108,6 +109,8 @@ void registerPath(char* cPath, int unregister) NSDictionary* appInfoPlist = [NSDictionary dictionaryWithContentsOfFile:[path stringByAppendingPathComponent:@"Info.plist"]]; NSString* appBundleID = [appInfoPlist objectForKey:@"CFBundleIdentifier"]; + if([appleAppBundleIdentifiers() containsObject:appBundleID.lowercaseString]) return; + if(appBundleID && !unregister) { MCMContainer* appContainer = [NSClassFromString(@"MCMAppDataContainer") containerWithIdentifier:appBundleID createIfNecessary:YES existed:nil error:nil]; diff --git a/TrollHelper/Resources/Info.plist b/TrollHelper/Resources/Info.plist index 6fb1e96..2a6049b 100644 --- a/TrollHelper/Resources/Info.plist +++ b/TrollHelper/Resources/Info.plist @@ -52,7 +52,7 @@ iPhoneOS CFBundleVersion - 1.2 + 1.2.1 LSRequiresIPhoneOS UIDeviceFamily diff --git a/TrollHelper/control b/TrollHelper/control index a0ac732..9faecfb 100644 --- a/TrollHelper/control +++ b/TrollHelper/control @@ -1,6 +1,6 @@ Package: com.opa334.trollstorehelper Name: TrollStore Helper -Version: 1.2 +Version: 1.2.1 Architecture: iphoneos-arm Description: Helper utility to install and manage TrollStore! Maintainer: opa334 diff --git a/TrollStore/Resources/Info.plist b/TrollStore/Resources/Info.plist index e1ab217..41602f5 100644 --- a/TrollStore/Resources/Info.plist +++ b/TrollStore/Resources/Info.plist @@ -50,7 +50,7 @@ iPhoneOS CFBundleVersion - 1.2 + 1.2.1 LSRequiresIPhoneOS UIDeviceFamily diff --git a/TrollStore/TSApplicationsManager.m b/TrollStore/TSApplicationsManager.m index 652c051..eebc197 100644 --- a/TrollStore/TSApplicationsManager.m +++ b/TrollStore/TSApplicationsManager.m @@ -109,6 +109,9 @@ case 178: errorDescription = @"Failed to copy app bundle."; break; + case 179: + errorDescription = @"The app you tried to install has the same identifier as a system app already installed on the device. The installation has been prevented to protect you from possible bootloops or other issues."; + break; // App detach errors /*case 184: errorDescription = @"Refusing to detach, the app is still signed with a fake root certificate. The detach option is only for when you have installed an App Store app on top of a TrollStore app."; diff --git a/TrollStore/control b/TrollStore/control index 8ea5828..0b07353 100644 --- a/TrollStore/control +++ b/TrollStore/control @@ -1,6 +1,6 @@ Package: com.opa334.trollstore Name: TrollStore -Version: 1.2 +Version: 1.2.1 Architecture: iphoneos-arm Description: An awesome application! Maintainer: opa334