Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions AltServer/Anisette Data/AnisetteDataManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ private extension ALTAnisetteData
guard let range = self.deviceDescription.lowercased().range(of: "(" + bundleID.lowercased()) else { return }

var adjustedDescription = self.deviceDescription[..<range.lowerBound]
adjustedDescription += "(com.apple.dt.Xcode/3594.4.19)>"
adjustedDescription += "(com.apple.iCloud/7.21)>"

self.deviceDescription = String(adjustedDescription)
}
Expand Down Expand Up @@ -162,7 +162,7 @@ private extension AnisetteDataManager
let deviceModel = ProcessInfo.processInfo.deviceModel ?? "iMac21,1"
let osName = (osVersion.majorVersion < 11) ? "Mac OS X" : "macOS"

let serverFriendlyDescription = "<\(deviceModel)> <\(osName);\(osVersion.stringValue);\(buildVersion)> <com.apple.AuthKit/1 (com.apple.dt.Xcode/3594.4.19)>"
let serverFriendlyDescription = "<\(deviceModel)> <\(osName);\(osVersion.stringValue);\(buildVersion)> <com.apple.AuthKit/1 (com.apple.iCloud/7.21)>"

let anisetteData = ALTAnisetteData(machineID: machineID,
oneTimePassword: oneTimePassword,
Expand Down
17 changes: 16 additions & 1 deletion AltServer/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ class AppDelegate: NSObject, NSApplicationDelegate {
private var connectedDevices = [ALTDevice]()

private weak var authenticationAlert: NSAlert?
private var isInstallingApplication = false

@IBOutlet private var appMenu: NSMenu!
@IBOutlet private var connectedDevicesMenu: NSMenu!
Expand Down Expand Up @@ -194,6 +195,15 @@ private extension AppDelegate

func installApplication(at fileURL: URL?, to device: ALTDevice)
{
guard !self.isInstallingApplication else
{
let alert = NSAlert()
alert.messageText = NSLocalizedString("An installation is already in progress.", comment: "")
alert.informativeText = NSLocalizedString("Please wait for it to finish. Apple authentication may pause while the service is busy.", comment: "")
alert.runModal()
return
}
self.isInstallingApplication = true
let alert = NSAlert()
alert.messageText = NSLocalizedString("Please enter your Apple ID and password.", comment: "")
alert.informativeText = NSLocalizedString("Your Apple ID and password are not saved and are only sent to Apple for authentication.", comment: "")
Expand Down Expand Up @@ -232,12 +242,17 @@ private extension AppDelegate
NSRunningApplication.current.activate(options: .activateIgnoringOtherApps)

let response = alert.runModal()
guard response == .alertFirstButtonReturn else { return }
guard response == .alertFirstButtonReturn else
{
self.isInstallingApplication = false
return
}

let username = appleIDTextField.stringValue
let password = passwordTextField.stringValue

ALTDeviceManager.shared.installApplication(at: fileURL, to: device, appleID: username, password: password) { (result) in
self.isInstallingApplication = false
switch result
{
case .success(let application):
Expand Down