Since Google is now pushing monthly security updates, it becomes a regular procedure for me to temporarily un-root my phone to get OTA updates.
This post introduces the steps of how to unroot Android M (6.0 or above), get OTA update and then re-root it.
[Update] Let’s take Nexus6p as example to OTA from angler-MHC19I to angler-MHC19Q.
- Android M
- Systemless rooted
- Basic knowledge of adb and fastboot
- Factory image of MHC19I
- TWRP (e.g. 22.214.171.124)
- SuperSU (2.60 or above, e.g. 2.68)
- Extract MHC19I’s factory image to get boot.img and recovery.img
tar -xf angler-mhc19i-factory-8c31db3f.tgz angler-mhc19i/image-angler-mhc19i.zip cd angler-mhc19i unzip image-angler-mhc19i.zip boot.img recovery.img
- Flash stock boot and recovery
adb reboot bootloader fastboot flash boot boot.img fastboot flash recovery recovery.img
Now the phone is un-rooted and we get the stock Android.
OTA or Sideload
If you got OTA update from Google, just run OTA, Android does the OTA automatically.
If you did not get OTA update, you have the option to use adb sideload to manually flash the OTA package.
- Get the OTA package;
- Go to stock recovery, in recovery screen, press and hold the Power key and the Volume up key for a few seconds, and then let go of the Volume up key, but keep pressing Power.
- In stock recovery, run below command to do the OTA upgrade:
adb sideload f7303e0c33450419deeb292b0887c1595fb5588d.signed-angler-MHC19Q-from-MHC19I.zip
After OTA, we’re now on MHC19Q (April 2016 release).
- Flash TWRP
adb reboot bootloader fastboot flash recovery twrp-3.0.0-1-angler.img
- Flash SuperSU
- Press the Volumn and Power key to enter Recovery
- In TWRP, flash BETA-SuperSU-v2.68-20160228150503.zip
- Wipe cache/dalvik
- Reboot to system.
Now the phone is rooted again systemlessly.
Enjoy the new version 😉