Logs sideloading-related events with OSLog

This commit is contained in:
Riley Testut
2023-10-18 14:06:10 -05:00
parent 74dc2d4c71
commit 2133b6240d
19 changed files with 245 additions and 72 deletions

View File

@@ -43,6 +43,8 @@ class ResignAppOperation: ResultOperation<ALTApplication>
let certificate = self.context.certificate
else { return self.finish(.failure(OperationError.invalidParameters)) }
Logger.sideload.notice("Resigning app \(self.context.bundleIdentifier, privacy: .public)...")
// Prepare app bundle
let prepareAppProgress = Progress.discreteProgress(totalUnitCount: 2)
self.progress.addChild(prepareAppProgress, withPendingUnitCount: 3)
@@ -50,8 +52,6 @@ class ResignAppOperation: ResultOperation<ALTApplication>
let prepareAppBundleProgress = self.prepareAppBundle(for: app, profiles: profiles) { (result) in
guard let appBundleURL = self.process(result) else { return }
print("Resigning App:", self.context.bundleIdentifier)
// Resign app bundle
let resignProgress = self.resignAppBundle(at: appBundleURL, team: team, certificate: certificate, profiles: Array(profiles.values)) { (result) in
guard let resignedURL = self.process(result) else { return }
@@ -64,6 +64,9 @@ class ResignAppOperation: ResultOperation<ALTApplication>
// Use appBundleURL since we need an app bundle, not .ipa.
guard let resignedApplication = ALTApplication(fileURL: appBundleURL) else { throw OperationError.invalidApp }
Logger.sideload.notice("Resigned app \(self.context.bundleIdentifier, privacy: .public) to \(resignedApplication.bundleIdentifier, privacy: .public).")
self.finish(.success(resignedApplication))
}
catch