From 1582d1b143f9400f9ab3ef50c6b962dd239e57dd Mon Sep 17 00:00:00 2001 From: Riley Testut Date: Sat, 16 May 2020 11:42:31 -0700 Subject: [PATCH] Fixes updating App IDs with no app groups --- .../FetchProvisioningProfilesOperation.swift | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/AltStore/Operations/FetchProvisioningProfilesOperation.swift b/AltStore/Operations/FetchProvisioningProfilesOperation.swift index 239faf2d..a7bdb49d 100644 --- a/AltStore/Operations/FetchProvisioningProfilesOperation.swift +++ b/AltStore/Operations/FetchProvisioningProfilesOperation.swift @@ -362,7 +362,17 @@ extension FetchProvisioningProfilesOperation entitlements[key] = value } - guard let applicationGroups = entitlements[.appGroups] as? [String] else { return completionHandler(.success(appID)) } + let applicationGroups = 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)) + } + } // Dispatch onto global queue to prevent appGroupsLock deadlock. DispatchQueue.global().async {