mirror of
https://github.com/SideStore/SideStore.git
synced 2026-05-12 12:25:38 +02:00
App builds in xcodeproj (todo widget)
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import ArgumentParser
|
||||
import SwiftLintFramework
|
||||
import os.log
|
||||
|
||||
extension Cargo {
|
||||
struct Version: ParsableCommand {
|
||||
@@ -12,8 +13,8 @@ extension Cargo {
|
||||
|
||||
func run() throws {
|
||||
if verbose, let buildID = ExecutableInfo.buildID {
|
||||
print("Version:", Self.value)
|
||||
print("Build ID:", buildID)
|
||||
os_log("Version: %@", type: .info , Self.value)
|
||||
os_log("Build ID: %@", type: .info , buildID)
|
||||
} else {
|
||||
print(Self.value)
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import ArgumentParser
|
||||
import SwiftLintFramework
|
||||
import os.log
|
||||
|
||||
extension SwiftLint {
|
||||
struct Version: ParsableCommand {
|
||||
@@ -12,8 +13,8 @@ extension SwiftLint {
|
||||
|
||||
func run() throws {
|
||||
if verbose, let buildID = ExecutableInfo.buildID {
|
||||
print("Version:", Self.value)
|
||||
print("Build ID:", buildID)
|
||||
os_log("Version: %@", type: .info , Self.value)
|
||||
os_log("Build ID: %@", type: .info , buildID)
|
||||
} else {
|
||||
print(Self.value)
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
import Foundation
|
||||
import Network
|
||||
import SideKit
|
||||
import os.log
|
||||
|
||||
public protocol SideConnection: Connection {
|
||||
func __send(_ data: Data, completionHandler: @escaping (Bool, Error?) -> Void)
|
||||
@@ -74,7 +75,7 @@ public extension SideConnection {
|
||||
func receiveRequest(completionHandler: @escaping (Result<ServerRequest, ALTServerError>) -> Void) {
|
||||
let size = MemoryLayout<Int32>.size
|
||||
|
||||
print("Receiving request size from connection:", self)
|
||||
os_log("Receiving request size from connection: %@", type: .info , String(describing: self))
|
||||
receiveData(expectedSize: size) { result in
|
||||
do {
|
||||
let data = try result.get()
|
||||
@@ -87,7 +88,7 @@ public extension SideConnection {
|
||||
let data = try result.get()
|
||||
let request = try JSONDecoder().decode(ServerRequest.self, from: data)
|
||||
|
||||
print("Received request:", request)
|
||||
os_log("Received request: %@", type: .info , String(describing: request))
|
||||
completionHandler(.success(request))
|
||||
} catch {
|
||||
completionHandler(.failure(ALTServerError(error)))
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
import Foundation
|
||||
import Network
|
||||
import SideKit
|
||||
import os.log
|
||||
|
||||
public protocol RequestHandler {
|
||||
func handleAnisetteDataRequest(_ request: AnisetteDataRequest, for connection: Connection, completionHandler: @escaping (Result<AnisetteDataResponse, Error>) -> Void)
|
||||
@@ -102,18 +103,18 @@ private extension ConnectionManager {
|
||||
do {
|
||||
let response = try result.get()
|
||||
connection.send(response, shouldDisconnect: true) { result in
|
||||
print("Sent response \(response) with result:", result)
|
||||
os_log("Sent response %@ with result: %@", type: .error , response.identifier, String(describing: result))
|
||||
}
|
||||
} catch {
|
||||
let response = ErrorResponse(error: ALTServerError(error))
|
||||
connection.send(response, shouldDisconnect: true) { result in
|
||||
print("Sent error response \(response) with result:", result)
|
||||
os_log("Sent error response %@ with result: %@", type: .error , response.error.localizedDescription, String(describing: result))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
connection.receiveRequest { result in
|
||||
print("Received request with result:", result)
|
||||
os_log("Received request with result: %@", type: .info, String(describing: result))
|
||||
|
||||
switch result {
|
||||
case let .failure(error): finish(Result<ErrorResponse, Error>.failure(error))
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
|
||||
import Foundation
|
||||
import SideKit
|
||||
import os.log
|
||||
|
||||
@objc private protocol XPCConnectionProxy {
|
||||
func ping(completionHandler: @escaping () -> Void)
|
||||
@@ -56,7 +57,7 @@ public class XPCConnection: NSObject, SideConnection {
|
||||
private extension XPCConnection {
|
||||
func makeProxy(errorHandler: @escaping (Error) -> Void) -> XPCConnectionProxy {
|
||||
let proxy = xpcConnection.remoteObjectProxyWithErrorHandler { error in
|
||||
print("Error messaging remote object proxy:", error)
|
||||
os_log("Error messaging remote object proxy: %@", type: .error , error.localizedDescription)
|
||||
self.error = error
|
||||
errorHandler(error)
|
||||
} as! XPCConnectionProxy
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
//
|
||||
|
||||
import UIKit
|
||||
import os.log
|
||||
|
||||
extension AppDelegate {
|
||||
static let startBackupNotification = Notification.Name("io.altstore.StartBackup")
|
||||
@@ -104,7 +105,7 @@ private extension AppDelegate {
|
||||
|
||||
DispatchQueue.main.async {
|
||||
UIApplication.shared.open(responseURL, options: [:]) { success in
|
||||
print("Sent response to app with success:", success)
|
||||
os_log("Sent response to app with success: %@", type: .info , success)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,6 +7,8 @@
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import AltSign
|
||||
import os.log
|
||||
|
||||
extension ErrorUserInfoKey {
|
||||
static let sourceFile: String = "alt_sourceFile"
|
||||
@@ -144,11 +146,11 @@ class BackupController: NSObject {
|
||||
// Replace previous backup with new backup.
|
||||
_ = try FileManager.default.replaceItemAt(appBackupDirectory, withItemAt: temporaryAppBackupDirectory)
|
||||
|
||||
print("Replaced previous backup with new backup:", temporaryAppBackupDirectory)
|
||||
os_log("Replaced previous backup with new backup: %@", type: .info , temporaryAppBackupDirectory)
|
||||
|
||||
completionHandler(.success(()))
|
||||
} catch {
|
||||
do { try FileManager.default.removeItem(at: temporaryAppBackupDirectory) } catch { print("Failed to remove temporary directory.", error) }
|
||||
do { try FileManager.default.removeItem(at: temporaryAppBackupDirectory) } catch { os_log("Failed to remove temporary directory. %@", type: .error , error.localizedDescription) }
|
||||
|
||||
completionHandler(.failure(error))
|
||||
}
|
||||
@@ -239,7 +241,7 @@ private extension BackupController {
|
||||
print("Copied item from \(fileURL) to \(destinationURL)")
|
||||
} catch let error where fileURL.lastPathComponent == "Inbox" && fileURL.deletingLastPathComponent().lastPathComponent == "Documents" {
|
||||
// Ignore errors for /Documents/Inbox
|
||||
print("Failed to copy Inbox directory:", error)
|
||||
os_log("Failed to copy Inbox directory: %@", type: .error , error.localizedDescription)
|
||||
} catch {
|
||||
print(error)
|
||||
throw error
|
||||
|
||||
@@ -27,7 +27,7 @@ struct AnisetteDataManager {
|
||||
}
|
||||
|
||||
func requestAnisetteData() throws -> ALTAnisetteData {
|
||||
var request = URLRequest(url: URL(string: "https://developerservices2.apple.com/services/QH65B2/listTeams.action?clientId=XABBG36SBA")!)
|
||||
var request = URLRequest(url: URL(string: "https://developerservices2.apple.com/services/QH65B2/listTeams.action?clientId=XABBG36SBA")!)
|
||||
request.httpMethod = "POST"
|
||||
|
||||
let akAppleIDSession = unsafeBitCast(NSClassFromString("AKAppleIDSession")!, to: AKAppleIDSession.Type.self)
|
||||
|
||||
@@ -71,7 +71,7 @@ struct AppManager {
|
||||
if installingBundleIDs.contains(profile.bundleIdentifier) || (activeProfiles?.contains(profile.bundleIdentifier) == false && profile.isFreeProvisioningProfile) {
|
||||
try FileManager.default.removeItem(at: fileURL)
|
||||
} else {
|
||||
print("Ignoring:", profile.bundleIdentifier, profile.uuid)
|
||||
os_log("Ignoring: %@ %@", type: .info , profile.bundleIdentifier, profile.uuid)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
import Foundation
|
||||
import Shared
|
||||
import SideKit
|
||||
import os.log
|
||||
|
||||
typealias DaemonConnectionManager = ConnectionManager<DaemonRequestHandler>
|
||||
|
||||
@@ -39,7 +40,7 @@ struct DaemonRequestHandler: RequestHandler {
|
||||
print("Awaiting begin installation request...")
|
||||
|
||||
connection.receiveRequest { result in
|
||||
print("Received begin installation request with result:", result)
|
||||
os_log("Received begin installation request with result: %@", type: .info , String(describing: result))
|
||||
|
||||
do {
|
||||
guard case let .beginInstallation(request) = try result.get() else { throw ALTServerError(.unknownRequest) }
|
||||
@@ -47,7 +48,7 @@ struct DaemonRequestHandler: RequestHandler {
|
||||
|
||||
AppManager.shared.installApp(at: fileURL, bundleIdentifier: bundleIdentifier, activeProfiles: request.activeProfiles) { result in
|
||||
let result = result.map { InstallationProgressResponse(progress: 1.0) }
|
||||
print("Installed app with result:", result)
|
||||
os_log("Installed app with result: %@", type: .info, String(describing: result))
|
||||
|
||||
completionHandler(result)
|
||||
}
|
||||
@@ -62,11 +63,11 @@ struct DaemonRequestHandler: RequestHandler {
|
||||
AppManager.shared.install(request.provisioningProfiles, activeProfiles: request.activeProfiles) { result in
|
||||
switch result {
|
||||
case let .failure(error):
|
||||
print("Failed to install profiles \(request.provisioningProfiles.map { $0.bundleIdentifier }):", error)
|
||||
os_log("Failed to install profiles %@ : %@", type: .error , request.provisioningProfiles.map { $0.bundleIdentifier }.joined(separator: "\n"), error.localizedDescription)
|
||||
completionHandler(.failure(error))
|
||||
|
||||
case .success:
|
||||
print("Installed profiles:", request.provisioningProfiles.map { $0.bundleIdentifier })
|
||||
os_log("Installed profiles: %@", type: .info , request.provisioningProfiles.map { $0.bundleIdentifier }.joined(separator: "\n"))
|
||||
|
||||
let response = InstallProvisioningProfilesResponse()
|
||||
completionHandler(.success(response))
|
||||
@@ -79,11 +80,11 @@ struct DaemonRequestHandler: RequestHandler {
|
||||
AppManager.shared.removeProvisioningProfiles(forBundleIdentifiers: request.bundleIdentifiers) { result in
|
||||
switch result {
|
||||
case let .failure(error):
|
||||
print("Failed to remove profiles \(request.bundleIdentifiers):", error)
|
||||
os_log("Failed to remove profiles %@ : %@", type: .error, request.bundleIdentifiers, error.localizedDescription)
|
||||
completionHandler(.failure(error))
|
||||
|
||||
case .success:
|
||||
print("Removed profiles:", request.bundleIdentifiers)
|
||||
os_log("Removed profiles: %@", type: .info , request.bundleIdentifiers)
|
||||
|
||||
let response = RemoveProvisioningProfilesResponse()
|
||||
completionHandler(.success(response))
|
||||
@@ -95,11 +96,11 @@ struct DaemonRequestHandler: RequestHandler {
|
||||
AppManager.shared.removeApp(forBundleIdentifier: request.bundleIdentifier) { result in
|
||||
switch result {
|
||||
case let .failure(error):
|
||||
print("Failed to remove app \(request.bundleIdentifier):", error)
|
||||
os_log("Failed to remove app %@ : %@", type: .error , request.bundleIdentifier, error.localizedDescription)
|
||||
completionHandler(.failure(error))
|
||||
|
||||
case .success:
|
||||
print("Removed app:", request.bundleIdentifier)
|
||||
os_log("Removed app: %@", type: .info , request.bundleIdentifier)
|
||||
|
||||
let response = RemoveAppResponse()
|
||||
completionHandler(.success(response))
|
||||
|
||||
@@ -16,6 +16,7 @@ import SideStoreCore
|
||||
import SideStoreAppKit
|
||||
import EmotionalDamage
|
||||
import RoxasUIKit
|
||||
import os.log
|
||||
|
||||
@UIApplicationMain
|
||||
final class AppDelegate: SideStoreAppDelegate {
|
||||
@@ -49,9 +50,9 @@ final class AppDelegate: SideStoreAppDelegate {
|
||||
|
||||
DatabaseManager.shared.start { error in
|
||||
if let error = error {
|
||||
print("Failed to start DatabaseManager. Error:", error as Any)
|
||||
os_log("Failed to start DatabaseManager. Error: %@", type: .error , error.localizedDescription)
|
||||
} else {
|
||||
print("Started DatabaseManager.")
|
||||
os_log("Started DatabaseManager.", type: .info)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -86,7 +87,7 @@ final class AppDelegate: SideStoreAppDelegate {
|
||||
DatabaseManager.shared.purgeLoggedErrors(before: midnightOneMonthAgo) { result in
|
||||
switch result {
|
||||
case .success: break
|
||||
case let .failure(error): print("[ALTLog] Failed to purge logged errors before \(midnightOneMonthAgo).", error)
|
||||
case let .failure(error): os_log("[ALTLog] Failed to purge logged errors before %@. %@", type: .error , midnightOneMonthAgo.debugDescription, error.localizedDescription)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -221,7 +222,7 @@ extension AppDelegate {
|
||||
}
|
||||
|
||||
let token = tokenParts.joined()
|
||||
print("Push Token:", token)
|
||||
os_log("Push Token: %@", type: .debug , token)
|
||||
}
|
||||
|
||||
func application(_ application: UIApplication, didReceiveRemoteNotification _: [AnyHashable: Any], fetchCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void) {
|
||||
@@ -245,7 +246,7 @@ extension AppDelegate {
|
||||
|
||||
BackgroundTaskManager.shared.performExtendedBackgroundTask { taskResult, taskCompletionHandler in
|
||||
if let error = taskResult.error {
|
||||
print("Error starting extended background task. Aborting.", error)
|
||||
os_log("Error starting extended background task. Aborting. %@", type: .error, error.localizedDescription)
|
||||
backgroundFetchCompletionHandler(.failed)
|
||||
taskCompletionHandler()
|
||||
return
|
||||
@@ -361,7 +362,7 @@ private extension AppDelegate {
|
||||
|
||||
completionHandler(.success(sources))
|
||||
} catch {
|
||||
print("Error fetching apps:", error)
|
||||
os_log("Error fetching apps: %@", type: .error, error.localizedDescription)
|
||||
completionHandler(.failure(error))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@ import SideStoreCore
|
||||
import EmotionalDamage
|
||||
import SideStoreAppKit
|
||||
import UIKit
|
||||
import os.log
|
||||
|
||||
@available(iOS 13, *)
|
||||
final class SceneDelegate: UIResponder, UIWindowSceneDelegate {
|
||||
@@ -57,7 +58,7 @@ final class SceneDelegate: UIResponder, UIWindowSceneDelegate {
|
||||
DatabaseManager.shared.purgeLoggedErrors(before: midnightOneMonthAgo) { result in
|
||||
switch result {
|
||||
case .success: break
|
||||
case let .failure(error): print("[ALTLog] Failed to purge logged errors before \(midnightOneMonthAgo).", error)
|
||||
case let .failure(error): os_log("[ALTLog] Failed to purge logged errors before %@. %@", type: .error, midnightOneMonthAgo.debugDescription, error.localizedDescription)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@ import UIKit
|
||||
|
||||
import SideStoreCore
|
||||
import RoxasUIKit
|
||||
import os.log
|
||||
|
||||
import Nuke
|
||||
|
||||
@@ -156,7 +157,7 @@ private extension AppContentViewController {
|
||||
cell.imageView.image = image
|
||||
|
||||
if let error = error {
|
||||
print("Error loading image:", error)
|
||||
os_log("Error loading image: %@", type: .error, error.localizedDescription)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
import Foundation
|
||||
import SideStoreCore
|
||||
import Intents
|
||||
import os.log
|
||||
|
||||
@available(iOS 14, *)
|
||||
public final class IntentHandler: NSObject, RefreshAllIntentHandling {
|
||||
@@ -107,7 +108,7 @@ private extension IntentHandler {
|
||||
} catch RefreshError.noInstalledApps {
|
||||
self.finish(intent, response: RefreshAllIntentResponse(code: .success, userActivity: nil))
|
||||
} catch let error as NSError {
|
||||
print("Failed to refresh apps in background.", error)
|
||||
os_log("Failed to refresh apps in background. %@", type: .error , error.localizedDescription)
|
||||
self.finish(intent, response: RefreshAllIntentResponse.failure(localizedDescription: error.localizedFailureReason ?? error.localizedDescription))
|
||||
}
|
||||
|
||||
|
||||
@@ -9,14 +9,17 @@
|
||||
import Intents
|
||||
import Shared
|
||||
import SideStoreCore
|
||||
import os.log
|
||||
|
||||
@available(iOS 14, *)
|
||||
public class ViewAppIntentHandler: NSObject, ViewAppIntentHandling {
|
||||
public func provideAppOptionsCollection(for _: ViewAppIntent, with completion: @escaping (INObjectCollection<App>?, Error?) -> Void) {
|
||||
public func provideAppOptionsCollection(for intent: ViewAppIntent, with completion: @escaping (INObjectCollection<App>?, Error?) -> Void) {
|
||||
DatabaseManager.shared.start { error in
|
||||
if let error = error {
|
||||
print("Error starting extension:", error)
|
||||
}
|
||||
os_log("Error starting extension: %@", type: .error , error.localizedDescription)
|
||||
} else {
|
||||
os_log("Started extension: %@", type: .info , intent.debugDescription)
|
||||
}
|
||||
|
||||
DatabaseManager.shared.persistentContainer.performBackgroundTask { context in
|
||||
let apps = InstalledApp.all(in: context).map { installedApp in
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
import UIKit
|
||||
|
||||
import RoxasUIKit
|
||||
import os.log
|
||||
|
||||
import Nuke
|
||||
|
||||
@@ -68,7 +69,7 @@ private extension BrowseCollectionViewCell {
|
||||
cell.imageView.image = image
|
||||
|
||||
if let error = error {
|
||||
print("Error loading image:", error)
|
||||
os_log("Error loading image: %@", type: .error , error.localizedDescription)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@ import UIKit
|
||||
|
||||
import SideStoreCore
|
||||
import RoxasUIKit
|
||||
import os.log
|
||||
|
||||
import Nuke
|
||||
|
||||
@@ -140,7 +141,7 @@ private extension BrowseViewController {
|
||||
cell.bannerView.iconImageView.image = image
|
||||
|
||||
if let error = error {
|
||||
print("Error loading image:", error)
|
||||
os_log("Error loading image: %@", type: .error , error.localizedDescription)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -240,7 +241,7 @@ private extension BrowseViewController {
|
||||
let toastView = ToastView(error: error)
|
||||
toastView.show(in: self)
|
||||
|
||||
case .success: print("Installed app:", app.bundleIdentifier)
|
||||
case .success: os_log("Installed app: %@", type: .info , app.bundleIdentifier)
|
||||
}
|
||||
|
||||
self.collectionView.reloadItems(at: [indexPath])
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
//
|
||||
|
||||
import Foundation
|
||||
import os.log
|
||||
|
||||
extension FileManager {
|
||||
func directorySize(at directoryURL: URL) -> Int? {
|
||||
@@ -21,7 +22,7 @@ extension FileManager {
|
||||
|
||||
total += fileSize
|
||||
} catch {
|
||||
print("Failed to read file size for item: \(fileURL).", error)
|
||||
os_log("Failed to read file size for item: %@. %@", type: .error, fileURL.absoluteString, error.localizedDescription)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -19,6 +19,7 @@ import AltSign
|
||||
import SideKit
|
||||
import SideStoreCore
|
||||
import RoxasUIKit
|
||||
import os.log
|
||||
|
||||
public extension AppManager {
|
||||
static let didFetchSourceNotification = Notification.Name("io.altstore.AppManager.didFetchSource")
|
||||
@@ -166,7 +167,7 @@ public extension AppManager {
|
||||
|
||||
try context.save()
|
||||
} catch {
|
||||
print("Error while fetching installed apps.", error)
|
||||
os_log("Error while fetching installed apps. %@", type: .error , error.localizedDescription)
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -182,15 +183,15 @@ public extension AppManager {
|
||||
guard let isDirectory = resourceValues.isDirectory, let bundleID = resourceValues.name else { continue }
|
||||
|
||||
if isDirectory && !installedAppBundleIDs.contains(bundleID) && !self.isActivelyManagingApp(withBundleID: bundleID) {
|
||||
print("DELETING CACHED APP:", bundleID)
|
||||
os_log("DELETING CACHED APP: %@", type: .info , bundleID)
|
||||
try FileManager.default.removeItem(at: appDirectory)
|
||||
}
|
||||
} catch {
|
||||
print("Failed to remove cached app directory.", error)
|
||||
os_log("Failed to remove cached app directory. %@", type: .error , error.localizedDescription)
|
||||
}
|
||||
}
|
||||
} catch {
|
||||
print("Failed to remove cached apps.", error)
|
||||
os_log("Failed to remove cached apps. %@", type: .error , error.localizedDescription)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -350,7 +351,7 @@ public extension AppManager {
|
||||
{
|
||||
let authenticationOperation = self.authenticate(presentingViewController: nil) { (result) in
|
||||
// result contains name, email, auth token, OTP and other possibly personal/account specific info. we don't want this logged
|
||||
//print("Authenticated for fetching App IDs with result:", result)
|
||||
//os_log("Authenticated for fetching App IDs with result: %@", type: .info , result)
|
||||
}
|
||||
|
||||
let fetchAppIDsOperation = FetchAppIDsOperation(context: authenticationOperation.context)
|
||||
@@ -382,7 +383,7 @@ public extension AppManager {
|
||||
try result.get()
|
||||
self.updatePatronsResult = .success(())
|
||||
} catch {
|
||||
print("Error updating Friend Zone Patrons:", error)
|
||||
os_log("Error updating Friend Zone Patrons: %@", type: .error , error.localizedDescription)
|
||||
self.updatePatronsResult = .failure(error)
|
||||
}
|
||||
|
||||
@@ -564,7 +565,7 @@ public extension AppManager {
|
||||
removeAppBackupOperation.resultHandler = { result in
|
||||
switch result {
|
||||
case .success: break
|
||||
case let .failure(error): print("Failed to remove app backup.", error)
|
||||
case let .failure(error): os_log("Failed to remove app backup. %@", type: .error , error.localizedDescription)
|
||||
}
|
||||
|
||||
// Throw the error from removeAppOperation,
|
||||
@@ -664,7 +665,7 @@ public extension AppManager {
|
||||
|
||||
public extension AppManager {
|
||||
@discardableResult
|
||||
public func backgroundRefresh(_ installedApps: [InstalledApp], presentsNotifications: Bool = false, completionHandler: @escaping (Result<[String: Result<InstalledApp, Error>], Error>) -> Void) -> BackgroundRefreshAppsOperation {
|
||||
func backgroundRefresh(_ installedApps: [InstalledApp], presentsNotifications: Bool = false, completionHandler: @escaping (Result<[String: Result<InstalledApp, Error>], Error>) -> Void) -> BackgroundRefreshAppsOperation {
|
||||
let backgroundRefreshAppsOperation = BackgroundRefreshAppsOperation(installedApps: installedApps)
|
||||
backgroundRefreshAppsOperation.resultHandler = completionHandler
|
||||
backgroundRefreshAppsOperation.presentsFinishedNotification = presentsNotifications
|
||||
@@ -1185,7 +1186,7 @@ private extension AppManager {
|
||||
switch result {
|
||||
case let .failure(error):
|
||||
// Don't report error, since it doesn't really matter.
|
||||
print("Failed to delete app backup.", error)
|
||||
os_log("Failed to delete app backup. %@", type: .error , error.localizedDescription)
|
||||
|
||||
case .success: break
|
||||
}
|
||||
@@ -1383,7 +1384,7 @@ private extension AppManager {
|
||||
let bundleIcons = ["CFBundlePrimaryIcon": ["CFBundleIconFiles": [iconFileURL.lastPathComponent]]]
|
||||
infoDictionary["CFBundleIcons"] = bundleIcons
|
||||
} catch {
|
||||
print("Failed to write app icon data.", error)
|
||||
os_log("Failed to write app icon data. %@", type: .error , error.localizedErrorCode)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1473,7 +1474,7 @@ private extension AppManager {
|
||||
WidgetCenter.shared.reloadAllTimelines()
|
||||
}
|
||||
|
||||
do { try installedApp.managedObjectContext?.save() } catch { print("Error saving installed app.", error) }
|
||||
do { try installedApp.managedObjectContext?.save() } catch { os_log("Error saving installed app. %@", type: .error, error.localizedDescription) }
|
||||
} catch {
|
||||
group.set(.failure(error), forAppWithBundleIdentifier: operation.bundleIdentifier)
|
||||
|
||||
@@ -1527,7 +1528,11 @@ private extension AppManager {
|
||||
_ = LoggedError(error: sanitizedError, app: app, operation: loggedErrorOperation, context: context)
|
||||
try context.save()
|
||||
} catch let saveError {
|
||||
print("[ALTLog] Failed to log error \(sanitizedError.domain) code \(sanitizedError.code) for \(app.bundleIdentifier):", saveError)
|
||||
os_log("[ALTLog] Failed to log error %@ code %@ for %@: %@", type: .error,
|
||||
sanitizedError.domain,
|
||||
sanitizedError.code,
|
||||
app.bundleIdentifier,
|
||||
saveError.localizedErrorCode)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@ import UIKit
|
||||
import AltSign
|
||||
import SideStoreCore
|
||||
import RoxasUIKit
|
||||
import os.log
|
||||
|
||||
import Nuke
|
||||
|
||||
@@ -242,7 +243,7 @@ private extension MyAppsViewController {
|
||||
cell.bannerView.iconImageView.image = image
|
||||
|
||||
if let error = error {
|
||||
print("Error loading image:", error)
|
||||
os_log("Error loading image: %@", type: .error , error.localizedDescription)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -442,7 +443,7 @@ private extension MyAppsViewController {
|
||||
let (_, context) = try result.get()
|
||||
try context.save()
|
||||
} catch {
|
||||
print("Failed to fetch App IDs.", error)
|
||||
os_log("Failed to fetch App IDs. %@", type: .error , error.localizedDescription)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -575,7 +576,7 @@ private extension MyAppsViewController {
|
||||
let interaction = INInteraction.refreshAllApps()
|
||||
interaction.donate { error in
|
||||
guard let error = error else { return }
|
||||
print("Failed to donate intent \(interaction.intent).", error)
|
||||
os_log("Failed to donate intent %@ . %@", type: .error , interaction.intent, error.localizedDescription)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -605,7 +606,7 @@ private extension MyAppsViewController {
|
||||
self.collectionView.reloadItems(at: [indexPath])
|
||||
|
||||
case .success:
|
||||
print("Updated app:", installedApp.bundleIdentifier)
|
||||
os_log("Updated app: %@", type: .info , installedApp.bundleIdentifier)
|
||||
// No need to reload, since the the update cell is gone now.
|
||||
}
|
||||
|
||||
@@ -774,7 +775,7 @@ private extension MyAppsViewController {
|
||||
completion(.success(()))
|
||||
|
||||
app.managedObjectContext?.perform {
|
||||
print("Successfully installed app:", app.bundleIdentifier)
|
||||
os_log("Successfully installed app: %@", type: .info , app.bundleIdentifier)
|
||||
}
|
||||
|
||||
case .failure(OperationError.cancelled):
|
||||
@@ -900,7 +901,15 @@ private extension MyAppsViewController {
|
||||
}
|
||||
}
|
||||
|
||||
print("Finished refreshing with results:", results.map { ($0, $1.error?.localizedDescription ?? "success") })
|
||||
|
||||
let errors = results.filter({ $1.error != nil }).map{ ($0, $1.error?.localizedDescription ?? "no description") }
|
||||
let successes = results.filter({ $1.error == nil }).map{ ($0, "success") }
|
||||
if !errors.isEmpty {
|
||||
os_log("Finished refreshing Errors: %@", type: .error, errors.map { "\($0.0) - \($0.1)" }.joined(separator: "\n"))
|
||||
}
|
||||
if !successes.isEmpty {
|
||||
os_log("Finished refreshing success: %@", type: .info, successes.map { "\($0.0) - \($0.1)" }.joined(separator: "\n"))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -914,7 +923,7 @@ private extension MyAppsViewController {
|
||||
} catch OperationError.cancelled {
|
||||
// Ignore
|
||||
} catch {
|
||||
print("Failed to activate app:", error)
|
||||
os_log("Failed to activate app: %@", type: .error , error.localizedDescription)
|
||||
|
||||
DispatchQueue.main.async {
|
||||
installedApp.isActive = false
|
||||
@@ -977,9 +986,9 @@ private extension MyAppsViewController {
|
||||
let app = try result.get()
|
||||
try? app.managedObjectContext?.save()
|
||||
|
||||
print("Finished deactivating app:", app.bundleIdentifier)
|
||||
os_log("Finished deactivating app: %@", type: .info , app.bundleIdentifier)
|
||||
} catch {
|
||||
print("Failed to activate app:", error)
|
||||
os_log("Failed to activate app: %@", type: .error , error.localizedDescription)
|
||||
|
||||
DispatchQueue.main.async {
|
||||
installedApp.isActive = true
|
||||
@@ -1035,9 +1044,9 @@ private extension MyAppsViewController {
|
||||
let app = try result.get()
|
||||
try? app.managedObjectContext?.save()
|
||||
|
||||
print("Finished backing up app:", app.bundleIdentifier)
|
||||
os_log("Finished backing up app: %@", type: .info , app.bundleIdentifier)
|
||||
} catch {
|
||||
print("Failed to back up app:", error)
|
||||
os_log("Failed to back up app: %@", type: .error , error.localizedDescription)
|
||||
|
||||
DispatchQueue.main.async {
|
||||
let toastView = ToastView(error: error)
|
||||
@@ -1066,9 +1075,9 @@ private extension MyAppsViewController {
|
||||
let app = try result.get()
|
||||
try? app.managedObjectContext?.save()
|
||||
|
||||
print("Finished restoring app:", app.bundleIdentifier)
|
||||
os_log("Finished restoring app: %@", type: .info , app.bundleIdentifier)
|
||||
} catch {
|
||||
print("Failed to restore app:", error)
|
||||
os_log("Failed to restore app: %@", type: .error , error.localizedDescription)
|
||||
|
||||
DispatchQueue.main.async {
|
||||
let toastView = ToastView(error: error)
|
||||
@@ -1131,7 +1140,7 @@ private extension MyAppsViewController {
|
||||
}
|
||||
}
|
||||
} catch {
|
||||
print("Failed to change app icon.", error)
|
||||
os_log("Failed to change app icon. %@", type: .error , error.localizedDescription)
|
||||
|
||||
DispatchQueue.main.async {
|
||||
let toastView = ToastView(error: error)
|
||||
@@ -1160,7 +1169,7 @@ private extension MyAppsViewController {
|
||||
@objc func didFetchSource(_: Notification) {
|
||||
DispatchQueue.main.async {
|
||||
if self.updatesDataSource.fetchedResultsController.fetchedObjects == nil {
|
||||
do { try self.updatesDataSource.fetchedResultsController.performFetch() } catch { print("Error fetching:", error) }
|
||||
do { try self.updatesDataSource.fetchedResultsController.performFetch() } catch { os_log("Error fetching: %@", type: .error , error.localizedDescription) }
|
||||
}
|
||||
|
||||
self.update()
|
||||
@@ -1179,7 +1188,7 @@ private extension MyAppsViewController {
|
||||
do {
|
||||
try FileManager.default.removeItem(at: url)
|
||||
} catch {
|
||||
print("Unable to remove imported .ipa.", error)
|
||||
os_log("Unable to remove imported .ipa. %@", type: .error , error.localizedDescription)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1415,7 +1424,7 @@ extension MyAppsViewController {
|
||||
actions.append(restoreBackupAction)
|
||||
}
|
||||
} else if let error = outError {
|
||||
print("Unable to check if backup exists:", error)
|
||||
os_log("Unable to check if backup exists: %@", type: .error , error.localizedDescription)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1784,7 +1793,7 @@ extension MyAppsViewController: UIDocumentPickerDelegate {
|
||||
switch controller.documentPickerMode {
|
||||
case .import, .open:
|
||||
sideloadApp(at: fileURL) { result in
|
||||
print("Sideloaded app at \(fileURL) with result:", result)
|
||||
os_log("Sideloaded app at %@ with result: %@", type: .info , fileURL.absoluteString, String(describing: result))
|
||||
}
|
||||
|
||||
case .exportToService, .moveToService: break
|
||||
|
||||
@@ -13,6 +13,7 @@ import SideStoreCore
|
||||
import RoxasUIKit
|
||||
|
||||
import Nuke
|
||||
import os.log
|
||||
|
||||
private final class AppBannerFooterView: UICollectionReusableView {
|
||||
let bannerView = AppBannerView(frame: .zero)
|
||||
@@ -159,7 +160,7 @@ private extension NewsViewController {
|
||||
cell.imageView.image = image
|
||||
|
||||
if let error = error {
|
||||
print("Error loading image:", error)
|
||||
os_log("Error loading image: %@", type: .error , error.localizedDescription)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -278,7 +279,7 @@ private extension NewsViewController {
|
||||
let toastView = ToastView(error: error)
|
||||
toastView.show(in: self)
|
||||
|
||||
case .success: print("Installed app:", storeApp.bundleIdentifier)
|
||||
case .success: os_log("Installed app: %@", type: .info, storeApp.bundleIdentifier)
|
||||
}
|
||||
|
||||
UIView.performWithoutAnimation {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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) }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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?
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -14,6 +14,7 @@ import RoxasUIKit
|
||||
import SideKit
|
||||
import Nuke
|
||||
import QuickLook
|
||||
import os.log
|
||||
|
||||
final class ErrorLogViewController: UITableViewController {
|
||||
private lazy var dataSource = self.makeDataSource()
|
||||
@@ -248,7 +249,7 @@ extension ErrorLogViewController {
|
||||
try context.save()
|
||||
completion(true)
|
||||
} catch {
|
||||
print("[ALTLog] Failed to delete LoggedError \(loggedError.objectID):", error)
|
||||
os_log("[ALTLog] Failed to delete LoggedError %@: %@", type: .error , loggedError.objectID, error.localizedDescription)
|
||||
completion(false)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,6 +11,7 @@ import UIKit
|
||||
|
||||
import SideStoreCore
|
||||
import RoxasUIKit
|
||||
import os.log
|
||||
|
||||
struct SourceError: LocalizedError {
|
||||
enum Code {
|
||||
@@ -285,12 +286,12 @@ private extension SourcesViewController {
|
||||
DispatchQueue.main.async {
|
||||
do {
|
||||
let sources = try result.get()
|
||||
print("Fetched trusted sources:", sources.map { $0.identifier })
|
||||
os_log("Fetched trusted sources: %@", type: .info , sources.map { $0.identifier }.joined(separator: "\n"))
|
||||
|
||||
let sectionUpdate = RSTCellContentChange(type: .update, sectionIndex: 0)
|
||||
self.trustedSourcesDataSource.setItems(sources, with: [sectionUpdate])
|
||||
} catch {
|
||||
print("Error fetching trusted sources:", error)
|
||||
os_log("Error fetching trusted sources: %@", type: .error , error.localizedDescription)
|
||||
|
||||
let sectionUpdate = RSTCellContentChange(type: .update, sectionIndex: 0)
|
||||
self.trustedSourcesDataSource.setItems([], with: [sectionUpdate])
|
||||
|
||||
@@ -10,6 +10,7 @@ import CoreData
|
||||
|
||||
import AltSign
|
||||
import Roxas
|
||||
import os.log
|
||||
|
||||
private extension CFNotificationName {
|
||||
static let willAccessDatabase = CFNotificationName("com.rileytestut.AltStore.WillAccessDatabase" as CFString)
|
||||
@@ -117,7 +118,7 @@ public extension DatabaseManager {
|
||||
|
||||
completionHandler(nil)
|
||||
} catch {
|
||||
print("Failed to save when signing out.", error)
|
||||
os_log("Failed to save when signing out. %@", type: .error , error.localizedDescription )
|
||||
completionHandler(error)
|
||||
}
|
||||
}
|
||||
@@ -265,7 +266,7 @@ private extension DatabaseManager {
|
||||
|
||||
try FileManager.default.copyItem(at: temporaryFileURL, to: fileURL, shouldReplace: true)
|
||||
} catch {
|
||||
print("Failed to copy AltStore app bundle to its proper location.", error)
|
||||
os_log("Failed to copy AltStore app bundle to its proper location. %@", type: .error , error.localizedDescription )
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -349,7 +350,7 @@ private extension DatabaseManager {
|
||||
|
||||
finish(.success(()))
|
||||
} catch {
|
||||
print("Failed to migrate database to app group:", error)
|
||||
os_log("Failed to migrate database to app group: %@", type: .error , error.localizedDescription )
|
||||
finish(.failure(error))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
import CoreData
|
||||
|
||||
import Roxas
|
||||
import os.log
|
||||
|
||||
open class MergePolicy: RSTRelationshipPreservingMergePolicy {
|
||||
override open func resolve(constraintConflicts conflicts: [NSConstraintConflict]) throws {
|
||||
@@ -40,7 +41,10 @@ open class MergePolicy: RSTRelationshipPreservingMergePolicy {
|
||||
if let primaryAppVersion = conflictingAppVersions.first(where: { $0.latestVersionApp?.latestVersion == $0 }),
|
||||
let secondaryAppVersion = conflictingAppVersions.first(where: { $0 != primaryAppVersion }) {
|
||||
secondaryAppVersion.managedObjectContext?.delete(secondaryAppVersion)
|
||||
print("[ALTLog] Resolving AppVersion context-level conflict. Most likely due to migrating from pre-AppVersion model version.", primaryAppVersion)
|
||||
os_log(
|
||||
"[ALTLog] Resolving AppVersion context-level conflict. Most likely due to migrating from pre-AppVersion model version. %@",
|
||||
type: .error ,
|
||||
primaryAppVersion )
|
||||
}
|
||||
|
||||
default:
|
||||
@@ -65,7 +69,11 @@ open class MergePolicy: RSTRelationshipPreservingMergePolicy {
|
||||
if let contextApp = conflict.conflictingObjects.first as? StoreApp {
|
||||
let contextVersions = Set(contextApp._versions.lazy.compactMap { $0 as? AppVersion }.map { $0.version })
|
||||
for case let appVersion as AppVersion in databaseObject._versions where !contextVersions.contains(appVersion.version) {
|
||||
print("[ALTLog] Deleting cached app version: \(appVersion.appBundleID + "_" + appVersion.version), not in:", contextApp.versions.map { $0.appBundleID + "_" + $0.version })
|
||||
os_log("[ALTLog] Deleting cached app version: %@_%@, not in: %@",
|
||||
type: .info,
|
||||
appVersion.appBundleID,
|
||||
appVersion.version,
|
||||
contextApp.versions.map { $0.appBundleID + "_" + $0.version })
|
||||
appVersion.managedObjectContext?.delete(appVersion)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
import AuthenticationServices
|
||||
import CoreData
|
||||
import Foundation
|
||||
import os.log
|
||||
|
||||
private let clientID = "ZMx0EGUWe4TVWYXNZZwK_fbIK5jHFVWoUf1Qb-sqNXmT-YzAGwDPxxq7ak3_W5Q2"
|
||||
private let clientSecret = "1hktsZB89QyN69cB4R0tu55R4TCPQGXxvebYUUh7Y-5TLSnRswuxs6OUjdJ74IJt"
|
||||
@@ -242,7 +243,7 @@ public extension PatreonAPI {
|
||||
|
||||
try account.managedObjectContext?.save()
|
||||
} catch {
|
||||
print("Failed to fetch Patreon account.", error)
|
||||
os_log("Failed to fetch Patreon account. %@", type: .error , error.localizedDescription)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
//
|
||||
// Countdown.swift
|
||||
// AltWidgetExtension
|
||||
// SideWidgetExtension
|
||||
//
|
||||
// Created by Riley Testut on 7/6/20.
|
||||
// Copyright © 2020 Riley Testut. All rights reserved.
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>$(DEVELOPMENT_LANGUAGE)</string>
|
||||
<key>CFBundleDisplayName</key>
|
||||
<string>AltWidget</string>
|
||||
<string>SideWidget</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>$(EXECUTABLE_NAME)</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
//
|
||||
// AltWidget.swift
|
||||
// AltWidget
|
||||
// SideWidget.swift
|
||||
// SideWidget
|
||||
//
|
||||
// Created by Riley Testut on 6/26/20.
|
||||
// Copyright © 2020 Riley Testut. All rights reserved.
|
||||
@@ -15,6 +15,7 @@ import AltSign
|
||||
import SideStoreCore
|
||||
import Roxas
|
||||
import RoxasUIKit
|
||||
import os.log
|
||||
|
||||
struct AppEntry: TimelineEntry {
|
||||
var date: Date
|
||||
@@ -66,7 +67,7 @@ struct Provider: IntentTimelineProvider {
|
||||
let entry = AppEntry(date: Date(), app: snapshot)
|
||||
completion(entry)
|
||||
} catch {
|
||||
print("Error preparing widget snapshot:", error)
|
||||
os_log(" %@", type: .error , error.localizedDescription)
|
||||
|
||||
let entry = AppEntry(date: Date(), app: nil)
|
||||
completion(entry)
|
||||
@@ -131,7 +132,7 @@ struct Provider: IntentTimelineProvider {
|
||||
let timeline = Timeline(entries: entries, policy: .atEnd)
|
||||
completion(timeline)
|
||||
} catch {
|
||||
print("Error preparing widget timeline:", error)
|
||||
os_log(" %@", type: .error , error.localizedDescription)
|
||||
|
||||
let entry = AppEntry(date: Date(), app: nil)
|
||||
let timeline = Timeline(entries: [entry], policy: .atEnd)
|
||||
@@ -164,7 +165,7 @@ struct HomeScreenWidget: Widget {
|
||||
WidgetView(entry: entry)
|
||||
}
|
||||
.supportedFamilies([.systemSmall])
|
||||
.configurationDisplayName("AltWidget")
|
||||
.configurationDisplayName("SideWidget")
|
||||
.description("View remaining days until your sideloaded apps expire.")
|
||||
}
|
||||
}
|
||||
@@ -180,7 +181,7 @@ struct TextLockScreenWidget: Widget {
|
||||
ComplicationView(entry: entry, style: .text)
|
||||
}
|
||||
.supportedFamilies([.accessoryCircular])
|
||||
.configurationDisplayName("AltWidget (Text)")
|
||||
.configurationDisplayName("SideWidget (Text)")
|
||||
.description("View remaining days until SideStore expires.")
|
||||
} else {
|
||||
return EmptyWidgetConfiguration()
|
||||
@@ -199,7 +200,7 @@ struct IconLockScreenWidget: Widget {
|
||||
ComplicationView(entry: entry, style: .icon)
|
||||
}
|
||||
.supportedFamilies([.accessoryCircular])
|
||||
.configurationDisplayName("AltWidget (Icon)")
|
||||
.configurationDisplayName("SideWidget (Icon)")
|
||||
.description("View remaining days until SideStore expires.")
|
||||
} else {
|
||||
return EmptyWidgetConfiguration()
|
||||
@@ -221,7 +222,7 @@ struct IconLockScreenWidget: Widget {
|
||||
// ComplicationView(entry: entry, style: .icon)
|
||||
// }
|
||||
// .supportedFamilies([.accessoryCircular])
|
||||
// .configurationDisplayName("AltWidget")
|
||||
// .configurationDisplayName("SideWidget")
|
||||
// .description("View remaining days until SideStore expires.")
|
||||
// }
|
||||
// else
|
||||
@@ -232,7 +233,7 @@ struct IconLockScreenWidget: Widget {
|
||||
// }
|
||||
|
||||
@main
|
||||
struct AltWidgets: WidgetBundle {
|
||||
struct SideWidgets: WidgetBundle {
|
||||
var body: some Widget {
|
||||
HomeScreenWidget()
|
||||
IconLockScreenWidget()
|
||||
|
||||
Reference in New Issue
Block a user