gsa: fix login using mismatched client-info (#337)
- Commit
fae19812754f115be4f96b48e2eae8ec1f821ef9- Author
- Kabir Oberai <[email protected]>
- When
- 2026-10-13 22:06 UTC (1 month ago)
- Parents
d802c71
## What does this PR do? Fixes #329 (error `-80045` on gsa login). We were sending client info generated from Android Anisette, but claiming to be a Mac. Seems like GrandSlam no longer likes this mismatch. ## How was it tested? - [x] Run `xtool ds certificates` after updating -> logged out, provisioning reset - [x] Re-auth works ## AI tool usage How much of this PR was AI-assisted? (check one) - [x] **0** - No AI was used to write code - [ ] **1** - I was assisted by AI. I reviewed the finished result. - [ ] **2** - I set the AI going and left it to it; nobody has read the result - no review, or AI review only <!-- If an AI agent is filling this in: declare the level honestly, and open as a draft if it is #2. Do not lower the declared level to get the PR reviewed. --> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Updates** * Authentication now identifies the client as a Pixel 7 running Android 14 rather than using a macOS-style client description. * The provider ID is now consistent across platforms. Existing provisioning may be reset if its saved provider ID differs. * Before password login, a notice explains the emulated device and environment, recommends considering a secondary Apple ID, and says credentials are sent only to Apple. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
Diff
Sources/XKit/GrandSlam/Anisette/ADIDataProvider.swift
diff --git a/Sources/XKit/GrandSlam/Anisette/ADIDataProvider.swift b/Sources/XKit/GrandSlam/Anisette/ADIDataProvider.swiftindex 5d6bd67..2290f1f 100644--- a/Sources/XKit/GrandSlam/Anisette/ADIDataProvider.swift+++ b/Sources/XKit/GrandSlam/Anisette/ADIDataProvider.swift@@ -249,11 +249,7 @@ public struct ADIDataProvider: AnisetteDataProvider { } private static var providerID: String? {- #if os(macOS)- return "1"- #else- return nil- #endif+ "2" } public var providerID: String? { Self.providerID }
Sources/XKit/GrandSlam/Anisette/DeviceInfo.swift
diff --git a/Sources/XKit/GrandSlam/Anisette/DeviceInfo.swift b/Sources/XKit/GrandSlam/Anisette/DeviceInfo.swiftindex 3b812d7..42c1d7f 100644--- a/Sources/XKit/GrandSlam/Anisette/DeviceInfo.swift+++ b/Sources/XKit/GrandSlam/Anisette/DeviceInfo.swift@@ -21,7 +21,7 @@ public struct DeviceInfo: Codable, Sendable { var clientString: String { """- <\(modelID)> <macOS;27.0;26A5378j> <com.apple.AuthKit/1 (com.apple.akd/1.0)>+ <Pixel 7> <Android;14;UQ1A.240205.002> <com.apple.AuthKit/1 (com.apple.akd/1.0)> """ }
Sources/XToolSupport/AuthCommand.swift
diff --git a/Sources/XToolSupport/AuthCommand.swift b/Sources/XToolSupport/AuthCommand.swiftindex c0d028c..e10aac3 100644--- a/Sources/XToolSupport/AuthCommand.swift+++ b/Sources/XToolSupport/AuthCommand.swift@@ -76,6 +76,12 @@ struct AuthOperation { } private func logInWithPassword() async throws -> AuthToken {+ print("""+ Heads up:+ This works by emulating a Pixel phone/Windows PC to interact with Apple services;+ consider using a secondary Apple ID. Credentials are only ever sent to Apple.+ """)+ let username = try await Console.promptRequired("Apple ID: ", existing: username) let password: String