How to restore HTC One M9 to stock Android software [Guide]

When you get your HTC One M9 handset out of the box you always have it’s stock version or Android (with bloatware included) over the top. From there, many people choose to gain root access which lets them installing custom recoveries, custom ROMS and root-only apps from Google Play. If you want to take your device away from root access and restore it back to stock Android you can do that easily by following the guide below.


  • Download the Fastboot zip file to the desktop of the computer.
  • Setup the ADB Drivers for Windows on the computer. Likewise, follow the same link through to our other page and install the HTC USB Drivers on the computer. Reboot that computer after it’s done. Bookmark this page before you reboot so you can easily come back to the page and continue the guide.
  • There’s no point following this guide unless you root HTC One M9 first.
  • Download the Hex editor.


  1. Open the folder where you have the ADB and Fastboot on the computer.
  2. Right-click and hold the Shift key at the same time to find a new menu pop-up on the screen.
  3. Choose to open the command window here from the menu.
  4. Connect the HTC One M9 handset to the computer via USB.
  5. Type the first command: adb shell
  6. You might need to grant the SuperSU request. Enter this command: dd if=/dev/block/mmcblk0p8 of=/sdcard/mmcblk0p8
  7. Type the final command: exit
  8. Now you have the P8 file on the smartphone from the computer by using the command prompt. Execute that file now by typing this: adb pull /sdcard/mmcblk0p8
  9. Open the file with the Hex editor and search from the 00408400 code.
  10. You will see constant numbers 68 25 32 C6. Do not alter those in any way. The fifth digit with code 00408404 is the tampered flag.
  11. htc-m9-p8-file-1
  12. Over-right the existing value with 00. To be clear, you can see a lot of 0’s but the fifth column down shows 68 25 32 C6 10 in the picture above. You need to change the last column from 10 to 00. Understand that yours might not say 10. Typically the HTC One M9 has 10 inserted here but yours might say 09. Whatever the value from that final number you need to change it to 00.
  13. htc-m9-p8-file-2
    Now that you have changed the value, you need to push that change back to the device. Here’s how:
  14. Type this command from the command line: adb reboot bootloader
  15. Now the next: fastboot flash pg2fs mmcblk0p8mod.img
  16. Now the last command: fastboot reboot-bootloader
  17. Once done, you will see the  *** Software status: Official *** from the bootloader screen.

Related Posts