mirror of
https://github.com/SideStore/SideStore.git
synced 2026-02-14 09:13:25 +01:00
[AltServer] Fetches anisette data without Mail plug-in
Works on all macOS versions supported by AltServer.
This commit is contained in:
@@ -247,8 +247,7 @@ private extension AppDelegate
|
||||
let username = appleIDTextField.stringValue
|
||||
let password = passwordTextField.stringValue
|
||||
|
||||
func finish(_ result: Result<ALTApplication, Error>)
|
||||
{
|
||||
ALTDeviceManager.shared.installApplication(at: fileURL, to: device, appleID: username, password: password) { (result) in
|
||||
switch result
|
||||
{
|
||||
case .success(let application):
|
||||
@@ -269,49 +268,6 @@ private extension AppDelegate
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func install()
|
||||
{
|
||||
ALTDeviceManager.shared.installApplication(at: fileURL, to: device, appleID: username, password: password, completion: finish(_:))
|
||||
}
|
||||
|
||||
AnisetteDataManager.shared.isXPCAvailable { isAvailable in
|
||||
if isAvailable
|
||||
{
|
||||
// XPC service is available, so we don't need to install/update Mail plug-in.
|
||||
// Users can still manually do so from the AltServer menu.
|
||||
install()
|
||||
}
|
||||
else
|
||||
{
|
||||
self.pluginManager.isUpdateAvailable { result in
|
||||
switch result
|
||||
{
|
||||
case .failure(let error):
|
||||
let error = (error as NSError).withLocalizedTitle(NSLocalizedString("Could not check for Mail plug-in updates.", comment: ""))
|
||||
finish(.failure(error))
|
||||
|
||||
case .success(let isUpdateAvailable):
|
||||
self.isAltPluginUpdateAvailable = isUpdateAvailable
|
||||
|
||||
if !self.pluginManager.isMailPluginInstalled || isUpdateAvailable
|
||||
{
|
||||
self.installMailPlugin { result in
|
||||
switch result
|
||||
{
|
||||
case .failure: break
|
||||
case .success: install()
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
install()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func showErrorAlert(error: Error)
|
||||
|
||||
Reference in New Issue
Block a user