In this article we are going to learn how to return HTC One M8 100% to stock. This procedure is only for European models that run 2.22.401.4.. It doesn’t cover other countries unbranded variants. It also doesn’t cover adb/fastboot. To restore your M8 to stock follow the steps below.
This guide is for all those who want to keep S-OFF for any further actions in the future. Even though you go 100% to stock S-OFF will give you freedom to do anything you want in the future.
Restore the phone back to stock
It is suggested to use odexed package. Once you downloaded the package, copy the files to your phone and flash as any other custom ROM in TWRP. After flashing, restart the phone. When TWRP asks to root the phone, press no.
Install Super SU
You need SU permissions to reset the unlocked and tamper flags. SuperSU package is a great solution for doing this. After the installation restart the phone.
Reset the tamper flag (need S-OFF)
To reset tamper flags follow the guide here. This guide is made by a member of XDA called scotty1223.
Reset the unlocked flag (need S-OFF)
Follow the guide here to reset the unlocked flag, again thanks to scotty1223.
After resetting the tamper and unlocked flags, SuperSU isn’t needed anymore so remove it. To do this follow the steps below.
- Download UnSuperSu zip file here.
- Flash in in TWRP.
- Restart the phone to confirm that SuperSu has been removed.
Flash Stock FW package
Your phone now is back to stock so you need to get the stock recovery back to your phone. You have to download the 2.22.401.4 FW package if you want to do this. Download it here. You have to flash this file to your phone. To do this follow the steps below.
- Reboot your phone in fastboot mode.
- Copy the FW file to your fastboot folder on your PC.
- Rename the FW file firmware.zip (not firmware.zip.zip).
- Type: fastboot oem rebootRUU and wait till device reboots.
- Type: fastboot flash zip firmware.zip and wait for process to complete.
It’s strongly recommended to run this command after the first one has finished and make sure it has worked properly.
- Type: fastboot reboot
Now you are now back to 100% stock and still S-OFF so you can do anything you want in the future.