How to use ldid?

1) Using ldid -S is the correct usage. Not lowercase (-s). 2) Usually, when I get this error, it’s because I built my app with the wrong architectures. Most older versions of ldid that I’ve used cannot sign fat binaries (but see Update below). Fat binaries are ones with more than one architecture inside. For … Read more

IOS Jailbreak How do intercept SMS / Text Messages

This code snippet should intercept SMS messages- You can extend it for other kinds of notifications. Will work on iOS 5.0.1 as well. Does not work with iMessages though. Link with CoreTelephony framework (there are bunch of private headers there which you’d can class-dump) #include <dlfcn.h> #define CORETELPATH “/System/Library/PrivateFrameworks/CoreTelephony.framework/CoreTelephony” id(*CTTelephonyCenterGetDefault)(); void (*CTTelephonyCenterAddObserver) (id,id,CFNotificationCallback,NSString*,void*,int); static void … Read more

Return a list of running background apps/processes in iOS

Make a sysctl API and retrieve the kinfo_proc structure http://fxr.watson.org/fxr/source/sys/kinfo.h?v=DFBSD. This struct has information about running processes.You can run it in a loop until to get info about all processes. Here is a code snippet- extend it to get info of all processes mib[0] = CTL_KERN; mib[1] = KERN_PROC; mib[2] = KERN_PROC_ALL; mib[3] = 0; … Read more

Detect screen on/off from iOS service

You can use Darwin notifications, to listen for the events. I’m not 100% sure, but it looks to me, from running on a jailbroken iOS 5.0.1 iPhone 4, that one of these events might be what you need: com.apple.iokit.hid.displayStatus com.apple.springboard.hasBlankedScreen com.apple.springboard.lockstate Update: also, the following notification is posted when the phone locks (but not when … Read more

Send programmatically SMS on jailbreak device

Found out why – (BOOL)sendSMSWithText:(id)arg1 serviceCenter:(id)arg2 toAddress:(id)arg3; is not working since iOS 6. This API is protected by the entitlement com.apple.CommCenter.Messages-send. Just sign your app with this entitlement set to true. It’s much better than my another answer here (XPC method) because of the two main reasons: sendSMSWithText tells you whethere message was sent successfully … Read more

iOS touch event notifications (private API)

You can use the IOHID stuff in IOKit to get the x, y coordinates. #include <IOHIDEventSystem.h> create IOHIDEventSystemClient: void *ioHIDEventSystem = IOHIDEventSystemClientCreate(kCFAllocatorDefault); register callback: IOHIDEventSystemClientScheduleWithRunLoop(ioHIDEventSystem, CFRunLoopGetCurrent(), kCFRunLoopDefaultMode); IOHIDEventSystemClientRegisterEventCallback(ioHIDEventSystem, handle_event, NULL, NULL); unregister callback: IOHIDEventSystemClientUnregisterEventCallback(ioHIDEventSystem, handle_event, NULL, NULL); IOHIDEventSystemClientUnscheduleWithRunLoop(ioHIDEventSystem, CFRunLoopGetCurrent(), kCFRunLoopDefaultMode); callback: void handle_event (void* target, void* refcon, IOHIDServiceRef service, IOHIDEventRef event) { if (IOHIDEventGetType(event)==kIOHIDEventTypeDigitizer){ IOHIDFloat … Read more

Once jailbroken, will iOS apps run with root privilege?

Not disagreeing with anything H2CO3 said, but to add some further clarification … Apps installed in /private/var/mobile/Applications/(†) with Xcode will run with user mobile privileges, even on jailbroken phones. Even on a jailbroken phone, apps installed to /private/var/mobile/Applications/(†) will be sandboxed almost (&ddagger;) like apps on a jailed phone. So, no reading other (normal) apps’ … Read more

Is there any way to determine if the iphone is roaming?

There is! It’s not documented at all, and I highly doubt this would work on a non-jailbroken phone (as it requires using files not in the sandbox). However, here is how it is done. The iPhone file system keeps two softlinks: static NSString *carrierPListSymLinkPath = @”/var/mobile/Library/Preferences/com.apple.carrier.plist”; static NSString *operatorPListSymLinkPath = @”/var/mobile/Library/Preferences/com.apple.operator.plist”; when these links are … Read more