diff --git a/Sources/CAltSign/Apple API/ALTAppleAPI.m b/Sources/CAltSign/Apple API/ALTAppleAPI.m index f196d74..e522576 100644 --- a/Sources/CAltSign/Apple API/ALTAppleAPI.m +++ b/Sources/CAltSign/Apple API/ALTAppleAPI.m @@ -427,10 +427,21 @@ - (void)updateAppID:(ALTAppID *)appID team:(ALTTeam *)team session:(ALTAppleAPIS { parameters[feature] = appID.features[feature]; } + + NSMutableDictionary *entitlementss = [appID.entitlements mutableCopy]; + if (team.type == ALTTeamTypeFree) { + for (ALTEntitlement entitlement in appID.entitlements) + { + if (!ALTFreeDeveloperCanUseEntitlement(entitlement)) + { + [entitlementss removeObjectForKey:entitlement]; + } + } + } // parameters[@"capabilities"] = @[ALTCapabilityIncreasedMemoryLimit, ALTCapabilityIncreasedDebuggingMemoryLimit, ALTCapabilityExtendedVirtualAddressing]; - [parameters setObject:appID.entitlements forKey:@"entitlements"]; + [parameters setObject:entitlementss forKey:@"entitlements"]; [self sendRequestWithURL:URL additionalParameters:parameters session:session team:team completionHandler:^(NSDictionary *responseDictionary, NSError *requestError) { if (responseDictionary == nil) diff --git a/Sources/CAltSign/Capabilities/ALTCapabilities.h b/Sources/CAltSign/Capabilities/ALTCapabilities.h index 6aca1f6..76b9e9c 100644 --- a/Sources/CAltSign/Capabilities/ALTCapabilities.h +++ b/Sources/CAltSign/Capabilities/ALTCapabilities.h @@ -36,5 +36,6 @@ extern ALTFeature const ALTFeatureInterAppAudio; _Nullable ALTEntitlement ALTEntitlementForFeature(ALTFeature feature) NS_SWIFT_NAME(ALTEntitlement.init(feature:)); _Nullable ALTFeature ALTFeatureForEntitlement(ALTEntitlement entitlement) NS_SWIFT_NAME(ALTFeature.init(entitlement:)); +bool ALTFreeDeveloperCanUseEntitlement(ALTEntitlement entitlement); NS_ASSUME_NONNULL_END diff --git a/Sources/CAltSign/Capabilities/ALTCapabilities.m b/Sources/CAltSign/Capabilities/ALTCapabilities.m index 057ac12..6ddbfcc 100644 --- a/Sources/CAltSign/Capabilities/ALTCapabilities.m +++ b/Sources/CAltSign/Capabilities/ALTCapabilities.m @@ -43,6 +43,38 @@ _Nullable ALTEntitlement ALTEntitlementForFeature(ALTFeature feature) return nil; } +bool ALTFreeDeveloperCanUseEntitlement(ALTEntitlement entitlement) { + if ([entitlement isEqualToString:ALTEntitlementAppGroups]) + { + return true; + } + else if ([entitlement isEqualToString:ALTEntitlementInterAppAudio]) + { + return true; + } + else if ([entitlement isEqualToString:ALTEntitlementGetTaskAllow]) + { + return true; + } + else if ([entitlement isEqualToString:ALTEntitlementIncreasedMemoryLimit]) + { + return true; + } + else if ([entitlement isEqualToString:ALTEntitlementTeamIdentifier]) + { + return true; + } + else if ([entitlement isEqualToString:ALTEntitlementKeychainAccessGroups]) + { + return true; + } + else if ([entitlement isEqualToString:ALTEntitlementApplicationIdentifier]) + { + return true; + } + return true; +} + _Nullable ALTFeature ALTFeatureForEntitlement(ALTEntitlement entitlement) { if ([entitlement isEqualToString:ALTEntitlementAppGroups])