Disables app group feature if app has no app groups

We can’t remove all app groups from an App ID once one has been assigned, but we _can_ disable app groups completely for effectively the same result.

This fixes some apps having permanant access to AltStore’s own app group after being (de-)activated.
This commit is contained in:
Riley Testut
2022-03-31 12:50:50 -07:00
parent 7a547c70e3
commit a04a27c1e3
2 changed files with 22 additions and 0 deletions

View File

@@ -320,8 +320,14 @@ extension FetchProvisioningProfilesOperation
if let applicationGroups = entitlements[.appGroups] as? [String], !applicationGroups.isEmpty
{
// App uses app groups, so assign `true` to enable the feature.
features[.appGroups] = true
}
else
{
// App has no app groups, so assign `false` to disable the feature.
features[.appGroups] = false
}
var updateFeatures = false
@@ -333,6 +339,11 @@ extension FetchProvisioningProfilesOperation
// AppID already has this feature enabled and the values are the same.
continue
}
else if appID.features[feature] == nil, let shouldEnableFeature = value as? Bool, !shouldEnableFeature
{
// AppID doesn't already have this feature enabled, but we want it disabled anyway.
continue
}
else
{
// AppID either doesn't have this feature enabled or the value has changed,