ios - How to get IMEI on iPhone 5 -
i'm develop application jailbroken ios devices. use https://github.com/erica/uidevice-extension/blob/master/uidevice-iokitextensions.m imei, on iphone 5 solution not work(return empty string). there way imei on iphone 5(ios 6.1.2)?
there several ways imei on newer devices
1) private managedconfiguration.framework
cfstringref mcctimei()
2) coretelephony.framework
struct ctresult { int flag; int a; }; extern cfstringref kctmobileequipmentinfoimei; void *connection = _ctserverconnectioncreate(kcfallocatordefault, null, null); nsdictionary *info = nil; struct ctresult result; _ctserverconnectioncopymobileequipmentinfo(&result, connection, &info); [info autorelease]; cfrelease(connection); nsstring* imei = (nsstring*)info[(nsstring*)kctmobileequipmentinfoimei];
3) liblockdown.dylib
extern cfstringref klockdownimeikey; void* connection = lockdown_connect(); nsstring* imei = [(nsstring*)lockdown_copy_value(connection, null, klockdownimeikey) autorelease]; lockdown_disconnect(connection);
i had problems mcctimei
- returned empty imei after device start-up. i'm using coretelephony solution, never had problem it.
update
on ios 7 these apis protected com.apple.coretelephony.identity.get
entitlement. access imei (imsi, phone number , other info) need sign entitlement boolean value set true.
Comments
Post a Comment