Last active
August 29, 2015 14:00
-
-
Save nickdowell/759b51097e2f2e72daed to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NSData *data = [NSData dataWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"embedded" ofType:@"mobileprovision"]]; | |
const char *ptr = [data bytes], *start = NULL, *end = NULL; | |
for (size_t i = 0; i < [data length] - 8; i++) { | |
if (memcmp(ptr + i, "<plist", 6) == 0) { | |
start = ptr + i; | |
} | |
if (memcmp(ptr + i, "</plist>", 8) == 0) { | |
end = ptr + i + 8; | |
} | |
} | |
NSData *plistData = [data subdataWithRange:NSMakeRange(start - ptr, end - start)]; | |
NSDictionary *plist = [NSPropertyListSerialization propertyListWithData:plistData options:0 format:NULL error:NULL]; | |
NSLog(@"Entitlements = %@", [plist objectForKey:@"Entitlements"]); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment