diff --git a/AltServer/AppDelegate.swift b/AltServer/AppDelegate.swift index 71c08d21..356674bc 100644 --- a/AltServer/AppDelegate.swift +++ b/AltServer/AppDelegate.swift @@ -279,6 +279,13 @@ private extension AppDelegate var messageComponents = [String]() + let separator: String + switch error + { + case ALTServerError.maximumFreeAppLimitReached: separator = "\n\n" + default: separator = " " + } + if let errorFailure = nsError.localizedFailure { if let failureReason = nsError.localizedFailureReason @@ -322,7 +329,7 @@ private extension AppDelegate messageComponents.append(recoverySuggestion) } - let informativeText = messageComponents.joined(separator: " ") + let informativeText = messageComponents.joined(separator: separator) alert.informativeText = informativeText NSRunningApplication.current.activate(options: .activateIgnoringOtherApps) diff --git a/AltServer/Devices/ALTDeviceManager.mm b/AltServer/Devices/ALTDeviceManager.mm index d8e048f2..9899f9c6 100644 --- a/AltServer/Devices/ALTDeviceManager.mm +++ b/AltServer/Devices/ALTDeviceManager.mm @@ -1597,15 +1597,18 @@ void ALTDeviceManagerUpdateStatus(plist_t command, plist_t status, void *uuid) void (^completionHandler)(NSError *) = ALTDeviceManager.sharedManager.installationCompletionHandlers[UUID]; if (completionHandler != nil) { + NSString *localizedDescription = @(description ?: ""); + if (code != 0 || name != NULL) { - NSLog(@"Error installing app. %@ (%@). %@", @(code), @(name ?: ""), @(description ?: "")); + NSLog(@"Error installing app. %@ (%@). %@", @(code), @(name ?: ""), localizedDescription); NSError *error = nil; if (code == 3892346913) { - error = [NSError errorWithDomain:AltServerErrorDomain code:ALTServerErrorMaximumFreeAppLimitReached userInfo:nil]; + NSDictionary *userInfo = (localizedDescription.length != 0) ? @{NSLocalizedDescriptionKey: localizedDescription} : nil; + error = [NSError errorWithDomain:AltServerErrorDomain code:ALTServerErrorMaximumFreeAppLimitReached userInfo:userInfo]; } else { @@ -1616,7 +1619,7 @@ void ALTDeviceManagerUpdateStatus(plist_t command, plist_t status, void *uuid) } else { - NSError *underlyingError = [NSError errorWithDomain:AltServerInstallationErrorDomain code:code userInfo:@{NSLocalizedDescriptionKey: @(description ?: "")}]; + NSError *underlyingError = [NSError errorWithDomain:AltServerInstallationErrorDomain code:code userInfo:@{NSLocalizedDescriptionKey: localizedDescription}]; error = [NSError errorWithDomain:AltServerErrorDomain code:ALTServerErrorInstallationFailed userInfo:@{NSUnderlyingErrorKey: underlyingError}]; } } diff --git a/Shared/Categories/NSError+ALTServerError.m b/Shared/Categories/NSError+ALTServerError.m index 6a60dce7..0ce58d68 100644 --- a/Shared/Categories/NSError+ALTServerError.m +++ b/Shared/Categories/NSError+ALTServerError.m @@ -102,7 +102,7 @@ NSErrorUserInfoKey const ALTDeviceNameErrorKey = @"deviceName"; return NSLocalizedString(@"An error occured while installing the app.", @""); case ALTServerErrorMaximumFreeAppLimitReached: - return NSLocalizedString(@"Cannot activate more than 3 apps and app extensions.", @""); + return NSLocalizedString(@"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.", @""); @@ -146,7 +146,11 @@ NSErrorUserInfoKey const ALTDeviceNameErrorKey = @"deviceName"; 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.", @""); +#if TARGET_OS_OSX + return NSLocalizedString(@"Please deactivate a sideloaded app with AltStore in order to install another app.\n\nIf you're running iOS 13.5 or later, make sure 'Offload Unused Apps' is disabled in Settings > iTunes & App Stores, then install or delete all offloaded apps to prevent them from erroneously counting towards this limit.", @""); +#else + return NSLocalizedString(@"Please deactivate a sideloaded app in order to install another one.\n\nIf you're running iOS 13.5 or later, make sure “Offload Unused Apps” is disabled in Settings > iTunes & App Stores, then install or delete all offloaded apps.", @""); +#endif case ALTServerErrorRequestedAppNotRunning: {