Skip to content

armgit / xtool

Public Imported from GitHub
0

Cross-platform Xcode replacement. Build and deploy iOS apps with SwiftPM on Linux, Windows, macOS.

FIX 2FA LFG

Kabir Oberai402ea4e6ee8e
diff --git a/Supersign/Sources/Supersign/GrandSlam/Anisette/AnisetteData.swift b/Supersign/Sources/Supersign/GrandSlam/Anisette/AnisetteData.swift
index 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)",
diff --git a/Supersign/Sources/Supersign/GrandSlam/Anisette/DeviceInfo.swift b/Supersign/Sources/Supersign/GrandSlam/Anisette/DeviceInfo.swift
index 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"
diff --git a/Supersign/Sources/Supersign/GrandSlam/GrandSlamClient.swift b/Supersign/Sources/Supersign/GrandSlam/GrandSlamClient.swift
index 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:
diff --git a/Supersign/Sources/Supersign/GrandSlam/Requests/GrandSlamOperationRequest.swift b/Supersign/Sources/Supersign/GrandSlam/Requests/GrandSlamOperationRequest.swift
index 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 {