昨天我尝试在 iOS 7 中使用 Private API,但它不起作用。以下调用适用于 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]);
在 iOS 7 中使用此代码片段时,它会返回一个空指针。框架、类和方法仍然存在(点击我)。对我的问题有任何想法吗?是否有额外的安全层使其不再可能在 iOS 7 中调用私有 API?
谢谢!