Yesterday I tried to use Private API within iOS 7 but it doesn't work. The following calls works fine with iOS 6:
1. NSBundle *b = [NSBundle bundleWithPath:@"/System/Library/PrivateFrameworks/AppleAccount.framework"];
2. BOOL success = [b load];
3.
4. Class AADeviceInfo = NSClassFromString(@"AADeviceInfo");
6.
7. NSLog(@"-- serialNumber: %@", [AADeviceInfo serialNumber]);
8. NSLog(@"-- udid: %@", [AADeviceInfo udid]);
When using this code snippet within iOS 7 it returns a null pointer. The framework, class and methods still exists (click me). Any idea for my problem? Is there an additional layer of security that makes it no longer possible to call private API within iOS 7?
Thank you!
In most cases, such behavior means this API became protected by an entitlement. This is a authorization method used across iOS. Most of API's call out of process server. And this server may check whether a client has some specific entitlement. Entitlements are available only for system apps and 3rd party apps on jailbroken iOS.
There is no simple way to check whether the server requires entitlement. However, sometimes it writes in the console something like "Hey... You need entitlement X to call API Y". However, most of the time, it fails silently.
If you really wants to check this, you will have to disassemble framework to see which server does it use and disassemble server and find implementation of this API.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With