From 12823b51cd58c68088d667404676bf04d1951412 Mon Sep 17 00:00:00 2001 From: Izaan Kamal Date: Sat, 12 Sep 2026 16:03:01 -0700 Subject: [PATCH] Fix on-device sign-in failing with HTTP 503 (anisette servers still report the Xcode client identity) c5589945 switched AltServer and AltDaemon to report com.apple.akd/1.0 in X-MMe-Client-Info because Apple's authentication edge now refuses any request identifying the client as Xcode. AltStore's on-device path was not covered: FetchAnisetteDataOperation copies the client identity verbatim from the anisette server, and every server in anisette-servers.json still reports . So a refresh or sign-in from the device through Remote AltServer still fails with ALTGrandSlamErrorDomain 503. Present AltStore's own client identity instead, as AltServer already does for its own requests. There is no Mac to describe here, so use a fixed model and OS whose versions are consistent with each other, with akd as the client. Using a current OS rather than the servers' macOS 13.1 also keeps Apple granting two-factor trust (see altstoreio/AltStore#1772); the override structure follows sshane/AltStore acc15f79. --- AltStore/Anisette/AnisetteServer.swift | 9 +++++++++ AltStore/Operations/FetchAnisetteDataOperation.swift | 10 +++++++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/AltStore/Anisette/AnisetteServer.swift b/AltStore/Anisette/AnisetteServer.swift index 0d55f0a602..8ab40b4e63 100644 --- a/AltStore/Anisette/AnisetteServer.swift +++ b/AltStore/Anisette/AnisetteServer.swift @@ -53,3 +53,12 @@ extension UserDefaults } @NSManaged @objc(anisetteServers) private var _anisetteServers: [[String: Any]]? } + +extension AnisetteServer +{ + /// The client identity AltStore presents to Apple in place of the one an anisette server + /// reports, so sign-in does not depend on the identity each server chooses. + static let clientInfo = " " + + static let userAgent = "akd/1.0 CFNetwork/808.1.4" +} diff --git a/AltStore/Operations/FetchAnisetteDataOperation.swift b/AltStore/Operations/FetchAnisetteDataOperation.swift index 26be03f817..4f729a2b17 100644 --- a/AltStore/Operations/FetchAnisetteDataOperation.swift +++ b/AltStore/Operations/FetchAnisetteDataOperation.swift @@ -216,7 +216,15 @@ private extension FetchAnisetteDataOperation let decoder = Foundation.JSONDecoder() decoder.keyDecodingStrategy = .convertFromSnakeCase - let response: Response = try await self.send(URLRequest(url: clientInfoURL), decoder: decoder, anisetteServerURL: serverURL) + let serverResponse: Response = try await self.send(URLRequest(url: clientInfoURL), decoder: decoder, anisetteServerURL: serverURL) + + // Present our own client identity rather than the server's, keeping the OS and client + // consistent so Apple grants two-factor trust. + let response = Response(clientInfo: AnisetteServer.clientInfo, userAgent: AnisetteServer.userAgent) + if serverResponse.clientInfo != response.clientInfo + { + Logger.sideload.notice("Replacing anisette client identity \(serverResponse.clientInfo, privacy: .public) with \(response.clientInfo, privacy: .public)") + } // 2. Load or generate the persisted device identity (16 random bytes -> derives identifier, localUserID, deviceID) let identity: AnisetteIdentity