From 3b9d49d34b301ab57ca2de2d6971f5ca5029cc6c Mon Sep 17 00:00:00 2001 From: "Jay Freeman (saurik)" Date: Sun, 29 Sep 2013 00:26:51 +0000 Subject: [PATCH] iOS 7 uiduid (use MobileGestalt instead of UIKit). --- uiduid.mm | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/uiduid.mm b/uiduid.mm index ab3bf27..690bf51 100644 --- a/uiduid.mm +++ b/uiduid.mm @@ -41,10 +41,18 @@ #import #include +#include + int main(int argc, char *argv[]) { NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - printf("%s\n", [[[UIDevice currentDevice] uniqueIdentifier] UTF8String]); + NSString *udid; + if (kCFCoreFoundationVersionNumber < 800) + udid = [[UIDevice currentDevice] uniqueIdentifier]; + else + udid = [reinterpret_cast(dlsym(dlopen("/usr/lib/libMobileGestalt.dylib", RTLD_GLOBAL | RTLD_LAZY), "MGCopyAnswer"))(@"UniqueDeviceID") autorelease]; + + printf("%s\n", [udid UTF8String]); [pool release]; return 0; -- 2.45.2