From db57de28d64694099d252fe52264be9f8fbdfe78 Mon Sep 17 00:00:00 2001 From: Riley Testut Date: Mon, 21 Nov 2022 17:50:42 -0600 Subject: [PATCH] [AltServer] Downloads latest supported AltStore version for device OS version MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Asks user to install latest compatible version instead if latest AltStore version does not support their device’s OS version. --- Shared/Categories/NSError+ALTServerError.m | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/Shared/Categories/NSError+ALTServerError.m b/Shared/Categories/NSError+ALTServerError.m index 88363818..c2d1594c 100644 --- a/Shared/Categories/NSError+ALTServerError.m +++ b/Shared/Categories/NSError+ALTServerError.m @@ -14,6 +14,8 @@ #import "AltStoreCore/AltStoreCore-Swift.h" #endif +@import AltSign; + NSErrorDomain const AltServerErrorDomain = @"AltServer.ServerError"; NSErrorDomain const AltServerInstallationErrorDomain = @"AltServer.InstallationError"; 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.", @""); case ALTServerErrorUnsupportediOSVersion: - return NSLocalizedString(@"Your device must be running iOS 12.2 or later to install SideStore.", @""); + { + 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 [NSString stringWithFormat:NSLocalizedString(@"%@ requires %@ or later.", @""), appName, osVersion]; + } case ALTServerErrorUnknownRequest: return NSLocalizedString(@"SideStore does not support this request.", @"");