From 7a547c70e3ad0cda323bfa48e692da2dfe6b1283 Mon Sep 17 00:00:00 2001 From: Riley Testut Date: Tue, 29 Mar 2022 19:51:54 -0700 Subject: [PATCH] =?UTF-8?q?[AltServer]=20Fixes=20=E2=80=9CApp=20Group=20do?= =?UTF-8?q?es=20not=20exist=E2=80=9D=20error?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Devices/ALTDeviceManager+Installation.swift | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/AltServer/Devices/ALTDeviceManager+Installation.swift b/AltServer/Devices/ALTDeviceManager+Installation.swift index d89a2e88..a0c70667 100644 --- a/AltServer/Devices/ALTDeviceManager+Installation.swift +++ b/AltServer/Devices/ALTDeviceManager+Installation.swift @@ -668,16 +668,10 @@ private extension ALTDeviceManager func updateAppGroups(for appID: ALTAppID, app: ALTApplication, team: ALTTeam, session: ALTAppleAPISession, completionHandler: @escaping (Result) -> Void) { - let applicationGroups = app.entitlements[.appGroups] as? [String] ?? [] - if applicationGroups.isEmpty - { - guard let isAppGroupsEnabled = appID.features[.appGroups] as? Bool, isAppGroupsEnabled else { - // No app groups, and we also haven't enabled the feature, so don't continue. - // For apps with no app groups but have had the feature enabled already - // we'll continue and assign the app ID to an empty array - // in case we need to explicitly remove them. - return completionHandler(.success(appID)) - } + guard let applicationGroups = app.entitlements[.appGroups] as? [String], !applicationGroups.isEmpty else { + // Assigning an App ID to an empty app group array fails, + // so just do nothing if there are no app groups. + return completionHandler(.success(appID)) } // Dispatch onto global queue to prevent appGroupsSemaphore deadlock.