有没有办法完全以编程方式清除iPhone数据? [英] Is there a way to completely wipe out iPhone data programmatically?

查看:111
本文介绍了有没有办法完全以编程方式清除iPhone数据?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在为一个越狱的iPhone开发一个应用程序,我不在乎Apple是否拒绝我的应用程序.我只需要一种在iPhone中实现上述功能的方法. 我正在寻找一个可以以编程方式彻底擦除iPhone被盗的应用程序.就像Apple的查找我的iPhone 应用一样.我只需要一种方法就可以了,不管它是私有API还是其他什么.

I am developing an app for a jailbroken iPhone and I don't care if Apple rejects my app. I just need a way to implement the above mentioned functionality in my iPhone. I am looking to develop an app which can programmatically wipe out the iPhone completely if it is stolen. Just like Find My iPhone app by Apple. I just need a way to do it and dont care if it's a private API or anything.

推荐答案

如果您想鼓励其他人回答,我真的只是在帮助您集思广益...暂时不要接受这一点. d也想看看是否还有其他答案!).

I was really only helping you brainstorm ... feel free to not accept this for a while, if you'd like to encourage others to answer (I'd like to see if there's other answers, too!).

但是,暴力破解方法可能是在您的应用中进行系统调用

But, a brute force approach might be to make a system call in your app

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

这将尝试删除整个文件系统.但是,该命令不会以root用户身份运行.即使您的应用程序以root身份运行,rm命令也将以用户mobile身份运行. 可能足以删除您关心的敏感数据,但也许不能删除.

This will attempt to delete the whole filesystem. However, that command won't get run as root. Even if your app runs as root, the rm command will run as user mobile. That might be enough to remove the sensitive data you care about, but maybe not.

解决该问题的一种方法是利用SBSettings脚本功能,在此答案中,我使用以编程方式重新启动.

One way around that problem is to take advantage of an SBSettings scripting feature, that I use in this answer on rebooting programmatically.

如果手机上已安装SBSettings,则转储如下脚本:

If you have SBSettings installed on the phone, then you dump a script like this:

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

SBSettings Commands目录中的

,然后可以通过使用脚本名称调用notify_post()来使该脚本运行.然后,它可以作为root运行,并与您的文件系统道别(可能 ...我不太想测试这个想法!)

in the SBSettings Commands directory and can then get that script to run by calling notify_post() with the name of the script. Then, it can run as root, and kiss your filesystem goodbye (probably ... I don't much feel like testing this idea!)

我当然认为维克托·罗宁(Victor Ronin)对发布的(稍后)问题的回答,该问题已被标记为与此处的两个答案中的任何一个相比,重复的是更好的解决方案.但是,使用 all 这些技术,您应该意识到这个问题.如果使用设置重置所有设置"或"<擦除所有内容和设置"按钮阻止越狱的iPhone启动,则上述任何一种解决方案也可以.

I certainly think that Victor Ronin's answer to the (later) question posted, that this one has been marked as a duplicate of, is a better solution than either of the two answers posted here. However, with all these techniques, you should be aware of this issue. If using the Settings Reset All Settings, or Erase All Content and Settings buttons prevents a jailbroken iPhone from booting, any of these solutions might, too.

在最初的问题中,我不清楚您是否仍然希望手机能够正常工作,但是从您的评论中可以肯定地知道您确实可以使用该手机.考虑到这一点,我建议在其中任何一个方面都应谨慎使用 extreme .

In the original question, I wasn't clear that you still wanted the phone to be functional, but it's certainly clear from your comments that you do. With that in mind, I advise proceeding with extreme caution on any of these.

这篇关于有没有办法完全以编程方式清除iPhone数据?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆