From dda4e636f69759e8893ec5b998bde1d09d010b18 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Taj=20=E2=80=A2=20forcequitOS?= <62081155+forcequitOS@users.noreply.github.com> Date: Sat, 2 May 2026 14:09:21 -0400 Subject: [PATCH] Add platform check --- RootHelper/main.m | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/RootHelper/main.m b/RootHelper/main.m index d06d27a..1a01b3c 100644 --- a/RootHelper/main.m +++ b/RootHelper/main.m @@ -244,6 +244,10 @@ void setTSURLSchemeState(BOOL newState, NSString* customAppPath) } } +NSArray *getCurrentPlatforms(void) +{ + return infoDictionaryForAppPath(trollStoreAppPath())[@"CFBundleSupportedPlatforms"]; +} #ifdef TROLLSTORE_LITE BOOL isLdidInstalled(void) @@ -864,6 +868,7 @@ void applyPatchesToInfoDictionary(NSString* appPath) // 174: // 180: tried to sign app where the main 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) { @@ -883,6 +888,23 @@ int installApp(NSString* appPackagePath, BOOL sign, BOOL force, BOOL isTSUpdate, } 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) {