How to Unroot the HTC One M8 (Complete Guide) (Video)

It seems that a lot of people keep asking me for a how to unroot for the HTC One M8. A surprising amount actually. A quick Google search answered why; there is no complete guide for the process. Instead, there are pieces of the unrooting process scattered across the web making for a confusing and labor-intensive hunt to just get the device back to stock. After seeing that, I figured I’d try and bring it all together in one, more cohesive step by step how to and even do a video on it.

There are a few things to keep in mind, however, before doing this procedure. The main thing being that if you used the HTC method to unlock your bootloader (like I did) that doing this will get you back to stock, BUT will still show in bootloader mode that you were rooted at some point (indicated by the “relocked” message at the top) so technically your warranty will still be voided. Honestly, in my experience however, I’ve never had HTC deny my warranty for a rooted device as long as the issue wasn’t directly caused by rooting (i.e. the volume button falls of the device or the sim card tray melts). The voiding of the warranty is simply to stop you from messing up your phone’s software and then trying to get HTC to fix it for you.

With that said this procedure will unroot the device, flash the stock firmware and recovery image, and get it back to an out of box state (minus that flag saying you have altered the software previously) so any software issues you were having will be solved and would negate needing to send the device in for warranty if that was your reason for doing so. Make sense?

Ok, good. Without further ado, here we go.

In this procedure we’ll be using Hasoon’s All-in-One toolkit to help automate the process of relocking the bootloader of the HTC One M8, unrooting the device, and some other aspects where it makes things a bit quicker.

I. Before You Begin

1. This will work on all models of the HTC One M8 (AT&T, T-Mobile, Sprint, Verizon, and International Models).

2. Make sure your battery is over 75% charged to ensure it doesn’t die unexpectedly during this process.

3. This will erase all the information on your device, so be sure to save anything you want to keep to your computer before continuing.

4. This only works for PCs.

5. On the HTC One M8, go to Settings > Battery Manager > Turn OFF Fastboot.

II. Download and Install the Toolkit

1. Head to the developer’s page here and download the latest version of the toolkit you see on that page and save it to your desktop.

2. Download WinRar and install that so you can extract his toolkit if you don’t have a way to extract .rar files already.

3. After installing WinRar, right-click the toolkit .rar file you downloaded earlier and select extract all.

III. Get your CID and Version Number

1. Open the toolkit.

2. Click on Getvar All under Commands and click Do Command.

3. After the device reboots into bootloader mode, close the first command prompt and you will see a new command prompt with a bunch of info. Write down the “version-main” and the “cidnum”.

IV. Flash the Stock Nandroid Backup for your HTC One M8

1. Head to this helpful post on XDA, find the nandroid backup for your CID, and save it to your desktop.

HTC One M8 Stock Nandroids

2. On the device, using the volume buttons, select reboot and tap power to choose it to boot into regular Android so we can transfer files to the phone.

3. Extract the Nandroid backup on your desktop.

4. Copy the new Nandroid folder into the correct folder on your device’s internal storage:

/clockwordmod/backups/

or

/TWRP/backups/

5. Unplug the device.

6. Turn off the phone.

7. Turn it back on by holding down volume down and power.

8. Using the volume keys to navigate and power to select, select recovery.

9. Tap on Restore in recovery then choose the backup we just placed on the device. and let it restore it.

V. Unroot the HTC One M8

Some backups are not rooted and so you can skip this section, but once in a while they are. To unroot them after flashing them do the following:

*If TWRP ever asks you if you want to root the device, say no.

1. Download this file and save it to your desktop (do NOT extract it, leave it as a .zip).

2. Plug in your phone via USB.

3. Transfer the .zip file to your device’s internal storage.

4. Unplug the device.

5. Turn off the phone.

6. Turn it back on by holding down volume down and power.

7. Using the volume keys to navigate and power to select, select recovery.

8. Tap Install zip.

9. Choose the unroot .zip file and install it.

10. Tap reboot system now.

VI. Flash the Stock Recovery

1. Go back to the XDA thread from above and find the latest recovery with your same first two numbers in the ID (see video for details) and download it to your desktop.

2. Rename it to recovery.img (make sure it’s not recovery.img.img).

3. In the toolkit, select Your Own Recovery under the Flash a Recovery section and click Flash Recovery.

4. Wait for the device to reboot into bootloader, then close the first command prompt window.

5. Select the recovery.img and click OK.

6. Wait for it to flash.

VII. Remove Tampered (Optional)

You can also remove the tampered flag from the device according to this post here. Do that procedure before if you want to do it as it requires S-Off to do.

VIII. Return to S-On

1. Select reboot on the device with it still plugged in using the volume buttons and power to select it.

2. Select Return to S-On in the toolkit under Commands and click Do Command.

3. Wait for the device to reboot into bootloader, then close the first command prompt window.

4. Then your device should say S-On on the device now.

IX. Relock the Bootloader

1. With the device still plugged in, select Relock the Bootloader under Commands and click Do Command.

2. Wait for the device to reboot into bootloader, then close the first command prompt window.

3. When the device reboots, turn it off.

4. Turn it back on by holding down volume down and power until you get to the bootloader screen.

5. It should say relocked at the top of the device.

All done!

  • Collin

    There is no cid for the verizon backup!!!

  • Cory

    It keeps failing when I try to do the restore. MD5 error or something. Can I just flash the backup as a zip and the proceed?

  • Cory

    Cannot find a backup for my main version but I found a stock rooted rom. Can I just flash that and then unroot?

  • Usmaan

    I have a HTC one m8 Developer edition so it comes with an unlocked bootloader. Could I skip that step and still be able to go back to stock recovery from a custom recovery using this method/kit?

  • Ali Raj

    I have now in a silly situation. My ATT phone was unlocked before and s-off. I followed the steps here and turned s-on. Now I tried to s-off my phone again using firewater but it said firewater cannot work on my phone. Do you happen to know what is the problem? Anything related to s-on step here?

  • Kwesi Gem L. Yasay

    Hi daviid, My only reason to follow this procedure is to just update my firmware so i could flash the updated ROMs. Can i skip the other parts? do i need to unroot it? and also flash stock recovery image?

    • http://theunlockr.com/ David Cogen

      Not sure why you need to do any of this for that. Just flash a new custom ROM that is based on the latest update and you’re good to go. No need to really do all of this above unless you are sending in for warranty etc.

      • Kwesi Gem L. Yasay

        The problem with just flashing the updated ROMs is that it doesnt boot properly. It will be stuck on the htc red text screen. Because the new roms have the latest firmware. Thats why i figure i need to just update the firmware. Now i just found a solution by updating usig RUU and now ny firmware is updated, it booted up properly(currently just installed viper 2.5.0. I realy did follow your guide i could have a fresh phone. Thank you great guide

  • Graphix FWD

    Will this work for HTC E8?

  • http://www.facebook.com/himanshu.b.rane HimansHu Rane

    i have unlocked bootloader and rooted my device using TWRP , i have not installed any custom rom now i have to unroot it again and lock my bootloader. Also i want to get rid off ‘ tampered ‘ unfortunately firewater didn’t worked on my handset can u help me how to proceed ?

    Thanks in advance

  • http://www.facebook.com/himanshu.b.rane HimansHu Rane

    If any body can help I would be obliged.

    I am unable to gain S_off with firewater & sunshine .

    Any other method which can serve my purpose ?

  • Cory Weston

    Hey mate really important question. I can’t find the backup for my software version but have found an Odex Rom. I was told I can just use the Odex rom and unroot that but wanted to double check to make sure. If you can help me out mate it would be greatly appreciated.

    • http://theunlockr.com/ David Cogen

      Depends on what you are unrooting for. If you are just doing it to start over that will work fine (but you have to find that backup yourself). If you are trying to send it in for warranty, however, that won’t be enough. You need to flash the stock firmware not a custom deodexed ROM (and means you need to do the steps above). Good luck!

      • Cory Weston

        It’s not a custom deodexed rom. It is a stock Odex rom. And I just want to unroot and be completely stock and take OTAs. Nothing with warranty, Will a stock Odex rom work for that?

        • http://theunlockr.com/ David Cogen

          Ah, gotcha. Yes, that should work.

  • eliane

    hi , my version-main does not appear so i checked the build number , when i went to xda-developpers to download the stock nandroid’s backup , the cid num did not match the build number , i found the same build number with a different cid . any help?