Skip to content

Instantly share code, notes, and snippets.

@theiostream
Created July 10, 2012 01:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save theiostream/3080494 to your computer and use it in GitHub Desktop.
Save theiostream/3080494 to your computer and use it in GitHub Desktop.
Get UDID from liblockdown
## Uses theos.
include theos/makefiles/common.mk
TOOL_NAME = uiduid2
uiduid2_FILES = main.mm
uiduid2_LDFLAGS = -llockdown
include $(THEOS_MAKE_PATH)/tool.mk
#import <Foundation/Foundation.h>
#import <CoreFoundation/CoreFoundation.h>
#import <liblockdown.h>
#include <stdio.h>
int main(int argc, char *argv[]) {
// FIXME: Do we need a NSAutoreleasePool here?
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
LockdownConnectionRef connection = lockdown_connect();
CFStringRef udid = (CFStringRef)lockdown_copy_value(connection, NULL, kLockdownUniqueDeviceIDKey);
CFShow(udid);
lockdown_disconnect(connection);
[pool drain];
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment