mirror of
https://github.com/SideStore/SideStore.git
synced 2026-02-11 07:43:28 +01:00
Updates most InstalledApp/Extension properties when refreshing apps
This commit is contained in:
@@ -168,7 +168,6 @@ private extension DatabaseManager
|
||||
{
|
||||
installedApp = InstalledApp(resignedApp: localApp, originalBundleIdentifier: StoreApp.altstoreAppID, context: context)
|
||||
installedApp.storeApp = storeApp
|
||||
installedApp.installedDate = Date()
|
||||
}
|
||||
|
||||
let fileURL = installedApp.fileURL
|
||||
@@ -195,13 +194,7 @@ private extension DatabaseManager
|
||||
}
|
||||
|
||||
// Must go after comparing versions to see if we need to update our cached AltStore app bundle.
|
||||
installedApp.version = localApp.version
|
||||
|
||||
if let provisioningProfile = localApp.provisioningProfile
|
||||
{
|
||||
installedApp.refreshedDate = provisioningProfile.creationDate
|
||||
installedApp.expirationDate = provisioningProfile.expirationDate
|
||||
}
|
||||
installedApp.update(resignedApp: localApp)
|
||||
|
||||
do
|
||||
{
|
||||
|
||||
@@ -54,10 +54,21 @@ class InstalledApp: NSManagedObject, InstalledAppProtocol
|
||||
{
|
||||
super.init(entity: InstalledApp.entity(), insertInto: context)
|
||||
|
||||
self.name = resignedApp.name
|
||||
self.bundleIdentifier = originalBundleIdentifier
|
||||
self.resignedBundleIdentifier = resignedApp.bundleIdentifier
|
||||
|
||||
self.refreshedDate = Date()
|
||||
self.installedDate = Date()
|
||||
|
||||
self.expirationDate = self.refreshedDate.addingTimeInterval(60 * 60 * 24 * 7) // Rough estimate until we get real values from provisioning profile.
|
||||
|
||||
self.update(resignedApp: resignedApp)
|
||||
}
|
||||
|
||||
func update(resignedApp: ALTApplication)
|
||||
{
|
||||
self.name = resignedApp.name
|
||||
|
||||
self.resignedBundleIdentifier = resignedApp.bundleIdentifier
|
||||
self.version = resignedApp.version
|
||||
|
||||
if let provisioningProfile = resignedApp.provisioningProfile
|
||||
@@ -65,13 +76,6 @@ class InstalledApp: NSManagedObject, InstalledAppProtocol
|
||||
self.refreshedDate = provisioningProfile.creationDate
|
||||
self.expirationDate = provisioningProfile.expirationDate
|
||||
}
|
||||
else
|
||||
{
|
||||
self.refreshedDate = Date()
|
||||
self.expirationDate = self.refreshedDate.addingTimeInterval(60 * 60 * 24 * 7) // Rough estimate until we get real values from provisioning profile.
|
||||
}
|
||||
|
||||
self.installedDate = Date()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -36,10 +36,21 @@ class InstalledExtension: NSManagedObject, InstalledAppProtocol
|
||||
{
|
||||
super.init(entity: InstalledExtension.entity(), insertInto: context)
|
||||
|
||||
self.name = resignedAppExtension.name
|
||||
self.bundleIdentifier = originalBundleIdentifier
|
||||
self.resignedBundleIdentifier = resignedAppExtension.bundleIdentifier
|
||||
|
||||
self.refreshedDate = Date()
|
||||
self.installedDate = Date()
|
||||
|
||||
self.expirationDate = self.refreshedDate.addingTimeInterval(60 * 60 * 24 * 7) // Rough estimate until we get real values from provisioning profile.
|
||||
|
||||
self.update(resignedAppExtension: resignedAppExtension)
|
||||
}
|
||||
|
||||
func update(resignedAppExtension: ALTApplication)
|
||||
{
|
||||
self.name = resignedAppExtension.name
|
||||
|
||||
self.resignedBundleIdentifier = resignedAppExtension.bundleIdentifier
|
||||
self.version = resignedAppExtension.version
|
||||
|
||||
if let provisioningProfile = resignedAppExtension.provisioningProfile
|
||||
@@ -47,13 +58,6 @@ class InstalledExtension: NSManagedObject, InstalledAppProtocol
|
||||
self.refreshedDate = provisioningProfile.creationDate
|
||||
self.expirationDate = provisioningProfile.expirationDate
|
||||
}
|
||||
else
|
||||
{
|
||||
self.refreshedDate = Date()
|
||||
self.expirationDate = self.refreshedDate.addingTimeInterval(60 * 60 * 24 * 7) // Rough estimate until we get real values from provisioning profile.
|
||||
}
|
||||
|
||||
self.installedDate = Date()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user