From 18612495b3eb9679b6540a001675a0da82ce1a2c Mon Sep 17 00:00:00 2001 From: opa334 Date: Tue, 28 Nov 2023 12:24:10 +0100 Subject: [PATCH] Also update app info to be more accurate in terms of com.apple.private.security.container-required --- TrollStore/TSAppInfo.m | 31 ++++++++++++++++++++++++++----- 1 file changed, 26 insertions(+), 5 deletions(-) diff --git a/TrollStore/TSAppInfo.m b/TrollStore/TSAppInfo.m index 4a2f9ff..4f09232 100644 --- a/TrollStore/TSAppInfo.m +++ b/TrollStore/TSAppInfo.m @@ -849,17 +849,38 @@ extern UIImage* imageWithSize(UIImage* image, CGSize size); __block NSMutableArray* accessibleContainers = [NSMutableArray new]; //array by design, should be ordered if(!unrestrictedContainerAccess) { - [self enumerateAllInfoDictionaries:^(NSString *key, NSObject *value, BOOL *stop) { - if([key isEqualToString:@"CFBundleIdentifier"]) + __block NSString *dataContainer = nil; + + // If com.apple.private.security.container-required Entitlement is a string, prefer it to CFBundleIdentifier + [self enumerateAllEntitlements:^(NSString *key, NSObject *value, BOOL *stop) { + if([key isEqualToString:@"com.apple.private.security.container-required"]) { - NSString* valueStr = (NSString*)value; - if([valueStr isKindOfClass:NSString.class]) + NSString* valueString = (NSString*)value; + if(valueString && [valueString isKindOfClass:NSString.class]) { - [accessibleContainers addObject:valueStr]; + dataContainer = valueString; } } }]; + // Else take CFBundleIdentifier + if (!dataContainer) { + [self enumerateAllInfoDictionaries:^(NSString *key, NSObject *value, BOOL *stop) { + if([key isEqualToString:@"CFBundleIdentifier"]) + { + NSString* valueStr = (NSString*)value; + if([valueStr isKindOfClass:NSString.class]) + { + dataContainer = valueStr; + } + } + }]; + } + + if (dataContainer) { + [accessibleContainers addObject:dataContainer]; + } + [self enumerateAllEntitlements:^(NSString *key, NSObject *value, BOOL *stop) { if([key isEqualToString:@"com.apple.developer.icloud-container-identifiers"] || [key isEqualToString:@"com.apple.security.application-groups"] || [key isEqualToString:@"com.apple.security.system-groups"])