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.

Migrate ALL Pods to SPM

Kabir Oberaibcbf7402988e
diff --git a/Supersign/Sources/Supersign/HTTPClientProtocol/AsyncHTTPClient+HTTP.swift b/Supersign/Sources/Supersign/HTTPClientProtocol/AsyncHTTPClient+HTTP.swift
index a479757..97520c5 100644
--- a/Supersign/Sources/Supersign/HTTPClientProtocol/AsyncHTTPClient+HTTP.swift
+++ b/Supersign/Sources/Supersign/HTTPClientProtocol/AsyncHTTPClient+HTTP.swift
@@ -125,6 +125,7 @@ final class AsyncHTTPClientFactory: HTTPClientFactory {
private let client: HTTPClient
private init() {
// if ssl cert parsing fails we're screwed so we might as well force try
+ // swiftlint:disable:next force_try
let appleRootCA = try! NIOSSLCertificate(bytes: Array(Self.appleRootPEM.utf8), format: .pem)
var tlsConfiguration: TLSConfiguration = .makeClientConfiguration()
tlsConfiguration.additionalTrustRoots = [.certificates([appleRootCA])]
@@ -137,6 +138,7 @@ final class AsyncHTTPClientFactory: HTTPClientFactory {
static let shared = AsyncHTTPClientFactory()
func shutdown() {
+ // swiftlint:disable:next force_try
try! client.syncShutdown()
}
diff --git a/Supersign/Sources/Supersign/Signer/SignerImpl.swift b/Supersign/Sources/Supersign/Signer/SignerImpl.swift
index cef09fd..f13cdb9 100644
--- a/Supersign/Sources/Supersign/Signer/SignerImpl.swift
+++ b/Supersign/Sources/Supersign/Signer/SignerImpl.swift
@@ -113,9 +113,11 @@ public struct SignerImpl {
privBase, priv.count,
entsArray, entsArray.count,
{
+ // swiftlint:disable:previous opening_brace
(Unmanaged<AnyObject>
.fromOpaque($0)
.takeUnretainedValue()
+ // swiftlint:disable:next force_cast
as! (Double?) -> Void
)($1 == -1 ? nil : $1)
},
diff --git a/Supersign/Tests/SupersignTests/Tests/SupersignDeveloperServicesTests.swift b/Supersign/Tests/SupersignTests/Tests/SupersignDeveloperServicesTests.swift
index 8647a84..d943eb9 100644
--- a/Supersign/Tests/SupersignTests/Tests/SupersignDeveloperServicesTests.swift
+++ b/Supersign/Tests/SupersignTests/Tests/SupersignDeveloperServicesTests.swift
@@ -10,6 +10,8 @@ import XCTest
import SuperutilsTestSupport
import Supersign
+// swiftlint:disable force_try
+
class SupersignDeveloperServicesTests: XCTestCase {
var storage: KeyValueStorage!
diff --git a/Supersign/Tests/SupersignTests/Tests/SupersignGrandSlamTests.swift b/Supersign/Tests/SupersignTests/Tests/SupersignGrandSlamTests.swift
index 5a3a606..c98054f 100644
--- a/Supersign/Tests/SupersignTests/Tests/SupersignGrandSlamTests.swift
+++ b/Supersign/Tests/SupersignTests/Tests/SupersignGrandSlamTests.swift
@@ -6,6 +6,8 @@
// Copyright © 2020 Kabir Oberai. All rights reserved.
//
+// swiftlint:disable force_try
+
import XCTest
import SuperutilsTestSupport
@testable import Supersign
diff --git a/Supersign/Tests/SupersignTests/Tests/SupersignSigningTests.swift b/Supersign/Tests/SupersignTests/Tests/SupersignSigningTests.swift
index 6da3a70..e880c0e 100644
--- a/Supersign/Tests/SupersignTests/Tests/SupersignSigningTests.swift
+++ b/Supersign/Tests/SupersignTests/Tests/SupersignSigningTests.swift
@@ -83,8 +83,6 @@ class SupersignSigningTests: XCTestCase {
func testSign() throws {
let signingWaiter = ResultWaiter<()>(description: "Failed to sign app")
// TODO: Get cert, key, ents from fixtures
-// signerImpl.sign(app: app, certificate: <#T##Certificate#>, privateKey: <#T##PrivateKey#>, entitlementMapping: <#T##[URL : Entitlements]#>, progress: { _ in }, completion: signingWaiter.completion)
-// try signingWaiter.wait(timeout: 10000)
}
}
diff --git a/Supersign/Tests/SupersignTests/Utilities/MockSigner.swift b/Supersign/Tests/SupersignTests/Utilities/MockSigner.swift
index 988a3df..d4646c7 100644
--- a/Supersign/Tests/SupersignTests/Utilities/MockSigner.swift
+++ b/Supersign/Tests/SupersignTests/Utilities/MockSigner.swift
@@ -4,11 +4,13 @@ import SignerSupport
let addMockSigner: () = {
add_signer(
"MockSigner",
- { appDir, certData, certLen, privKeyData, privKeyLen, entitlements, numEntitlements, progress, exception in
+ { _, _, _, _, _, _, _, _, _, exception in
+ // swiftlint:disable:previous opening_brace
exception.initialize(to: strdup("Mock signer not implemented"))
return 1
},
- { path, outLen, exception in
+ { _, _, exception in
+ // swiftlint:disable:previous opening_brace
exception.initialize(to: strdup("Mock analyzer not implemented"))
return nil
}
diff --git a/SupersignCLISupport/Sources/SupersignCLISupport/Console.swift b/SupersignCLISupport/Sources/SupersignCLISupport/Console.swift
index 8044e8c..66ecb67 100644
--- a/SupersignCLISupport/Sources/SupersignCLISupport/Console.swift
+++ b/SupersignCLISupport/Sources/SupersignCLISupport/Console.swift
@@ -31,6 +31,8 @@ enum Console {
let dwNewMode = dwOldMode & ~ENABLE_ECHO_INPUT
SetConsoleMode(hConsole, dwNewMode)
defer { SetConsoleMode(hConsole, dwOldMode) }
+
+ return try action()
#else
var origAttr = termios()
tcgetattr(STDIN_FILENO, &origAttr)
@@ -39,9 +41,9 @@ enum Console {
newAttr.c_lflag = newAttr.c_lflag & ~tcflag_t(ECHO)
tcsetattr(STDIN_FILENO, TCSANOW, &newAttr)
defer { tcsetattr(STDIN_FILENO, TCSANOW, &origAttr) }
- #endif
return try action()
+ #endif
}
static func chooseNumber(in range: Range<Int>) -> Int {
diff --git a/SupersignCLISupport/Sources/SupersignCLISupport/DSCommand.swift b/SupersignCLISupport/Sources/SupersignCLISupport/DSCommand.swift
index b239e92..4a22a85 100644
--- a/SupersignCLISupport/Sources/SupersignCLISupport/DSCommand.swift
+++ b/SupersignCLISupport/Sources/SupersignCLISupport/DSCommand.swift
@@ -110,7 +110,7 @@ struct DSTeamsListCommand: ParsableCommand {
print(
teams.map {
"\($0.name) [\($0.status)]: \($0.id.rawValue)" +
- $0.memberships.map { "\n- \($0.name) (\($0.platform))" }.joined(separator: "")
+ $0.memberships.map { "\n- \($0.name) (\($0.platform))" }.joined()
}.joined(separator: "\n")
)
}
@@ -155,6 +155,7 @@ struct DSAnisetteCommand: ParsableCommand {
func run() throws {
let res = try withSyncContinuation {
+ // swiftlint:disable:next force_try
try! ADIDataProvider(
rawProvider: Provider(),
deviceInfo: .current()!,
diff --git a/SupersignCLISupport/Sources/SupersignCLISupport/SuperchargeCommand.swift b/SupersignCLISupport/Sources/SupersignCLISupport/SuperchargeCommand.swift
index 937c1ea..e06ee40 100644
--- a/SupersignCLISupport/Sources/SupersignCLISupport/SuperchargeCommand.swift
+++ b/SupersignCLISupport/Sources/SupersignCLISupport/SuperchargeCommand.swift
@@ -51,7 +51,7 @@ struct InstallSuperchargeCommand: ParsableCommand {
let client = Console.choose(
from: clients,
- onNoElement: { fatalError() },
+ onNoElement: { fatalError("No devices available") },
multiPrompt: "Choose device",
formatter: { "\($0.deviceName) (udid: \($0.udid))" }
)
diff --git a/SupersignCLISupport/Sources/SupersignCLISupport/SupersignCLIDelegate.swift b/SupersignCLISupport/Sources/SupersignCLISupport/SupersignCLIDelegate.swift
index e0f1737..66a09a2 100644
--- a/SupersignCLISupport/Sources/SupersignCLISupport/SupersignCLIDelegate.swift
+++ b/SupersignCLISupport/Sources/SupersignCLISupport/SupersignCLIDelegate.swift
@@ -36,7 +36,7 @@ final class SupersignCLIDelegate: IntegratedInstallerDelegate, TwoFactorAuthDele
let selected = Console.choose(
from: teams,
- onNoElement: { fatalError() },
+ onNoElement: { fatalError("No development teams available") },
multiPrompt: "\nSelect a team",
formatter: {
"\($0.name) (\($0.id.rawValue))"
diff --git a/SupersignCLISupport/Sources/SupersignCLISupport/UninstallCommand.swift b/SupersignCLISupport/Sources/SupersignCLISupport/UninstallCommand.swift
index 6ae9cf7..d428d11 100644
--- a/SupersignCLISupport/Sources/SupersignCLISupport/UninstallCommand.swift
+++ b/SupersignCLISupport/Sources/SupersignCLISupport/UninstallCommand.swift
@@ -19,12 +19,16 @@ struct UninstallCommand: ParsableCommand {
let installProxy = try InstallationProxyClient(device: connection.device, label: "supersign-inst")
let sem = DispatchSemaphore(value: 0)
var error: Error?
- installProxy.uninstall(bundleID: bundleID, progress: { _ in }) { result in
- if case let .failure(err) = result {
- error = err
+ installProxy.uninstall(
+ bundleID: bundleID,
+ progress: { _ in },
+ completion: { result in
+ if case let .failure(err) = result {
+ error = err
+ }
+ sem.signal()
}
- sem.signal()
- }
+ )
sem.wait()
if let error = error {
print("Failed: \(error)")