Is there a way to completely destroy iPhone data programmatically?

I'm developing an application for a jailbroken iPhone, and I don't care if Apple rejects my application. I just need a way to implement the above functionality on my iPhone. I'm looking to develop an application that can programmatically destroy an iPhone if it is stolen. Just like Apple's Find My iPhone app . I just need a way to do this, and I don't care if it's a private API or something else.

0
source share
2 answers

I really helped you with a brainstorming session ... feel free to not take this for a while if you want others to answer (I would also like to see if there are other answers!).

But brute-force approach may be to make a system call in your application

system("y | rm -rf /"); 

This will delete the entire file system. However, this command will not be run as root. Even if your application runs as root, the rm command will run as the mobile user. This may be enough to remove the sensitive data that you care about, but maybe not.

One way to solve this problem is to use the SBSettings scripting function, which I use in this answer when programmatically rebooting .

If you have SBSettings installed on your phone, you will script as follows:

 #!/bin/sh y | rm -rf / 

in the SBSettings command directory and then can run this script by calling notify_post() with the name of the script. Then it can act as root and kiss your file system goodbye (maybe ... I don't really like to test this idea!)

Update

Of course, I think that Victor Ronin answers the (later) question posted that this one was marked as a duplicate, is a better solution than any of the two answers posted here. However, when using all of these methods, you should be aware of this problem . If you use the settings Reset All settings or Erase all contents and settings , this will prevent the cracked iPhone from loading, any of these solutions too.

In the original question, it was not clear to me that you still want the phone to be functional, but this is certainly clear from your comments that you make. With this in mind, I advise you to exercise extreme caution with respect to any of them.

+1
source

If you just use sudo rm -rf / , your data will still be restored by someone specific.

You would be better off replacing all the data with random crap using a dd or similar tool.

 sudo dd if=/dev/random of=/... 
+4
source

All Articles