Skip to content

Commit 154b1e7

Browse files
committed
Use main profile when refreshing
1 parent 00ed6e6 commit 154b1e7

4 files changed

Lines changed: 7 additions & 2 deletions

File tree

AltStore/Managing Apps/AppManager.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1685,8 +1685,8 @@ private extension AppManager
16851685

16861686
let context = AppOperationContext(bundleIdentifier: app.bundleIdentifier, authenticatedContext: group.context)
16871687
context.app = ALTApplication(fileURL: app.fileURL)
1688-
1689-
// Since this doesn't involve modifying app bundle which will cause re-install, this is safe in refresh path
1688+
context.useMainProfile = app.useMainProfile
1689+
// Since this doesn't involve modifying app bundle which will cause re-install, this is safe in refresh path
16901690
//App-Extensions: Ensure DB data and disk state must match
16911691
let dbAppEx: Set<InstalledExtension> = Set(app.appExtensions)
16921692
let diskAppEx: Set<ALTApplication> = Set(context.app!.appExtensions)

AltStore/Operations/InstallAppOperation.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,8 @@ final class InstallAppOperation: ResultOperation<InstalledApp>
7272
}
7373

7474
installedApp.update(resignedApp: resignedApp, certificateSerialNumber: certificate.serialNumber, storeBuildVersion: storeBuildVersion)
75+
installedApp.useMainProfile = self.context.useMainProfile
76+
7577
installedApp.needsResign = false
7678

7779
if let team = DatabaseManager.shared.activeTeam(in: backgroundContext)

AltStoreCore/Model/AltStore.xcdatamodeld/AltStore 17_1.xcdatamodel/contents

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@
9898
<attribute name="refreshedDate" attributeType="Date" usesScalarValueType="NO"/>
9999
<attribute name="resignedBundleIdentifier" attributeType="String"/>
100100
<attribute name="storeBuildVersion" optional="YES" attributeType="String"/>
101+
<attribute name="useMainProfile" optional="YES" attributeType="Boolean" usesScalarValueType="YES"/>
101102
<attribute name="version" attributeType="String"/>
102103
<relationship name="appExtensions" toMany="YES" deletionRule="Cascade" destinationEntity="InstalledExtension" inverseName="parentApp" inverseEntity="InstalledExtension"/>
103104
<relationship name="loggedErrors" toMany="YES" deletionRule="Nullify" destinationEntity="LoggedError" inverseName="installedApp" inverseEntity="LoggedError"/>

AltStoreCore/Model/InstalledApp.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ public class InstalledApp: BaseEntity, InstalledAppProtocol
5959
@NSManaged public var needsResign: Bool
6060
@NSManaged public var hasAlternateIcon: Bool
6161

62+
@NSManaged public var useMainProfile: Bool
63+
6264
@NSManaged public var certificateSerialNumber: String?
6365
@NSManaged public var storeBuildVersion: String?
6466

0 commit comments

Comments
 (0)