[AltServer] Suggests disabling “Offload Unused Apps” in error message

iOS 13.5 counts offloaded apps as active sideloaded apps (for some reason), so improve error messages to mention this.
This commit is contained in:
Riley Testut
2020-05-21 21:00:05 -07:00
parent 64f8983d29
commit 2411cca51f
3 changed files with 14 additions and 1 deletions

View File

@@ -30,7 +30,13 @@ struct CodableServerError: Codable
{
self.errorCode = error.code
let userInfo = error.userInfo.compactMapValues { $0 as? String }
var userInfo = error.userInfo.compactMapValues { $0 as? String }
if let localizedRecoverySuggestion = (error as NSError).localizedRecoverySuggestion
{
userInfo[NSLocalizedRecoverySuggestionErrorKey] = localizedRecoverySuggestion
}
if !userInfo.isEmpty
{
self.userInfo = userInfo

View File

@@ -112,6 +112,9 @@ NSErrorUserInfoKey const ALTProvisioningProfileBundleIDErrorKey = @"bundleIdenti
case ALTServerErrorPluginNotFound:
return NSLocalizedString(@"Make sure Mail is running and the plug-in is enabled in Mail's preferences.", @"");
case ALTServerErrorMaximumFreeAppLimitReached:
return NSLocalizedString(@"Make sure “Offload Unused Apps” is disabled in Settings > iTunes & App Stores, then install or delete all offloaded apps.", @"");
default:
return nil;
}

View File

@@ -212,6 +212,10 @@ private extension AppDelegate
{
alert.informativeText = underlyingError.localizedDescription
}
else if let recoverySuggestion = error.localizedRecoverySuggestion
{
alert.informativeText = error.localizedDescription + "\n\n" + recoverySuggestion
}
else
{
alert.informativeText = error.localizedDescription