2

I have code that is working fine till 7.0.6 to obtain IMEI on Jailbreak iPhone. But now I am getting null IMEI on my new iPhone 4S with iOS 7.1.2.

I have used com.apple.coretelephony.Identity.get entitlement and signing app with ldid. I am using Xcode 5.1.1.

Do I have to use any additional entitlement or something like that to obtain IMEI. Any suggestion or guide will highly appreciated Thanks

Community
  • 1
  • 1
Ahad Khan
  • 411
  • 2
  • 18
  • I have same problem and not find any suggestion. – ali shekari Aug 12 '14 at 13:01
  • 1
    Here it is http://stackoverflow.com/questions/16667988/how-to-get-imei-on-iphone-5/16677043#16677043 – creker Aug 14 '14 at 09:46
  • Tried on my 7.1.2 5S - works. `com.apple.coretelephony.Identity.get` is the only entitlement it needs. – creker Sep 03 '14 at 14:02
  • Its working on my iPhone 4 with 7.0.6 but doesn't work on 7.1.2 4S. – Ahad Khan Sep 03 '14 at 18:11
  • Any clue on this. Even i have the same issue. – Zac24 Sep 04 '14 at 20:38
  • Could you please upload preferences app binary from the phone that's not showing IMEI? Maybe there're new entilements. Otherwise I can't help you - on my 7.1.2 5S it works, the CoreTelephony one at least. – creker Sep 09 '14 at 00:58
  • @creker here is link of preferences app binary. https://www.dropbox.com/s/8oi66ljtkbcf3bh/Preferences?dl=0 – Ahad Khan Sep 09 '14 at 05:11
  • No, nothing new. I suggest you try to sign your app with every entitlement there is inside preferences binary (open it with text editor, at the end will be plist will entitlements). Also, which one of the solutions doesn't work? I use only CoreTelephony one. – creker Sep 09 '14 at 07:55
  • @creker I have used **UIDevice-IOKitExtensions** mentioned in question http://stackoverflow.com/questions/16667988/how-to-get-imei-on-iphone-5/16677043#16677043. I have tried CoreTelephony, gonna try it once again ll update you. Many Thanks – Ahad Khan Sep 09 '14 at 09:46
  • @creker In CoreTelephony solution it says use of undeclared identifier on this line. _CTServerConnectionCopyMobileEquipmentInfo(&result, connection, &info); – Ahad Khan Sep 09 '14 at 10:27
  • Read about Private APIs, how they work and how to use them. There's plenty of info. CoreTelephony solution works. – creker Sep 09 '14 at 10:45
  • @creaker I do have CoreTelephony.h header file. But this method is not declare there. If You can provide me the declaration of this method _CTServerConnectionCopyMobileEquipmentInfo(&result, connection, &info); – Ahad Khan Sep 09 '14 at 10:56
  • https://github.com/RayZhang/EquipmentInfo/blob/master/UIDevice%2BCoreTelephonyCategory.m – creker Sep 09 '14 at 13:50

1 Answers1

0

You can use libMobileGestalt which is the easiest way to do that.

just write this line after the import statement

OBJC_EXTERN CFStringRef MGCopyAnswer(CFStringRef key) WEAK_IMPORT_ATTRIBUTE;

then you can get the IMEI with

CFStringRef kMGInternationalMobileEquipmentIdentity = MGCopyAnswer(CFSTR("InternationalMobileEquipmentIdentity"));

And if you want to convert it to NSString..

NSString *IMEI = [NSString stringWithFormat:@"%@",kMGInternationalMobileEquipmentIdentity];

Hope it helps

V9Zeros
  • 206
  • 4
  • 9