#include <netdb.h>
#include <arpa/inet.h>
+#include <dlfcn.h>
#include <lockdown.h>
#include <CoreFoundation/CoreFoundation.h>
#include <CoreServices/CoreServices.h>
CFRelease(plist);
}
+ if (UniqueID_ == NULL)
+ if (void *libMobileGestalt = dlopen("/usr/lib/libMobileGestalt.dylib", RTLD_GLOBAL | RTLD_LAZY))
+ if (CFStringRef (*$MGCopyAnswer)(CFStringRef) = (CFStringRef (*)(CFStringRef)) dlsym(libMobileGestalt, "MGCopyAnswer"))
+ UniqueID_ = $MGCopyAnswer(CFSTR("UniqueDeviceID"));
+
+ if (UniqueID_ == NULL)
if (void *lockdown = lockdown_connect()) {
UniqueID_ = lockdown_copy_value(lockdown, NULL, kLockdownUniqueDeviceIDKey);
lockdown_disconnect(lockdown);