Modern Apps git

← xtool.git

FIX 2FA LFG

Commit
402ea4e6ee8e9e4f9bd6c7810e98351166af3522
Author
Kabir Oberai <[email protected]>
When
2024-11-16 07:52 UTC (2 years ago)
Parents
fffdf0d

Diff

Supersign/Sources/Supersign/GrandSlam/Anisette/AnisetteData.swift
diff --git a/Supersign/Sources/Supersign/GrandSlam/Anisette/AnisetteData.swift b/Supersign/Sources/Supersign/GrandSlam/Anisette/AnisetteData.swiftindex 6a31c61..eb7a12f 100644--- a/Supersign/Sources/Supersign/GrandSlam/Anisette/AnisetteData.swift+++ b/Supersign/Sources/Supersign/GrandSlam/Anisette/AnisetteData.swift@@ -53,8 +53,13 @@ public struct AnisetteData {     public var deviceID: String?      var dictionary: [String: String] {+        let localeIdentifier = if let language = locale.languageCode, let region = locale.regionCode {+            "\(language)_\(region)"+        } else {+            "en_US"+        }         var dictionary = [-            Self.localeKey: locale.identifier,+            Self.localeKey: localeIdentifier,             Self.timeZoneKey: timeZone.abbreviation() ?? "UTC",             Self.clientTimeKey: Self.dateFormatter.string(from: clientTime),             Self.routingInfoKey: "\(routingInfo)",
Supersign/Sources/Supersign/GrandSlam/Anisette/DeviceInfo.swift
diff --git a/Supersign/Sources/Supersign/GrandSlam/Anisette/DeviceInfo.swift b/Supersign/Sources/Supersign/GrandSlam/Anisette/DeviceInfo.swiftindex d63b7ae..fa0e27f 100644--- a/Supersign/Sources/Supersign/GrandSlam/Anisette/DeviceInfo.swift+++ b/Supersign/Sources/Supersign/GrandSlam/Anisette/DeviceInfo.swift@@ -13,7 +13,7 @@ public struct DeviceInfo: Codable {     /// `X-Xcode-Version`     static let xcodeVersionKey = "X-Xcode-Version"     /// Not included in `dictionary`-    public static let xcodeVersion = "11.2 (11B41)"+    public static let xcodeVersion = "14.2 (14C18)"      public struct ClientInfo: Codable {         public static let macOSVersion = "10.14.6"
Supersign/Sources/Supersign/GrandSlam/GrandSlamClient.swift
diff --git a/Supersign/Sources/Supersign/GrandSlam/GrandSlamClient.swift b/Supersign/Sources/Supersign/GrandSlam/GrandSlamClient.swiftindex 7bf8b46..5c82bf7 100644--- a/Supersign/Sources/Supersign/GrandSlam/GrandSlamClient.swift+++ b/Supersign/Sources/Supersign/GrandSlam/GrandSlamClient.swift@@ -36,7 +36,7 @@ class GrandSlamClient {         var httpRequest = HTTPRequest(url: url, method: method.name)         httpRequest.headers = [             "Content-Type": "text/x-xml-plist",-            DeviceInfo.clientInfoKey: "<PC> <Windows;6.2(0,0);9200> <com.apple.AuthKitWin/1 (com.apple.iCloud/7.21)>" // deviceInfo.clientInfo.clientString+            DeviceInfo.clientInfoKey: deviceInfo.clientInfo.clientString         ]         switch method {         case .get:
Supersign/Sources/Supersign/GrandSlam/Requests/GrandSlamOperationRequest.swift
diff --git a/Supersign/Sources/Supersign/GrandSlam/Requests/GrandSlamOperationRequest.swift b/Supersign/Sources/Supersign/GrandSlam/Requests/GrandSlamOperationRequest.swiftindex 8a6bc77..1e840ab 100644--- a/Supersign/Sources/Supersign/GrandSlam/Requests/GrandSlamOperationRequest.swift+++ b/Supersign/Sources/Supersign/GrandSlam/Requests/GrandSlamOperationRequest.swift@@ -72,10 +72,6 @@ extension GrandSlamOperationRequest {     func configure(request: inout HTTPRequest, deviceInfo: DeviceInfo, anisetteData: AnisetteData) {         request.headers["Accept"] = "*/*"         request.headers["User-Agent"] = deviceInfo.clientInfo.userAgent-        // as of November 2024 it appears that using Mac clientInfo for auth causes-        // secondaryAuth to fail in some cases. using PC instead causes GSA to immediately-        // prompt for 2fa on o=complete, no secondaryAuth call needed.-        request.headers[DeviceInfo.clientInfoKey] = "<PC> <Windows;6.2(0,0);9200> <com.apple.AuthKitWin/1 (com.apple.iCloud/7.21)>"     }      func method(deviceInfo: DeviceInfo, anisetteData: AnisetteData) -> GrandSlamMethod {