nst/iOS-Runtime-Headers

How to access device serial number?

FahadAHussain opened this issue · 4 comments

Tried using AppleAccount.framework/AADeviceInfo.h class but it returns null for Serial Number.
Any idea?

NSBundle *b = [NSBundle bundleWithPath:@"/System/Library/PrivateFrameworks/AppleAccount.framework"];
BOOL success = [b load];

Class FTDeviceSupport = NSClassFromString(@"AADeviceInfo");
id si = [FTDeviceSupport valueForKey:@"serialNumber"];

AFAIK since 8.3 apple has disable access to the hardware identifiers. All methods to get UDID, IMEI, MAC Addresses... etc will result in getting a null response.

The only way to get access is to add com.apple.private.MobileGestalt.AllowedProtectedKeys to your application entitlements, while you can do that easily it won't be valid as your provisioning profile needs it as well and good luck getting apple to sign it...

How can add com.apple.private.MobileGestalt.AllowedProtectedKeys to your application entitlements?

I'm see on ALTERNATE_PERMISSIONS_FILES in Project/Capabilities but can't add any string to it

OK. I found that it in Appname.entitlements plist file. And add keys. But now can signed app to my device.

The entitlements specified in your application’s Code Signing Entitlements file are invalid, not permitted, or do not match those specified in your provisioning profile. (0xE8008016).

How I can signed my app?

So, any solutions for that questions ?

  1. UDID, IMEI, MAC Addresses... etc
  2. The entitlements specified in your application’s Code Signing Entitlements file are invalid, not permitted, or do not match those specified in your provisioning profile