Reputation: 1460
Is there any way to reboot and restore a backup ROM automatically?
Currently I am using CWM recovery.
I can reboot into recovery through the app already (pretty much the same steps described here: Reboot in Recovery Android).
However, once it goes into the CWM recovery interface I have no way of controlling it. What I am looking for is when it reboots into recovery, it will select a predefined restore image and start restoring from it. This in effect will wipe all data on the phone and reset it to a predefined state.
Upvotes: 1
Views: 4949
Reputation: 11403
well you could use Team Win Recovery Projects's (TWRP) OpenRecoveryScript...
scripting options available: http://www.teamw.in/OpenRecoveryScript
more info generic TWRP info: http://www.teamw.in/project/twrp2
example of how I have previously used TWRP OpenRecoveryScript's scripting interface: https://github.com/JBirdVegas/android_packages_apps_Settings/blob/jb/src/com/android/settings/liquid/installer/OpenRecoveryScriptSupport.java#L265
CyanogenMod gerrit submission: http://review.cyanogenmod.com/#/c/14650/
While it is possible to check the what recovery was last booted, I do not believe it is possible to query what recovery is installed at runtime.
Upvotes: 4