App builds in xcodeproj (todo widget)

This commit is contained in:
Joe Mattiello
2023-03-02 00:40:11 -05:00
parent 4c9c5b1a56
commit f49fa24743
49 changed files with 498 additions and 295 deletions

View File

@@ -9,7 +9,7 @@
import Foundation
import Network
import RoxasUIKit
import os.log
import AltSign
import SideStoreCore
@@ -178,7 +178,11 @@ public final class AuthenticationOperation: ResultOperation<(ALTTeam, ALTCertifi
override func finish(_ result: Result<(ALTTeam, ALTCertificate, ALTAppleAPISession), Error>) {
guard !isFinished else { return }
print("Finished authenticating with result:", result.error?.localizedDescription ?? "success")
if let error = result.error {
os_log("Failed to finish authenticating wirth error: %@", type: .error, error.localizedDescription)
} else {
os_log("Successfully authenticating", type: .info)
}
let context = DatabaseManager.shared.persistentContainer.newBackgroundContext()
context.perform {

View File

@@ -8,6 +8,7 @@
import CoreData
import UIKit
import os.log
import SideStoreCore
import EmotionalDamage
@@ -85,7 +86,7 @@ public final class BackgroundRefreshAppsOperation: ResultOperation<[String: Resu
start_em_proxy(bind_addr: Consts.Proxy.serverURL)
managedObjectContext.perform {
print("Apps to refresh:", self.installedApps.map(\.bundleIdentifier))
os_log("Apps to refresh: %@", type: .error , self.installedApps.map(\.bundleIdentifier))
self.startListeningForRunningApps()
@@ -95,7 +96,7 @@ public final class BackgroundRefreshAppsOperation: ResultOperation<[String: Resu
DispatchQueue.main.asyncAfter(deadline: .now() + 2.0) {
self.managedObjectContext.perform {
let filteredApps = self.installedApps.filter { !self.runningApplications.contains($0.bundleIdentifier) }
print("Filtered Apps to Refresh:", filteredApps.map { $0.bundleIdentifier })
os_log("Filtered Apps to Refresh: %@", type: .info , filteredApps.map { $0.bundleIdentifier }.joined(separator: "\n"))
let group = AppManager.shared.refresh(filteredApps, presentingViewController: nil)
group.beginInstallationHandler = { installedApp in
@@ -179,7 +180,7 @@ private extension BackgroundRefreshAppsOperation {
} catch RefreshError.noInstalledApps {
shouldPresentAlert = false
} catch {
print("Failed to refresh apps in background.", error)
os_log("Failed to refresh apps in background. %@", type: .error , error.localizedDescription)
content.title = NSLocalizedString("Failed to Refresh Apps", comment: "")
content.body = error.localizedDescription
@@ -218,7 +219,7 @@ private extension BackgroundRefreshAppsOperation {
context.performAndWait {
_ = RefreshAttempt(identifier: self.refreshIdentifier, result: result, context: context)
do { try context.save() } catch { print("Failed to save refresh attempt.", error) }
do { try context.save() } catch { os_log("Failed to save refresh attempt. %@", type: .error , error.localizedDescription) }
}
}

View File

@@ -13,6 +13,7 @@ import AltSign
import SideKit
import SideStoreCore
import Shared
import os.log
private extension DownloadAppOperation {
struct DependencyError: ALTLocalizedError {
@@ -63,7 +64,7 @@ final class DownloadAppOperation: ResultOperation<ALTApplication> {
return
}
print("Downloading App:", bundleIdentifier)
os_log("Downloading App: %@", type: .info , bundleIdentifier)
guard let sourceURL = sourceURL else { return finish(.failure(OperationError.appNotFound)) }
@@ -104,7 +105,7 @@ final class DownloadAppOperation: ResultOperation<ALTApplication> {
do {
try FileManager.default.removeItem(at: temporaryDirectory)
} catch {
print("Failed to remove DownloadAppOperation temporary directory: \(temporaryDirectory).", error)
os_log("Failed to remove DownloadAppOperation temporary directory: %@. %@", type: .error , temporaryDirectory.absoluteString, error.localizedDescription)
}
super.finish(result)

View File

@@ -17,7 +17,7 @@ private extension URL {
}
public extension FetchTrustedSourcesOperation {
public struct TrustedSource: Decodable {
struct TrustedSource: Decodable {
public var identifier: String
public var sourceURL: URL?
}

View File

@@ -13,6 +13,7 @@ import SideStoreCore
import RoxasUIKit
import MiniMuxerSwift
import minimuxer
import os.log
@objc(InstallAppOperation)
final class InstallAppOperation: ResultOperation<InstalledApp> {
@@ -156,7 +157,7 @@ final class InstallAppOperation: ResultOperation<InstalledApp> {
do {
try FileManager.default.removeItem(at: fileURL)
} catch {
print("Failed to remove refreshed .ipa:", error)
os_log("Failed to remove refreshed .ipa: %@", type: .error , error.localizedDescription)
}
}
@@ -172,7 +173,7 @@ private extension InstallAppOperation {
do {
try FileManager.default.removeItem(at: context.temporaryDirectory)
} catch {
print("Failed to remove temporary directory.", error)
os_log("Failed to remove temporary directory. %@", type: .error , error.localizedDescription)
}
}
}

View File

@@ -12,6 +12,7 @@ import UIKit
import AltSign
import SideStoreCore
import RoxasUIKit
import os.log
@available(iOS 14.0, *)
extension PatchViewController {
@@ -75,7 +76,7 @@ public final class PatchViewController: UIViewController {
do {
try FileManager.default.createDirectory(at: temporaryDirectory, withIntermediateDirectories: true, attributes: nil)
} catch {
print("Failed to create temporary directory:", error)
os_log("Failed to create temporary directory: %@", type: .error , error.localizedDescription)
}
update()
@@ -178,7 +179,7 @@ private extension PatchViewController {
do {
try FileManager.default.removeItem(at: temporaryDirectory)
} catch {
print("Failed to remove temporary directory:", error)
os_log("Failed to remove temporary directory: %@", type: .error , error.localizedDescription)
}
if let observation = didEnterBackgroundObservation {
@@ -275,7 +276,7 @@ private extension PatchViewController {
self.resignedApp = ALTApplication(fileURL: resignedAppURL)
} catch {
print("Error unzipping app bundle:", error)
os_log("Error unzipping app bundle: %@", type: .error , error.localizedDescription)
unzippingError = error
}
}

View File

@@ -7,6 +7,7 @@
//
import Foundation
import os.log
@objc(RemoveAppBackupOperation)
final class RemoveAppBackupOperation: ResultOperation<Void> {
@@ -53,12 +54,12 @@ final class RemoveAppBackupOperation: ResultOperation<Void> {
#else
print("Failed to remove app backup directory:", error)
os_log("Failed to remove app backup directory: %@", type: .error , error.localizedDescription)
self.finish(.failure(error))
#endif
} catch {
print("Failed to remove app backup directory:", error)
os_log("Failed to remove app backup directory: %@", type: .error , error.localizedDescription)
self.finish(.failure(error))
}
}

View File

@@ -11,7 +11,7 @@ import RoxasUIKit
import AltSign
import SideStoreCore
import os.log
@objc(ResignAppOperation)
final class ResignAppOperation: ResultOperation<ALTApplication> {
@@ -47,7 +47,7 @@ final class ResignAppOperation: ResultOperation<ALTApplication> {
let prepareAppBundleProgress = prepareAppBundle(for: app, profiles: profiles) { result in
guard let appBundleURL = self.process(result) else { return }
print("Resigning App:", self.context.bundleIdentifier)
os_log("Resigning App: %@", type: .info , self.context.bundleIdentifier)
// Resign app bundle
let resignProgress = self.resignAppBundle(at: appBundleURL, team: team, certificate: certificate, profiles: Array(profiles.values)) { result in