擦拭数据/工厂亚行复位工厂、数据

2023-09-12 23:04:03 作者:坐在坟前勾引鬼

基本上,这是我的问题/

Basically this is my problem/

我在运行普通的Andr​​oid手机200+需要擦拭(在擦除数据/恢复出厂设置的方式),然后用一些额外的apk安装一个新的ROM。

I have 200+ phones running stock Android that need to be wiped (in the Wipe Data/Factory Reset way) and then a new ROM installed with some additional apks.

目前我已经把一切都自动除擦去数据的一部分。其他一切都可以通过与一组命令的.BAT相当愉快地做,但我不能为我的生活工作如何可以模仿或强制恢复模式来擦拭数据。

Currently I've got everything automated except the Wipe Data part. Everything else can be done through a .bat with a set of commands quite happily but I cannot for the life of me work out how to either imitate or force the recovery mode to wipe the data.

事情:

在擦上它应该做的文件夹(数据,高速缓存,SD-EXT等),使用自己的rm -r *的数据。这不抹但随后的ROM不能正常工作,并卡在一个bootloop。 在尝试使用亚行输入的KeyEvent模仿的关键presses。我不知道它们映射到,因为它们是在UNIX外壳基本上而且当时没有输入,因为操作系统尚未加载反正。 试图找到实际运行擦拭/复位,然后运行该手动系统上的文件/脚本。这可能是最简单的方法,因为它是已经为我写的地方,但我看不出它是隐藏的,即使是在像CWM。

如果任何人有任何方法,使我可以通过一个.bat或通过亚行的shell我将不胜AP preciate它做恢复出厂设置。一直在努力,现在解决这个约2天,进展甚微。

If anyone has got any method whereby I could do this factory reset through a .bat or through the adb shell I would greatly appreciate it. Been trying to solve this for about 2 days now with little progress.

推荐答案

很多周围挖了,我终于结束了下载的Andr​​oid恢复部分的来源$ C ​​$ C之后。原来你其实可以发送命令到复苏。

After a lot of digging around I finally ended up downloading the source code of the recovery section of Android. Turns out you can actually send commands to the recovery.

 * The arguments which may be supplied in the recovery.command file:
 *   --send_intent=anystring - write the text out to recovery.intent
 *   --update_package=path - verify install an OTA package file
 *   --wipe_data - erase user data (and cache), then reboot
 *   --wipe_cache - wipe cache (but not user data), then reboot
 *   --set_encrypted_filesystem=on|off - enables / diasables encrypted fs

这些都是你可以根据使用的一个我发现但这可能是改装成不同的文件中的命令。因此,使用亚行,你可以这样做:

Those are the commands you can use according to the one I found but that might be different for modded files. So using adb you can do this:

adb shell
recovery --wipe_data

使用--wipe_data似乎做什么,我一直在寻找这是方便的,虽然我还没有完全测试此为呢。

Using --wipe_data seemed to do what I was looking for which was handy although I have not fully tested this as of yet.

编辑:

有关人还在使用这个话题,这些命令可能会改变此基础上恢复您使用。如果您使用的是Clockword恢复,这些命令应该仍然工作。你可以找到其他的命令在/缓存/恢复/命令

For anyone still using this topic, these commands may change based on which recovery you are using. If you are using Clockword recovery, these commands should still work. You can find other commands in /cache/recovery/command

有关更多信息,请点击这里: https://github.com/CyanogenMod/android_bootable_recovery/blob/cm-10.2/recovery.c

For more information please see here: https://github.com/CyanogenMod/android_bootable_recovery/blob/cm-10.2/recovery.c