mirror of
https://github.com/SideStore/SideStore.git
synced 2026-02-19 19:53:25 +01:00
Adds InstalledApp.needsResign
When true, app will be resigned + reinstalled next refresh rather than just refreshing provisioning profiles.
This commit is contained in:
@@ -667,8 +667,19 @@ private extension AppManager
|
|||||||
case .refresh(let app):
|
case .refresh(let app):
|
||||||
// Check if backup app is installed in place of real app.
|
// Check if backup app is installed in place of real app.
|
||||||
let uti = UTTypeCopyDeclaration(app.installedBackupAppUTI as CFString)?.takeRetainedValue() as NSDictionary?
|
let uti = UTTypeCopyDeclaration(app.installedBackupAppUTI as CFString)?.takeRetainedValue() as NSDictionary?
|
||||||
|
if app.certificateSerialNumber != group.context.certificate?.serialNumber || uti != nil || app.needsResign
|
||||||
if app.certificateSerialNumber == group.context.certificate?.serialNumber && uti == nil
|
{
|
||||||
|
// Resign app instead of just refreshing profiles because either:
|
||||||
|
// * Refreshing using different certificate
|
||||||
|
// * Backup app is still installed
|
||||||
|
// * App explicitly needs resigning
|
||||||
|
|
||||||
|
let installProgress = self._install(app, operation: operation, group: group) { (result) in
|
||||||
|
self.finish(operation, result: result, group: group, progress: progress)
|
||||||
|
}
|
||||||
|
progress?.addChild(installProgress, withPendingUnitCount: 80)
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
// Refreshing with same certificate as last time, and backup app isn't still installed,
|
// Refreshing with same certificate as last time, and backup app isn't still installed,
|
||||||
// so we can just refresh provisioning profiles.
|
// so we can just refresh provisioning profiles.
|
||||||
@@ -678,16 +689,6 @@ private extension AppManager
|
|||||||
}
|
}
|
||||||
progress?.addChild(refreshProgress, withPendingUnitCount: 80)
|
progress?.addChild(refreshProgress, withPendingUnitCount: 80)
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
// Refreshing using different certificate or backup app is still installed,
|
|
||||||
// so we need to resign + install.
|
|
||||||
|
|
||||||
let installProgress = self._install(app, operation: operation, group: group) { (result) in
|
|
||||||
self.finish(operation, result: result, group: group, progress: progress)
|
|
||||||
}
|
|
||||||
progress?.addChild(installProgress, withPendingUnitCount: 80)
|
|
||||||
}
|
|
||||||
|
|
||||||
case .activate(let app):
|
case .activate(let app):
|
||||||
let activateProgress = self._activate(app, operation: operation, group: group) { (result) in
|
let activateProgress = self._activate(app, operation: operation, group: group) { (result) in
|
||||||
|
|||||||
@@ -62,7 +62,8 @@ class InstallAppOperation: ResultOperation<InstalledApp>
|
|||||||
}
|
}
|
||||||
|
|
||||||
installedApp.update(resignedApp: resignedApp, certificateSerialNumber: certificate.serialNumber)
|
installedApp.update(resignedApp: resignedApp, certificateSerialNumber: certificate.serialNumber)
|
||||||
|
installedApp.needsResign = false
|
||||||
|
|
||||||
if let team = DatabaseManager.shared.activeTeam(in: backgroundContext)
|
if let team = DatabaseManager.shared.activeTeam(in: backgroundContext)
|
||||||
{
|
{
|
||||||
installedApp.team = team
|
installedApp.team = team
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||||
<model type="com.apple.IDECoreDataModeler.DataModel" documentVersion="1.0" lastSavedToolsVersion="17189" systemVersion="20A5354i" minimumToolsVersion="Automatic" sourceLanguage="Swift" userDefinedModelVersionIdentifier="">
|
<model type="com.apple.IDECoreDataModeler.DataModel" documentVersion="1.0" lastSavedToolsVersion="17505" systemVersion="19G2021" minimumToolsVersion="Automatic" sourceLanguage="Swift" userDefinedModelVersionIdentifier="">
|
||||||
<entity name="Account" representedClassName="Account" syncable="YES">
|
<entity name="Account" representedClassName="Account" syncable="YES">
|
||||||
<attribute name="appleID" attributeType="String"/>
|
<attribute name="appleID" attributeType="String"/>
|
||||||
<attribute name="firstName" attributeType="String"/>
|
<attribute name="firstName" attributeType="String"/>
|
||||||
@@ -39,6 +39,7 @@
|
|||||||
<attribute name="isActive" attributeType="Boolean" defaultValueString="YES" usesScalarValueType="YES"/>
|
<attribute name="isActive" attributeType="Boolean" defaultValueString="YES" usesScalarValueType="YES"/>
|
||||||
<attribute name="isRefreshing" transient="YES" attributeType="Boolean" defaultValueString="NO" usesScalarValueType="YES"/>
|
<attribute name="isRefreshing" transient="YES" attributeType="Boolean" defaultValueString="NO" usesScalarValueType="YES"/>
|
||||||
<attribute name="name" attributeType="String"/>
|
<attribute name="name" attributeType="String"/>
|
||||||
|
<attribute name="needsResign" attributeType="Boolean" defaultValueString="NO" usesScalarValueType="YES"/>
|
||||||
<attribute name="refreshedDate" attributeType="Date" usesScalarValueType="NO"/>
|
<attribute name="refreshedDate" attributeType="Date" usesScalarValueType="NO"/>
|
||||||
<attribute name="resignedBundleIdentifier" attributeType="String"/>
|
<attribute name="resignedBundleIdentifier" attributeType="String"/>
|
||||||
<attribute name="version" attributeType="String"/>
|
<attribute name="version" attributeType="String"/>
|
||||||
@@ -163,7 +164,7 @@
|
|||||||
<element name="Account" positionX="-36" positionY="90" width="128" height="135"/>
|
<element name="Account" positionX="-36" positionY="90" width="128" height="135"/>
|
||||||
<element name="AppID" positionX="-27" positionY="153" width="128" height="133"/>
|
<element name="AppID" positionX="-27" positionY="153" width="128" height="133"/>
|
||||||
<element name="AppPermission" positionX="-45" positionY="90" width="128" height="90"/>
|
<element name="AppPermission" positionX="-45" positionY="90" width="128" height="90"/>
|
||||||
<element name="InstalledApp" positionX="-63" positionY="0" width="128" height="224"/>
|
<element name="InstalledApp" positionX="-63" positionY="0" width="128" height="253"/>
|
||||||
<element name="InstalledExtension" positionX="-45" positionY="135" width="128" height="163"/>
|
<element name="InstalledExtension" positionX="-45" positionY="135" width="128" height="163"/>
|
||||||
<element name="NewsItem" positionX="-45" positionY="126" width="128" height="238"/>
|
<element name="NewsItem" positionX="-45" positionY="126" width="128" height="238"/>
|
||||||
<element name="PatreonAccount" positionX="-45" positionY="117" width="128" height="105"/>
|
<element name="PatreonAccount" positionX="-45" positionY="117" width="128" height="105"/>
|
||||||
|
|||||||
@@ -40,6 +40,7 @@ public class InstalledApp: NSManagedObject, InstalledAppProtocol
|
|||||||
@NSManaged public var installedDate: Date
|
@NSManaged public var installedDate: Date
|
||||||
|
|
||||||
@NSManaged public var isActive: Bool
|
@NSManaged public var isActive: Bool
|
||||||
|
@NSManaged public var needsResign: Bool
|
||||||
|
|
||||||
@NSManaged public var certificateSerialNumber: String?
|
@NSManaged public var certificateSerialNumber: String?
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user