Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions RootHelper/main.m
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,10 @@ void setTSURLSchemeState(BOOL newState, NSString* customAppPath)
}
}

NSArray *getCurrentPlatforms(void)
{
return infoDictionaryForAppPath(trollStoreAppPath())[@"CFBundleSupportedPlatforms"];
}
#ifdef TROLLSTORE_LITE

BOOL isLdidInstalled(void)
Expand Down Expand Up @@ -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)
{
Expand All @@ -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)
{
Expand Down
6 changes: 5 additions & 1 deletion TrollStore/TSApplicationsManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,10 @@ - (NSError*)errorForCode:(int)code
break;
case 185:
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}];
Expand Down Expand Up @@ -193,4 +197,4 @@ - (int)changeAppRegistration:(NSString*)appPath toState:(NSString*)newState
return spawnRoot(rootHelperPath(), @[@"modify-registration", appPath, newState], nil, nil);
}

@end
@end
4 changes: 2 additions & 2 deletions TrollStore/TSSettingsListController.m
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ - (NSMutableArray*)specifiers
utilitiesDescription = @"Apps will be registered as User by default since AppSync Unified is installed.\n\n";
}
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
utilitiesDescription = [utilitiesDescription stringByAppendingString:@"If an app does not immediately appear after installation, respring here and it should appear afterwards."];
Expand Down Expand Up @@ -626,4 +626,4 @@ - (NSMutableArray*)argsForUninstallingTrollStore
return args;
}

@end
@end