Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS 7 Private API usage

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!

like image 694
MrCoinSiX Avatar asked Sep 15 '13 07:09

MrCoinSiX


1 Answers

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.

like image 55
Victor Ronin Avatar answered Sep 24 '22 08:09

Victor Ronin