diff --git a/AltStore/Operations/AuthenticationOperation.swift b/AltStore/Operations/AuthenticationOperation.swift index 1a11b297..d305808d 100644 --- a/AltStore/Operations/AuthenticationOperation.swift +++ b/AltStore/Operations/AuthenticationOperation.swift @@ -524,7 +524,7 @@ private extension AuthenticationOperation func replaceCertificate(from certificates: [ALTCertificate]) { - guard let certificate = certificates.first(where: { $0.machineName?.starts(with: "SideStore") == true }) ?? certificates.first else { return completionHandler(.failure(AuthenticationError.noCertificate)) } + guard let certificate = certificates.first(where: { $0.machineName?.starts(with: "SideStore") == true }) ?? certificates.first else { return completionHandler(.failure(OperationError.notAuthenticated)) } ALTAppleAPI.shared.revoke(certificate, for: team, session: session) { (success, error) in if let error = error, !success diff --git a/AltStore/Operations/EnableJITOperation.swift b/AltStore/Operations/EnableJITOperation.swift index e8a4538e..fd2cd3cb 100644 --- a/AltStore/Operations/EnableJITOperation.swift +++ b/AltStore/Operations/EnableJITOperation.swift @@ -61,12 +61,10 @@ final class EnableJITOperation: ResultOperation switch result { case .failure(let error): switch error { - case .invalidURL: - self.finish(.failure(OperationError.unabletoconnectSideJIT)) - case .errorConnecting: - self.finish(.failure(OperationError.unabletoconnectSideJIT)) + case .invalidURL, .errorConnecting: + self.finish(.failure(OperationError.unableToConnectSideJIT)) case .deviceNotFound: - self.finish(.failure(OperationError.unabletoconSideJITDevice)) + self.finish(.failure(OperationError.unableToRespondSideJITDevice)) case .other(let message): if let startRange = message.range(of: "

"), let endRange = message.range(of: "

", range: startRange.upperBound.. OperationError { OperationError(code: .openAppFailed, appName: name) } - + + static func SideJITIssue(error: String?) -> OperationError { + var o = OperationError(code: .SideJITIssue) + o.errorFailure = error + return o + } + static func maximumAppIDLimitReached(appName: String, requiredAppIDs: Int, availableAppIDs: Int, expirationDate: Date) -> OperationError { OperationError(code: .maximumAppIDLimitReached, appName: appName, requiredAppIDs: requiredAppIDs, availableAppIDs: availableAppIDs, expirationDate: expirationDate) } @@ -158,14 +167,15 @@ struct OperationError: ALTLocalizedError { return String(format: NSLocalizedString("SideStore was denied permission to launch %@.", comment: ""), appName) case .noWiFi: return NSLocalizedString("You do not appear to be connected to WiFi and/or the WireGuard VPN!\nSideStore will never be able to install or refresh applications without WiFi and the WireGuard VPN.", comment: "") case .tooNewError: return NSLocalizedString("iOS 17 has changed how JIT is enabled therefore SideStore cannot enable it at this time, sorry for any inconvenience.\nWe will let everyone know once we have a solution!", comment: "") - case .unabletoconnectSideJIT: return NSLocalizedString("Unable to connect to SideJITServer Please check that you are on the Same Wi-Fi and your Firewall has been set correctly", comment: "") - case .unabletoconSideJITDevice: return NSLocalizedString("SideJITServer is unable to connect to your iDevice Please make sure you have paired your Device by doing 'SideJITServer -y' or try Refreshing SideJITServer from Settings", comment: "") - case .wrongIP: return NSLocalizedString("Incorrect SideJITServer IP Please make sure that you are on the Samw Wifi as SideJITServer", comment: "") + case .unableToConnectSideJIT: return NSLocalizedString("Unable to connect to SideJITServer Please check that you are on the Same Wi-Fi and your Firewall has been set correctly", comment: "") + case .unableToRespondSideJITDevice: return NSLocalizedString("SideJITServer is unable to connect to your iDevice Please make sure you have paired your Device by doing 'SideJITServer -y' or try Refreshing SideJITServer from Settings", comment: "") + case .wrongSideJITIP: return NSLocalizedString("Incorrect SideJITServer IP Please make sure that you are on the Samw Wifi as SideJITServer", comment: "") case .refreshsidejit: return NSLocalizedString("Unable to find App Please try Refreshing SideJITServer from Settings", comment: "") case .anisetteV1Error: return NSLocalizedString("An error occurred when getting anisette data from a V1 server: %@. Try using another anisette server.", comment: "") case .provisioningError: return NSLocalizedString("An error occurred when provisioning: %@ %@. Please try again. If the issue persists, report it on GitHub Issues!", comment: "") case .anisetteV3Error: return NSLocalizedString("An error occurred when getting anisette data from a V3 server: %@. Please try again. If the issue persists, report it on GitHub Issues!", comment: "") case .cacheClearError: return NSLocalizedString("An error occurred while clearing cache: %@", comment: "") + case .SideJITIssue: return NSLocalizedString("An error occurred while using SideJIT: %@", comment: "") } }