`-containerURLForSecurityApplicationGroupIdentifier:` returns nil for a few users

Originator:help.you.i.can
Number:rdar://24882556 Date Originated:2016-02-29
Status:Closed Resolved:More or less
Product:iOS Product Version:iOS 8, iOS 9
Classification:Other Bug Reproducible:Unable
 
Filing this as bug report after following up with Apple DTS:

I have an app in the store that uses the directory returned by `-containerURLForSecurityApplicationGroupIdentifier:` for certain data. This works well and the app is live, I'm throwing an exception in case this method returns nil.

Now I've got a couple of crash reports, stemming from my exception, meaning for a few users (15 of ~70k) this method returns nil. According to Crashlytics, about ⅓ of these users have a jailbreak. I'm not sure if the other ⅔ also have a jailbreak but Crashlytics doesn't detect it.

## Steps to reproduce:

The exception in question:

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    NSURL *shared = [[NSFileManager defaultManager] containerURLForSecurityApplicationGroupIdentifier:kMCSharedGroupUserData];
    if (!shared) {
        [[NSException exceptionWithName:@"MCSharedGroupUserDataNotAvailable" reason:@"The container URL for shared group user data is not available" userInfo:nil] raise];
    }
}

Comments

That's about right; haven't seen it recently and only with jailbreaks. Apple responded and confirmed this shouldn't happen, code is correct.

By help.you.i.can at Aug. 5, 2016, 11:42 p.m. (reply...)

Same crash happens for me

I see same crash. I see a pattern that this happens on iPhone 6 using iOS8.1 and iOS8.1.2 (not jailbroken), but I even a few crashes on jailbroken iPhone 5c.


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!