mirror of
https://github.com/SideStore/SideStore.git
synced 2026-02-09 06:43:25 +01:00
Prioritizes app refresh order
Tries to refresh apps that are about to expire first, and then always refreshes AltStore itself last, since refreshing AltStore means that the app will quit.
This commit is contained in:
@@ -8,6 +8,7 @@
|
||||
|
||||
import CoreData
|
||||
|
||||
import AltSign
|
||||
import Roxas
|
||||
|
||||
public class DatabaseManager
|
||||
@@ -120,14 +121,23 @@ private extension DatabaseManager
|
||||
altStoreApp.version = version
|
||||
}
|
||||
|
||||
if let installedApp = altStoreApp.installedApp
|
||||
let installedApp: InstalledApp
|
||||
|
||||
if let app = altStoreApp.installedApp
|
||||
{
|
||||
installedApp.version = version
|
||||
installedApp = app
|
||||
}
|
||||
else
|
||||
{
|
||||
let installedApp = InstalledApp(app: altStoreApp, bundleIdentifier: altStoreApp.identifier, expirationDate: Date(), context: context)
|
||||
installedApp.version = version
|
||||
installedApp = InstalledApp(app: altStoreApp, bundleIdentifier: altStoreApp.identifier, context: context)
|
||||
}
|
||||
|
||||
installedApp.version = version
|
||||
|
||||
if let provisioningProfileURL = Bundle.main.url(forResource: "embedded", withExtension: "mobileprovision"), let provisioningProfile = ALTProvisioningProfile(url: provisioningProfileURL)
|
||||
{
|
||||
installedApp.refreshedDate = provisioningProfile.creationDate
|
||||
installedApp.expirationDate = provisioningProfile.expirationDate
|
||||
}
|
||||
|
||||
do
|
||||
|
||||
Reference in New Issue
Block a user