From 685d9567752c6b7396304f8b64f0f713f52cf936 Mon Sep 17 00:00:00 2001 From: Huge_Black <60165378+hugeBlack@users.noreply.github.com> Date: Sun, 22 Jun 2025 20:31:13 +0800 Subject: [PATCH] Use main profile when refreshing (#1013) --- AltStore/Managing Apps/AppManager.swift | 4 ++-- AltStore/Operations/InstallAppOperation.swift | 2 ++ .../AltStore.xcdatamodeld/AltStore 17_1.xcdatamodel/contents | 1 + AltStoreCore/Model/InstalledApp.swift | 2 ++ 4 files changed, 7 insertions(+), 2 deletions(-) diff --git a/AltStore/Managing Apps/AppManager.swift b/AltStore/Managing Apps/AppManager.swift index 66bd0d8f..1609599d 100644 --- a/AltStore/Managing Apps/AppManager.swift +++ b/AltStore/Managing Apps/AppManager.swift @@ -1685,8 +1685,8 @@ private extension AppManager let context = AppOperationContext(bundleIdentifier: app.bundleIdentifier, authenticatedContext: group.context) context.app = ALTApplication(fileURL: app.fileURL) - - // Since this doesn't involve modifying app bundle which will cause re-install, this is safe in refresh path + context.useMainProfile = app.useMainProfile + // Since this doesn't involve modifying app bundle which will cause re-install, this is safe in refresh path //App-Extensions: Ensure DB data and disk state must match let dbAppEx: Set = Set(app.appExtensions) let diskAppEx: Set = Set(context.app!.appExtensions) diff --git a/AltStore/Operations/InstallAppOperation.swift b/AltStore/Operations/InstallAppOperation.swift index c88ad8d0..9c2fb5c9 100644 --- a/AltStore/Operations/InstallAppOperation.swift +++ b/AltStore/Operations/InstallAppOperation.swift @@ -72,6 +72,8 @@ final class InstallAppOperation: ResultOperation } installedApp.update(resignedApp: resignedApp, certificateSerialNumber: certificate.serialNumber, storeBuildVersion: storeBuildVersion) + installedApp.useMainProfile = self.context.useMainProfile + installedApp.needsResign = false if let team = DatabaseManager.shared.activeTeam(in: backgroundContext) diff --git a/AltStoreCore/Model/AltStore.xcdatamodeld/AltStore 17_1.xcdatamodel/contents b/AltStoreCore/Model/AltStore.xcdatamodeld/AltStore 17_1.xcdatamodel/contents index b9169173..92ca329f 100644 --- a/AltStoreCore/Model/AltStore.xcdatamodeld/AltStore 17_1.xcdatamodel/contents +++ b/AltStoreCore/Model/AltStore.xcdatamodeld/AltStore 17_1.xcdatamodel/contents @@ -98,6 +98,7 @@ + diff --git a/AltStoreCore/Model/InstalledApp.swift b/AltStoreCore/Model/InstalledApp.swift index e6036525..33df83e2 100644 --- a/AltStoreCore/Model/InstalledApp.swift +++ b/AltStoreCore/Model/InstalledApp.swift @@ -59,6 +59,8 @@ public class InstalledApp: BaseEntity, InstalledAppProtocol @NSManaged public var needsResign: Bool @NSManaged public var hasAlternateIcon: Bool + @NSManaged public var useMainProfile: Bool + @NSManaged public var certificateSerialNumber: String? @NSManaged public var storeBuildVersion: String?