mirror of
https://github.com/SideStore/SideStore.git
synced 2026-02-19 19:53:25 +01:00
Add a bunch more "logging" throughout signing
This commit is contained in:
committed by
Joseph Mattello
parent
4a5ca81e9a
commit
4c441077c7
@@ -47,6 +47,7 @@ class FetchAnisetteDataOperation: ResultOperation<ALTAnisetteData>
|
|||||||
let formattedJSON: [String: String] = ["machineID": json["X-Apple-I-MD-M"]!, "oneTimePassword": json["X-Apple-I-MD"]!, "localUserID": json["X-Apple-I-MD-LU"]!, "routingInfo": json["X-Apple-I-MD-RINFO"]!, "deviceUniqueIdentifier": json["X-Mme-Device-Id"]!, "deviceDescription": json["X-MMe-Client-Info"]!, "date": json["X-Apple-I-Client-Time"]!, "locale": json["X-Apple-Locale"]!, "timeZone": json["X-Apple-I-TimeZone"]!, "deviceSerialNumber": "1"]
|
let formattedJSON: [String: String] = ["machineID": json["X-Apple-I-MD-M"]!, "oneTimePassword": json["X-Apple-I-MD"]!, "localUserID": json["X-Apple-I-MD-LU"]!, "routingInfo": json["X-Apple-I-MD-RINFO"]!, "deviceUniqueIdentifier": json["X-Mme-Device-Id"]!, "deviceDescription": json["X-MMe-Client-Info"]!, "date": json["X-Apple-I-Client-Time"]!, "locale": json["X-Apple-Locale"]!, "timeZone": json["X-Apple-I-TimeZone"]!, "deviceSerialNumber": "1"]
|
||||||
|
|
||||||
if let anisette = ALTAnisetteData(json: formattedJSON) {
|
if let anisette = ALTAnisetteData(json: formattedJSON) {
|
||||||
|
DLOG("Anisette used: %@", formattedJSON)
|
||||||
self.finish(.success(anisette))
|
self.finish(.success(anisette))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -86,6 +86,11 @@ class InstallAppOperation: ResultOperation<InstalledApp>
|
|||||||
let resignedBundleID = appExtension.bundleIdentifier
|
let resignedBundleID = appExtension.bundleIdentifier
|
||||||
let originalBundleID = resignedBundleID.replacingOccurrences(of: resignedParentBundleID, with: parentBundleID)
|
let originalBundleID = resignedBundleID.replacingOccurrences(of: resignedParentBundleID, with: parentBundleID)
|
||||||
|
|
||||||
|
print("`parentBundleID`: \(parentBundleID)")
|
||||||
|
print("`resignedParentBundleID`: \(resignedParentBundleID)")
|
||||||
|
print("`resignedBundleID`: \(resignedBundleID)")
|
||||||
|
print("`originalBundleID`: \(originalBundleID)")
|
||||||
|
|
||||||
let installedExtension: InstalledExtension
|
let installedExtension: InstalledExtension
|
||||||
|
|
||||||
if let appExtension = installedApp.appExtensions.first(where: { $0.bundleIdentifier == originalBundleID })
|
if let appExtension = installedApp.appExtensions.first(where: { $0.bundleIdentifier == originalBundleID })
|
||||||
|
|||||||
@@ -42,6 +42,7 @@ class SendAppOperation: ResultOperation<()>
|
|||||||
let app = AnyApp(name: resignedApp.name, bundleIdentifier: self.context.bundleIdentifier, url: resignedApp.fileURL)
|
let app = AnyApp(name: resignedApp.name, bundleIdentifier: self.context.bundleIdentifier, url: resignedApp.fileURL)
|
||||||
let fileURL = InstalledApp.refreshedIPAURL(for: app)
|
let fileURL = InstalledApp.refreshedIPAURL(for: app)
|
||||||
|
|
||||||
|
print("AFC App `fileURL`: \(fileURL.absoluteString)")
|
||||||
|
|
||||||
let ns_bundle = NSString(string: app.bundleIdentifier)
|
let ns_bundle = NSString(string: app.bundleIdentifier)
|
||||||
let ns_bundle_ptr = UnsafeMutablePointer<CChar>(mutating: ns_bundle.utf8String)
|
let ns_bundle_ptr = UnsafeMutablePointer<CChar>(mutating: ns_bundle.utf8String)
|
||||||
@@ -59,6 +60,7 @@ class SendAppOperation: ResultOperation<()>
|
|||||||
attempts -= 1
|
attempts -= 1
|
||||||
}
|
}
|
||||||
if res == 0 {
|
if res == 0 {
|
||||||
|
print("minimuxer_yeet_app_afc `res` == \(res)")
|
||||||
self.progress.completedUnitCount += 1
|
self.progress.completedUnitCount += 1
|
||||||
self.finish(.success(()))
|
self.finish(.success(()))
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -79,6 +79,8 @@ public class InstalledApp: NSManagedObject, InstalledAppProtocol
|
|||||||
|
|
||||||
self.bundleIdentifier = originalBundleIdentifier
|
self.bundleIdentifier = originalBundleIdentifier
|
||||||
|
|
||||||
|
print("InstalledApp `self.bundleIdentifier`: \(self.bundleIdentifier)")
|
||||||
|
|
||||||
self.refreshedDate = Date()
|
self.refreshedDate = Date()
|
||||||
self.installedDate = Date()
|
self.installedDate = Date()
|
||||||
|
|
||||||
@@ -154,13 +156,14 @@ public extension InstalledApp
|
|||||||
{
|
{
|
||||||
let fetchRequest = InstalledApp.fetchRequest() as NSFetchRequest<InstalledApp>
|
let fetchRequest = InstalledApp.fetchRequest() as NSFetchRequest<InstalledApp>
|
||||||
fetchRequest.predicate = NSPredicate(format: "%K == YES", #keyPath(InstalledApp.isActive))
|
fetchRequest.predicate = NSPredicate(format: "%K == YES", #keyPath(InstalledApp.isActive))
|
||||||
|
print("Active Apps Fetch Request: \(String(describing: fetchRequest.predicate))")
|
||||||
return fetchRequest
|
return fetchRequest
|
||||||
}
|
}
|
||||||
|
|
||||||
class func fetchAltStore(in context: NSManagedObjectContext) -> InstalledApp?
|
class func fetchAltStore(in context: NSManagedObjectContext) -> InstalledApp?
|
||||||
{
|
{
|
||||||
let predicate = NSPredicate(format: "%K == %@", #keyPath(InstalledApp.bundleIdentifier), StoreApp.altstoreAppID)
|
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)
|
let altStore = InstalledApp.first(satisfying: predicate, in: context)
|
||||||
return altStore
|
return altStore
|
||||||
}
|
}
|
||||||
@@ -174,6 +177,7 @@ public extension InstalledApp
|
|||||||
class func fetchAppsForRefreshingAll(in context: NSManagedObjectContext) -> [InstalledApp]
|
class func fetchAppsForRefreshingAll(in context: NSManagedObjectContext) -> [InstalledApp]
|
||||||
{
|
{
|
||||||
var predicate = NSPredicate(format: "%K == YES AND %K != %@", #keyPath(InstalledApp.isActive), #keyPath(InstalledApp.bundleIdentifier), StoreApp.altstoreAppID)
|
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
|
// 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.isActive),
|
||||||
#keyPath(InstalledApp.refreshedDate), date as NSDate,
|
#keyPath(InstalledApp.refreshedDate), date as NSDate,
|
||||||
#keyPath(InstalledApp.bundleIdentifier), StoreApp.altstoreAppID)
|
#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
|
// 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")
|
let appsDirectoryURL = baseDirectory.appendingPathComponent("Apps")
|
||||||
|
|
||||||
do { try FileManager.default.createDirectory(at: appsDirectoryURL, withIntermediateDirectories: true, attributes: nil) }
|
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
|
return appsDirectoryURL
|
||||||
}
|
}
|
||||||
|
|
||||||
class var legacyAppsDirectoryURL: URL {
|
class var legacyAppsDirectoryURL: URL {
|
||||||
let baseDirectory = FileManager.default.applicationSupportDirectory
|
let baseDirectory = FileManager.default.applicationSupportDirectory
|
||||||
let appsDirectoryURL = baseDirectory.appendingPathComponent("Apps")
|
let appsDirectoryURL = baseDirectory.appendingPathComponent("Apps")
|
||||||
|
print("legacy `appsDirectoryURL` is set to: \(appsDirectoryURL.absoluteString)")
|
||||||
return appsDirectoryURL
|
return appsDirectoryURL
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -273,6 +279,7 @@ public extension InstalledApp
|
|||||||
class func refreshedIPAURL(for app: AppProtocol) -> URL
|
class func refreshedIPAURL(for app: AppProtocol) -> URL
|
||||||
{
|
{
|
||||||
let ipaURL = self.directoryURL(for: app).appendingPathComponent("Refreshed.ipa")
|
let ipaURL = self.directoryURL(for: app).appendingPathComponent("Refreshed.ipa")
|
||||||
|
print("`ipaURL`: \(ipaURL.absoluteString)")
|
||||||
return ipaURL
|
return ipaURL
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -361,6 +361,8 @@ public extension StoreApp
|
|||||||
in: context)
|
in: context)
|
||||||
app.setVersions([appVersion])
|
app.setVersions([appVersion])
|
||||||
|
|
||||||
|
print("makeAltStoreApp StoreApp: \(String(describing: app))")
|
||||||
|
|
||||||
#if BETA
|
#if BETA
|
||||||
app.isBeta = true
|
app.isBeta = true
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -305,6 +305,8 @@ public struct BeginInstallationRequest: ServerMessageProtocol
|
|||||||
{
|
{
|
||||||
self.activeProfiles = activeProfiles
|
self.activeProfiles = activeProfiles
|
||||||
self.bundleIdentifier = bundleIdentifier
|
self.bundleIdentifier = bundleIdentifier
|
||||||
|
print("BeginInstallationRequest `activeProfiles`: \(String(describing: activeProfiles))")
|
||||||
|
print("BeginInstallationRequest `bundleIdentifier`: \(String(describing: bundleIdentifier))")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -346,6 +348,9 @@ public struct InstallProvisioningProfilesRequest: ServerMessageProtocol
|
|||||||
self.udid = udid
|
self.udid = udid
|
||||||
self.provisioningProfiles = provisioningProfiles
|
self.provisioningProfiles = provisioningProfiles
|
||||||
self.activeProfiles = activeProfiles
|
self.activeProfiles = activeProfiles
|
||||||
|
print("InstallProvisioningProfilesRequest `self.udid`: \(self.udid)")
|
||||||
|
print("InstallProvisioningProfilesRequest `self.provisioningProfiles`: \(self.provisioningProfiles)")
|
||||||
|
print("InstallProvisioningProfilesRequest `self.activeProfiles`: \(String(describing: self.activeProfiles))")
|
||||||
}
|
}
|
||||||
|
|
||||||
public init(from decoder: Decoder) throws
|
public init(from decoder: Decoder) throws
|
||||||
|
|||||||
Reference in New Issue
Block a user