mirror of
https://github.com/SideStore/SideStore.git
synced 2026-02-09 06:43:25 +01:00
[AltServer] Fixes not ignoring InstallationError.cancelled when installing app
Allows InstallationError to be bridged back from NSError, which lets us match InstallationError against NSError's via pattern matching.
This commit is contained in:
@@ -14,7 +14,7 @@ private let appGroupsLock = NSLock()
|
|||||||
|
|
||||||
private let developerDiskManager = DeveloperDiskManager()
|
private let developerDiskManager = DeveloperDiskManager()
|
||||||
|
|
||||||
enum InstallError: LocalizedError
|
enum InstallError: Int, LocalizedError, _ObjectiveCBridgeableError
|
||||||
{
|
{
|
||||||
case cancelled
|
case cancelled
|
||||||
case noTeam
|
case noTeam
|
||||||
@@ -30,6 +30,20 @@ enum InstallError: LocalizedError
|
|||||||
case .missingCertificate: return "The developer certificate could not be found."
|
case .missingCertificate: return "The developer certificate could not be found."
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
init?(_bridgedNSError error: NSError)
|
||||||
|
{
|
||||||
|
guard error.domain == InstallError.cancelled._domain else { return nil }
|
||||||
|
|
||||||
|
if let installError = InstallError(rawValue: error.code)
|
||||||
|
{
|
||||||
|
self = installError
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
extension ALTDeviceManager
|
extension ALTDeviceManager
|
||||||
|
|||||||
Reference in New Issue
Block a user