The private SpringboardServices structure has a private SBDataReset API. He wipes all the data.
You can check the following code , for example, how to use it.
An application using this API must be allowed to use "com.apple.springboard.wipedevice".
BTW. Another alternative is to use the MDM protocol. He has a cleaning team. However, this requires more mechanisms (MDM server, user registration).
Update 1
Looks like the sample code is missing from the link. I looked at Preferences and a couple of other pieces of iOS software that uses SBDataReset, and it looks like a new argument has been introduced into SBDataReset.
Try using the following code (sorry, I donโt have a jailbroken iOS device right now, so I canโt try it myself)
#import <UIKit/UIKit.h> #import <UIKit/UIApplication.h> #include <dlfcn.h> #include <stdio.h> // Framework Paths #define SBSERVPATH "/System/Library/PrivateFrameworks/SpringBoardServices.framework/SpringBoardServices" #define UIKITPATH "/System/Library/Framework/UIKit.framework/UIKit" #define WIPE_MODE_NORMAL 4 int main(int argc, char **argv) { NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; // Fetch the SpringBoard server port mach_port_t *p; void *uikit = dlopen(UIKITPATH, RTLD_LAZY); int (*SBSSpringBoardServerPort)() = dlsym(uikit, "SBSSpringBoardServerPort"); p = SBSSpringBoardServerPort(); dlclose(uikit); // Getting DataReset proc void *sbserv = dlopen(SBSERVPATH, RTLD_LAZY); int (*dataReset)(mach_port_t* port, int wipeMode) = dlsym(sbserv, "SBDataReset"); dataReset(p, WIPE_MODE_NORMAL); dlclose(sbserv); [pool release]; }
Note that there is a second parameter for the SBDataReset function.
It appears that 4 is the normal cleaning mode, and 6 is the brick cleaning mode.
DISCLAIMER This code is provided AS IS. I have no idea what will happen if the device is wiped in brick mode.
source share