[AltServer] Fixes “App Group does not exist” error

This commit is contained in:
Riley Testut
2022-03-29 19:51:54 -07:00
parent b0abf0e7a5
commit 7a547c70e3

View File

@@ -668,16 +668,10 @@ private extension ALTDeviceManager
func updateAppGroups(for appID: ALTAppID, app: ALTApplication, team: ALTTeam, session: ALTAppleAPISession, completionHandler: @escaping (Result<ALTAppID, Error>) -> 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.