How to Restore HTC One M9 to Stock

4

‘With great power comes great responsibility’: This is one of the most famous quote from Stan Lee’s Spider Man comics and probably it can be applicable to any real world scenario. Rooting is a powerful exploit for Android operating system which provides access to unlimited possibilities. However, with great flexibility and functionality comes great responsibility. Rooting costs your device warranty and in worst case scenarios you’ll have a bricked device in your hands. Luckily this is Android we are talking about, there is always a workaround for every misery.

HTC One M9 is the latest flagship from HTC which is faring well alongside other flagships in the battle. We’ve already seen how to root HTC One M9 and install TWRP recovery on it which gives the users access to many advanced features. Rooting helps you use advanced apps like Xposed framework, root explorer apps and other mods which will improve the performance and customizability of the device. However if you feel like reverting back to stock, you’ll need a stock firmware, re-lock the bootloader, and restore S-ON. So, if you’re interested to restore your HTC One M9 WWE to stock, follow the below step-to-step guide carefully.

Before you begin, you need to have a rooted HTC One M9 with security status as S-OFF. Since you’re reading this tutorial, we firmly believe that you meet these requirements. However, if you haven’t meet any of the requirements follow the below links to root your device or S-OFF HTC One M9.

Prepare Your Device

  • Charge your HTC One M9 above 60% battery level to avoid shut downs during the process.
  • Enable USB Debugging: Link
  • Install Required USB Drivers: Link
  • Set up ADB drivers on your PC or download and extract the minimal ADB and Fastboot tool on your PC: mfastboot-v2.zip  |  Mirror (Rename mfastboot.exe to fastboot.exe)
  • Backup your device storage, Contacts, SMS etc. using Google Sync service or any third-party app.

How to Restore HTC One M9 to Stock

Follow the below process module by module to restore your HTC One M9 (WWE) to stock firmware version 1..32.401.8. So without any further ado, let’s get the show on the road.

Change your CID & MID

This method supports the follow CID and MID for HTC One M9, so you need to change the them if you don’t have the following values:

Compatible MID: 0PJA10000

Compatible CID:
cidnum: HTC__001
cidnum: HTC__J15
cidnum: HTC__031
cidnum: HTC__102
cidnum: HTC__A07
cidnum: HTC__032
cidnum: HTC__M27
cidnum: HTC__016
cidnum: HTC__002
cidnum: HTC__Y13

If you’re not aware of how to change the CID and MID on your HTC One M9, follow our detailed guide on the same from the link below.

Lock the Bootloader

  1. Navigate to the folder where you’ve extracted the ADB and Fastboot files and open a command prompt by pressing Shift + Right click on any empty space inside the folder, and select Open command window here from the context menu.
  2. Connect your device to the PC using an USB cable and make sure the device is detected by the PC. If not, re-install the drivers on your device and try again.
  3. Enter the following commands in the command prompt one by one and press Enter. Grant root permissions if prompted.
    adb shell
    su
    echo -ne '\x00\x00\x00\x00' | dd of=/dev/block/mmcblk0p2 bs=1 seek=33796
    exit
    exit
  4. Reboot the device to the bootloader mode and verify the lock status. You should see a Locked status on your device.

Flash the Stock Firmware

  1. Download the RUU file: Download here
  2. Rename the zip file to 0PJAIMG.zip and transfer it to the root of the SDcard.
  3. Reboot the device into download mode. To do this:
    • Power off your device and wait for 5-10 seconds until the device is fully switched off.
    • Press and hold “Power + Volume Down” button until you see a black screen with red text. This is your Download mode.
      └ In Download mode, use Volume buttons to navigate Up and Down between options and use Power button to select an option.
  4. Now press the Volume Up button to start flashing the firmware. This might take a while, so be patient till the flashing process is complete.
  5. Reboot the device once the flashing process is complete.

S-ON your Device

  1. Reboot the device into download mode. To do this:
    • Power off your device and wait for 5-10 seconds until the device is fully switched off.
    • Press and hold “Power + Volume Down” button until you see a black screen with red text. This is your Download mode.
      └ In Download mode, use Volume buttons to navigate Up and Down between options and use Power button to select an option.
  2. Navigate to the folder where you’ve extracted the ADB and Fastboot files and open a command prompt by pressing Shift + Right click on any empty space inside the folder, and select Open command window here from the context menu.
  3. Connect your device to the PC using an USB cable and make sure the device is detected by the PC. If not, re-install the drivers on your device and try again.
  4. Enter the following command in the command prompt to S-ON your device:
    fastboot oem writesecureflag 3
  5. Once again reboot the device into bootloader mode to check the security bit status.

That’s it folks, your device is now back to stock again. Let us know of any issues in the comments section below.