mirror of
https://github.com/SideStore/SideStore.git
synced 2026-02-16 10:13:27 +01:00
Adds additional checks before considering apps deleted
This commit is contained in:
@@ -72,6 +72,8 @@ extension AppManager
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
guard !self.isActivelyManagingApp(withBundleID: app.bundleIdentifier) else { continue }
|
||||||
|
|
||||||
let uti = UTTypeCopyDeclaration(app.installedAppUTI as CFString)?.takeRetainedValue() as NSDictionary?
|
let uti = UTTypeCopyDeclaration(app.installedAppUTI as CFString)?.takeRetainedValue() as NSDictionary?
|
||||||
if uti == nil && !legacySideloadedApps.contains(app.bundleIdentifier)
|
if uti == nil && !legacySideloadedApps.contains(app.bundleIdentifier)
|
||||||
{
|
{
|
||||||
@@ -103,7 +105,7 @@ extension AppManager
|
|||||||
let resourceValues = try appDirectory.resourceValues(forKeys: [.isDirectoryKey, .nameKey])
|
let resourceValues = try appDirectory.resourceValues(forKeys: [.isDirectoryKey, .nameKey])
|
||||||
guard let isDirectory = resourceValues.isDirectory, let bundleID = resourceValues.name else { continue }
|
guard let isDirectory = resourceValues.isDirectory, let bundleID = resourceValues.name else { continue }
|
||||||
|
|
||||||
if isDirectory && !installedAppBundleIDs.contains(bundleID) && !self.installationProgress.keys.contains(bundleID)
|
if isDirectory && !installedAppBundleIDs.contains(bundleID) && !self.isActivelyManagingApp(withBundleID: bundleID)
|
||||||
{
|
{
|
||||||
print("DELETING CACHED APP:", bundleID)
|
print("DELETING CACHED APP:", bundleID)
|
||||||
try FileManager.default.removeItem(at: appDirectory)
|
try FileManager.default.removeItem(at: appDirectory)
|
||||||
@@ -386,6 +388,12 @@ private extension AppManager
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func isActivelyManagingApp(withBundleID bundleID: String) -> Bool
|
||||||
|
{
|
||||||
|
let isActivelyManaging = self.installationProgress.keys.contains(bundleID) || self.refreshProgress.keys.contains(bundleID)
|
||||||
|
return isActivelyManaging
|
||||||
|
}
|
||||||
|
|
||||||
@discardableResult
|
@discardableResult
|
||||||
private func perform(_ operations: [AppOperation], presentingViewController: UIViewController?, group: RefreshGroup) -> RefreshGroup
|
private func perform(_ operations: [AppOperation], presentingViewController: UIViewController?, group: RefreshGroup) -> RefreshGroup
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user