Skip to content
Closed
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
9 changes: 8 additions & 1 deletion AltServer/Anisette Data/LocalAnisetteDataManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,13 @@ private extension URL
static let unzip = URL(fileURLWithPath: "/usr/bin/unzip")
}

private extension String
{
// AnisetteKit provisions an Android device, and GrandSlam now rejects sign-in with -80045
// when X-MMe-Client-Info describes a Mac instead.
static let androidClientInfo = "<Pixel 7> <Android;14;UQ1A.240205.002> <com.apple.AuthKit/1 (com.apple.akd/1.0)>"
}

// Swift wrapper around AnisetteKit to generate anisette data when macOS won't provide it.
class LocalAnisetteDataManager
{
Expand Down Expand Up @@ -155,7 +162,7 @@ private extension LocalAnisetteDataManager
routingInfo: routingInfo,
deviceUniqueIdentifier: identifier.uuidString.uppercased(),
deviceSerialNumber: AnisetteConstants.defaultSerialNumber,
deviceDescription: client.clientInfo,
deviceDescription: .androidClientInfo,
date: Date(),
locale: .current,
timeZone: .current)
Expand Down
11 changes: 11 additions & 0 deletions AltServer/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,17 @@ class AppDelegate: NSObject, NSApplicationDelegate {
ServerConnectionManager.shared.start()
ALTDeviceManager.shared.start()

// Apple rejects one-time passwords that were already used, so let AltSign ask for new anisette data between sign-in steps.
ALTAppleAPI.shared.anisetteDataRefreshHandler = { (completionHandler) in
AnisetteDataManager.shared.requestAnisetteData { (result) in
switch result
{
case .failure(let error): completionHandler(nil, error)
case .success(let anisetteData): completionHandler(anisetteData, nil)
}
}
}

#if STAGING
SUUpdater.shared().feedURL = URL(string: "https://altstore.io/altserver/sparkle-macos-staging.xml")
#else
Expand Down