[AltServer] Downloads latest supported AltStore version for device OS version

Asks user to install latest compatible version instead if latest AltStore version does not support their device’s OS version.
This commit is contained in:
Riley Testut
2022-11-21 17:50:42 -06:00
committed by Magesh K
parent 1fcdb18477
commit db57de28d6

View File

@@ -14,6 +14,8 @@
#import "AltStoreCore/AltStoreCore-Swift.h" #import "AltStoreCore/AltStoreCore-Swift.h"
#endif #endif
@import AltSign;
NSErrorDomain const AltServerErrorDomain = @"AltServer.ServerError"; NSErrorDomain const AltServerErrorDomain = @"AltServer.ServerError";
NSErrorDomain const AltServerInstallationErrorDomain = @"AltServer.InstallationError"; NSErrorDomain const AltServerInstallationErrorDomain = @"AltServer.InstallationError";
NSErrorDomain const AltServerConnectionErrorDomain = @"AltServer.ConnectionError"; NSErrorDomain const AltServerConnectionErrorDomain = @"AltServer.ConnectionError";
@@ -186,7 +188,17 @@ NSErrorUserInfoKey const ALTOperatingSystemVersionErrorKey = @"ALTOperatingSyste
return NSLocalizedString(@"You cannot activate more than 3 apps with a non-developer Apple ID.", @""); return NSLocalizedString(@"You cannot activate more than 3 apps with a non-developer Apple ID.", @"");
case ALTServerErrorUnsupportediOSVersion: case ALTServerErrorUnsupportediOSVersion:
{
NSString *appName = self.userInfo[ALTAppNameErrorKey];
NSString *osVersion = [self altserver_osVersion];
if (appName == nil || osVersion == nil)
{
return NSLocalizedString(@"Your device must be running iOS 12.2 or later to install SideStore.", @""); return NSLocalizedString(@"Your device must be running iOS 12.2 or later to install SideStore.", @"");
}
return [NSString stringWithFormat:NSLocalizedString(@"%@ requires %@ or later.", @""), appName, osVersion];
}
case ALTServerErrorUnknownRequest: case ALTServerErrorUnknownRequest:
return NSLocalizedString(@"SideStore does not support this request.", @""); return NSLocalizedString(@"SideStore does not support this request.", @"");