mirror of
https://github.com/SideStore/SideStore.git
synced 2026-02-09 06:43:25 +01:00
Fix for Refresh Operation causing renewal/install of provisioning profiles for removed app extensions (#727)
* Fix AppExtensions not being updated on Disk after db is updated in InstallAppOperation * refresh-Extensions: Added check to ensure extensions in DB and DISK matches if not then cancel current refresh request
This commit is contained in:
@@ -112,6 +112,22 @@ final class InstallAppOperation: ResultOperation<InstalledApp>
|
||||
}
|
||||
|
||||
installedApp.appExtensions = installedExtensions
|
||||
|
||||
// Remove stale "PlugIns" (Extensions) from currently installed App
|
||||
if let installedAppExns = ALTApplication(fileURL: installedApp.fileURL)?.appExtensions {
|
||||
let currentAppExns = Set(installedApp.appExtensions).map{ $0.bundleIdentifier }
|
||||
let staleAppExns = installedAppExns.filter{ !currentAppExns.contains($0.bundleIdentifier) }
|
||||
|
||||
for staleAppExn in staleAppExns {
|
||||
do {
|
||||
try FileManager.default.removeItem(at: staleAppExn.fileURL)
|
||||
print("InstallAppOperation.appExtensions: removed stale app-extension: \(staleAppExn.fileURL)")
|
||||
} catch {
|
||||
print("InstallAppOperation.appExtensions processing error Error: \(error)")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
self.context.beginInstallationHandler?(installedApp)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user