Logs sideloading-related events with OSLog

This commit is contained in:
Riley Testut
2023-10-18 14:06:10 -05:00
committed by Magesh K
parent 6adf55b4b6
commit 93b6da4855
13 changed files with 161 additions and 22 deletions

View File

@@ -49,6 +49,8 @@ final class ResignAppOperation: ResultOperation<ALTApplication>
"self.context.certificate is nil")))
}
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)
@@ -56,8 +58,6 @@ final 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 }
@@ -71,6 +71,9 @@ final 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