Modern Apps git

← xtool.git

More cleanup

Commit
0f1eac8a923a268f41a7f722844c05d1dee4e511
Author
Kabir Oberai <[email protected]>
When
2024-12-07 06:06 UTC (1 year ago)
Parents
cb68c06

Diff

Sources/Supersign/DeveloperServices/DeveloperServicesLoginManager.swift
diff --git a/Sources/Supersign/DeveloperServices/DeveloperServicesLoginManager.swift b/Sources/Supersign/DeveloperServices/DeveloperServicesLoginManager.swiftindex e9df8d7..68f3ac2 100644--- a/Sources/Supersign/DeveloperServices/DeveloperServicesLoginManager.swift+++ b/Sources/Supersign/DeveloperServices/DeveloperServicesLoginManager.swift@@ -68,6 +68,7 @@ public struct DeveloperServicesLoginManager: Sendable {             password: password,             twoFactorDelegate: twoFactorDelegate         ).authenticate()+        _ = twoFactorDelegate         return try await self.logIn(withLoginData: loginData)     } 
Sources/Supersign/module.modulemap
diff --git a/Sources/Supersign/module.modulemap b/Sources/Supersign/module.modulemapdeleted file mode 100644index 754e3cd..0000000--- a/Sources/Supersign/module.modulemap+++ /dev/null@@ -1,6 +0,0 @@-framework module Supersign {-  umbrella header "Supersign.h"--  export *-  module * { export * }-}
Sources/SupersignCLISupport/DSCommand.swift
diff --git a/Sources/SupersignCLISupport/DSCommand.swift b/Sources/SupersignCLISupport/DSCommand.swiftindex 4811d89..df3c281 100644--- a/Sources/SupersignCLISupport/DSCommand.swift+++ b/Sources/SupersignCLISupport/DSCommand.swift@@ -11,13 +11,21 @@ extension DeviceInfo {     } } -private extension AuthToken {-    static func retrieve(-        deviceInfo: DeviceInfo,-        username: String?,-        password: String?,-        resetProvisioning: Bool = false-    ) async throws -> Self {+struct DSLoginCommand: AsyncParsableCommand {+    static let configuration = CommandConfiguration(+        commandName: "login",+        abstract: "Obtain an Apple ID authentication token"+    )++    @Flag(name: [.short, .long]) var resetProvisioning = false+    @Option(name: [.short, .long], help: "Apple ID") var username: String?+    @Option(name: [.short, .long]) var password: String?+    @Flag(+        name: [.long],+        help: "Print the auth token to standard output instead of persisting it."+    ) var printToken = false++    func run() async throws {         guard let username = username ?? Console.prompt("Apple ID: "), !username.isEmpty else {             throw Console.Error("A non-empty Apple ID is required.")         }@@ -25,6 +33,8 @@ private extension AuthToken {             throw Console.Error("A non-empty password is required.")         } +        let deviceInfo = try DeviceInfo.fetch()+         let provider = try ADIDataProvider.adiProvider(             deviceInfo: deviceInfo,             storage: SupersignCLI.config.storage@@ -42,40 +52,8 @@ private extension AuthToken {             password: password,             twoFactorDelegate: authDelegate         )-        _ = authDelegate-        return AuthToken(appleID: username, dsToken: token)-    }+        let fullToken = AuthToken(appleID: username, dsToken: token) -    static func retrieve(deviceInfo: DeviceInfo, account: String?) async throws -> Self {-        if let account = account, let token = Self(string: account) {-            return token-        } else {-            return try await retrieve(deviceInfo: deviceInfo, username: account, password: nil)-        }-    }-}--struct DSLoginCommand: AsyncParsableCommand {-    static let configuration = CommandConfiguration(-        commandName: "login",-        abstract: "Obtain an Apple ID authentication token"-    )--    @Flag(name: [.short, .long]) var resetProvisioning = false-    @Option(name: [.short, .long], help: "Apple ID") var username: String?-    @Option(name: [.short, .long]) var password: String?-    @Flag(-        name: [.long],-        help: "Print the auth token to standard output instead of persisting it."-    ) var printToken = false--    func run() async throws {-        let fullToken = try await AuthToken.retrieve(-            deviceInfo: .fetch(),-            username: self.username,-            password: self.password,-            resetProvisioning: resetProvisioning-        )         if printToken {             guard let string = fullToken.string else {                 throw Console.Error("Could not encode token.")