[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
parent 61bcb31709
commit 579885acd6
3 changed files with 192 additions and 19 deletions

View File

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