Skip to content

Commit fae1981

Browse files
authored
gsa: fix login using mismatched client-info (#337)
## 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 -->
1 parent d802c71 commit fae1981

3 files changed

Lines changed: 8 additions & 6 deletions

File tree

‎Sources/XKit/GrandSlam/Anisette/ADIDataProvider.swift‎

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -249,11 +249,7 @@ public struct ADIDataProvider: AnisetteDataProvider {
249249
}
250250

251251
private static var providerID: String? {
252-
#if os(macOS)
253-
return "1"
254-
#else
255-
return nil
256-
#endif
252+
"2"
257253
}
258254

259255
public var providerID: String? { Self.providerID }

‎Sources/XKit/GrandSlam/Anisette/DeviceInfo.swift‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public struct DeviceInfo: Codable, Sendable {
2121

2222
var clientString: String {
2323
"""
24-
<\(modelID)> <macOS;27.0;26A5378j> <com.apple.AuthKit/1 (com.apple.akd/1.0)>
24+
<Pixel 7> <Android;14;UQ1A.240205.002> <com.apple.AuthKit/1 (com.apple.akd/1.0)>
2525
"""
2626
}
2727

‎Sources/XToolSupport/AuthCommand.swift‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,12 @@ struct AuthOperation {
7676
}
7777

7878
private func logInWithPassword() async throws -> AuthToken {
79+
print("""
80+
Heads up:
81+
This works by emulating a Pixel phone/Windows PC to interact with Apple services;
82+
consider using a secondary Apple ID. Credentials are only ever sent to Apple.
83+
""")
84+
7985
let username = try await Console.promptRequired("Apple ID: ", existing: username)
8086

8187
let password: String

0 commit comments

Comments
 (0)