This commit is contained in:
Taj • forcequit 2026-05-02 15:02:38 -04:00 committed by GitHub
commit 27d0535b69
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 29 additions and 3 deletions

View File

@ -244,6 +244,10 @@ void setTSURLSchemeState(BOOL newState, NSString* customAppPath)
} }
} }
NSArray *getCurrentPlatforms(void)
{
return infoDictionaryForAppPath(trollStoreAppPath())[@"CFBundleSupportedPlatforms"];
}
#ifdef TROLLSTORE_LITE #ifdef TROLLSTORE_LITE
BOOL isLdidInstalled(void) BOOL isLdidInstalled(void)
@ -864,6 +868,7 @@ void applyPatchesToInfoDictionary(NSString* appPath)
// 174: // 174:
// 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
// 186: application is for the wrong platform
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, BOOL skipUICache)
{ {
@ -883,6 +888,23 @@ int installApp(NSString* appPackagePath, BOOL sign, BOOL force, BOOL isTSUpdate,
} }
if(!infoDictionaryForAppPath(appBundleToInstallPath)) return 172; if(!infoDictionaryForAppPath(appBundleToInstallPath)) return 172;
NSArray* currentPlatforms = getCurrentPlatforms();
NSArray* supportedPlatforms = infoDictionaryForAppPath(appBundleToInstallPath)[@"CFBundleSupportedPlatforms"];
BOOL platformMatch = NO;
for (NSString *platform in supportedPlatforms)
{
if ([currentPlatforms containsObject:platform])
{
platformMatch = YES;
break;
}
}
if (!platformMatch) return 186;
// if (![supportedPlatforms containsObject:@"iPhoneOS"]) return 186;
if(!isTSUpdate) if(!isTSUpdate)
{ {

View File

@ -91,6 +91,10 @@ extern NSUserDefaults* trollStoreUserDefaults();
break; break;
case 185: case 185:
errorDescription = @"Failed to sign the app. The CoreTrust bypass returned a non zero status code."; errorDescription = @"Failed to sign the app. The CoreTrust bypass returned a non zero status code.";
break;
case 186:
errorDescription = @"The app you tried to install is not supported on this platform. The installation has been prevented as this application will not launch at all if it were to be installed.";
break;
} }
NSError* error = [NSError errorWithDomain:TrollStoreErrorDomain code:code userInfo:@{NSLocalizedDescriptionKey : errorDescription}]; NSError* error = [NSError errorWithDomain:TrollStoreErrorDomain code:code userInfo:@{NSLocalizedDescriptionKey : errorDescription}];
@ -193,4 +197,4 @@ extern NSUserDefaults* trollStoreUserDefaults();
return spawnRoot(rootHelperPath(), @[@"modify-registration", appPath, newState], nil, nil); return spawnRoot(rootHelperPath(), @[@"modify-registration", appPath, newState], nil, nil);
} }
@end @end

View File

@ -125,7 +125,7 @@ extern NSUserDefaults* trollStoreUserDefaults(void);
utilitiesDescription = @"Apps will be registered as User by default since AppSync Unified is installed.\n\n"; utilitiesDescription = @"Apps will be registered as User by default since AppSync Unified is installed.\n\n";
} }
else { else {
utilitiesDescription = @"Apps will be registered as System by default since AppSync Unified is not installed. When apps loose their System registration and stop working, press \"Refresh App Registrations\" here to fix them.\n\n"; utilitiesDescription = @"Apps will be registered as System by default since AppSync Unified is not installed. When apps lose their System registration and stop working, press \"Refresh App Registrations\" here to fix them.\n\n";
} }
#endif #endif
utilitiesDescription = [utilitiesDescription stringByAppendingString:@"If an app does not immediately appear after installation, respring here and it should appear afterwards."]; utilitiesDescription = [utilitiesDescription stringByAppendingString:@"If an app does not immediately appear after installation, respring here and it should appear afterwards."];
@ -626,4 +626,4 @@ extern NSUserDefaults* trollStoreUserDefaults(void);
return args; return args;
} }
@end @end