Add a bunch more "logging" throughout signing

This commit is contained in:
Nythepegasus
2022-12-03 17:25:15 -05:00
committed by Joseph Mattello
parent 4a5ca81e9a
commit 4c441077c7
6 changed files with 25 additions and 3 deletions

View File

@@ -79,6 +79,8 @@ public class InstalledApp: NSManagedObject, InstalledAppProtocol
self.bundleIdentifier = originalBundleIdentifier
print("InstalledApp `self.bundleIdentifier`: \(self.bundleIdentifier)")
self.refreshedDate = Date()
self.installedDate = Date()
@@ -154,13 +156,14 @@ public extension InstalledApp
{
let fetchRequest = InstalledApp.fetchRequest() as NSFetchRequest<InstalledApp>
fetchRequest.predicate = NSPredicate(format: "%K == YES", #keyPath(InstalledApp.isActive))
print("Active Apps Fetch Request: \(String(describing: fetchRequest.predicate))")
return fetchRequest
}
class func fetchAltStore(in context: NSManagedObjectContext) -> InstalledApp?
{
let predicate = NSPredicate(format: "%K == %@", #keyPath(InstalledApp.bundleIdentifier), StoreApp.altstoreAppID)
print("Fetch 'AltStore' Predicate: \(String(describing: predicate))")
let altStore = InstalledApp.first(satisfying: predicate, in: context)
return altStore
}
@@ -174,6 +177,7 @@ public extension InstalledApp
class func fetchAppsForRefreshingAll(in context: NSManagedObjectContext) -> [InstalledApp]
{
var predicate = NSPredicate(format: "%K == YES AND %K != %@", #keyPath(InstalledApp.isActive), #keyPath(InstalledApp.bundleIdentifier), StoreApp.altstoreAppID)
print("Fetch Apps for Refreshing All 'AltStore' predicate: \(String(describing: predicate))")
// if let patreonAccount = DatabaseManager.shared.patreonAccount(in: context), patreonAccount.isPatron, PatreonAPI.shared.isAuthenticated
// {
@@ -207,6 +211,7 @@ public extension InstalledApp
#keyPath(InstalledApp.isActive),
#keyPath(InstalledApp.refreshedDate), date as NSDate,
#keyPath(InstalledApp.bundleIdentifier), StoreApp.altstoreAppID)
print("Active Apps For Background Refresh 'AltStore' predicate: \(String(describing: predicate))")
// if let patreonAccount = DatabaseManager.shared.patreonAccount(in: context), patreonAccount.isPatron, PatreonAPI.shared.isAuthenticated
// {
@@ -253,14 +258,15 @@ public extension InstalledApp
let appsDirectoryURL = baseDirectory.appendingPathComponent("Apps")
do { try FileManager.default.createDirectory(at: appsDirectoryURL, withIntermediateDirectories: true, attributes: nil) }
catch { print(error) }
catch { print("Creating App Directory Error: \(error)") }
print("`appsDirectoryURL` is set to: \(appsDirectoryURL.absoluteString)")
return appsDirectoryURL
}
class var legacyAppsDirectoryURL: URL {
let baseDirectory = FileManager.default.applicationSupportDirectory
let appsDirectoryURL = baseDirectory.appendingPathComponent("Apps")
print("legacy `appsDirectoryURL` is set to: \(appsDirectoryURL.absoluteString)")
return appsDirectoryURL
}
@@ -273,6 +279,7 @@ public extension InstalledApp
class func refreshedIPAURL(for app: AppProtocol) -> URL
{
let ipaURL = self.directoryURL(for: app).appendingPathComponent("Refreshed.ipa")
print("`ipaURL`: \(ipaURL.absoluteString)")
return ipaURL
}

View File

@@ -361,6 +361,8 @@ public extension StoreApp
in: context)
app.setVersions([appVersion])
print("makeAltStoreApp StoreApp: \(String(describing: app))")
#if BETA
app.isBeta = true
#endif