mirror of
https://github.com/SideStore/SideStore.git
synced 2026-02-12 16:23:32 +01:00
Removes support for “background mode” permissions
This commit is contained in:
@@ -206,7 +206,7 @@ private extension VerificationError
|
||||
guard let permissions, !permissions.isEmpty else { return nil }
|
||||
|
||||
let permissionsByType = Dictionary(grouping: permissions) { $0.type }
|
||||
let permissionSections = [ALTAppPermissionType.entitlement, .privacy, .backgroundMode].compactMap { (type) -> String? in
|
||||
let permissionSections = [ALTAppPermissionType.entitlement, .privacy].compactMap { (type) -> String? in
|
||||
guard let permissions = permissionsByType[type] else { return nil }
|
||||
|
||||
// "Privacy:"
|
||||
|
||||
@@ -166,15 +166,10 @@ private extension FetchSourceOperation
|
||||
versions.insert(version.versionID)
|
||||
}
|
||||
|
||||
for permission in app.permissions
|
||||
for permission in app.permissions where permission.type == .privacy
|
||||
{
|
||||
switch permission.type
|
||||
{
|
||||
case .privacy, .backgroundMode:
|
||||
guard permission.usageDescription != nil else { throw SourceError.missingPermissionUsageDescription(for: permission.permission, app: app, source: source) }
|
||||
|
||||
default: break
|
||||
}
|
||||
// Privacy permissions MUST have a usage description.
|
||||
guard permission.usageDescription != nil else { throw SourceError.missingPermissionUsageDescription(for: permission.permission, app: app, source: source) }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -209,20 +209,6 @@ private extension VerifyAppOperation
|
||||
allEntitlements = allEntitlements.filter { !ALTEntitlement.ignoredEntitlements.contains($0) }
|
||||
|
||||
|
||||
// Background Modes
|
||||
// App extensions can't have background modes, so don't need to worry about them.
|
||||
let allBackgroundModes: Set<ALTAppBackgroundMode>
|
||||
if let backgroundModes = app.bundle.infoDictionary?[Bundle.Info.backgroundModes] as? [String]
|
||||
{
|
||||
let backgroundModes = backgroundModes.lazy.map { ALTAppBackgroundMode($0) }
|
||||
allBackgroundModes = Set(backgroundModes)
|
||||
}
|
||||
else
|
||||
{
|
||||
allBackgroundModes = []
|
||||
}
|
||||
|
||||
|
||||
// Privacy
|
||||
let allPrivacyPermissions: Set<ALTAppPrivacyPermission>
|
||||
if #available(iOS 16, *)
|
||||
@@ -262,7 +248,7 @@ private extension VerifyAppOperation
|
||||
|
||||
// Verify permissions.
|
||||
let sourcePermissions: Set<AnyHashable> = Set(await $storeApp.perform { $0.permissions.map { AnyHashable($0.permission) } })
|
||||
let localPermissions: [any ALTAppPermission] = Array(allEntitlements) + Array(allBackgroundModes) + Array(allPrivacyPermissions)
|
||||
let localPermissions: [any ALTAppPermission] = Array(allEntitlements) + Array(allPrivacyPermissions)
|
||||
|
||||
// To pass: EVERY permission in localPermissions must also appear in sourcePermissions.
|
||||
// If there is a single missing permission, throw error.
|
||||
|
||||
Reference in New Issue
Block a user