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:




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!

133 thoughts on “How to Unroot the HTC One M8 (Complete Guide) (Video)”

  1. this doesnt get rid of tampered :/. ive now spent over 6 hours on this damn unrooting thing. so frustrating

    1. Damn, reading the intro of this article would have saved you a lot of time then.
      Unfortunately, there is no surefire way to remove the tampered, but also in the intro, it’s not necessary. HTC is usually pretty good about fixing any non-software issues even if the device is tampered.
      What exactly is the reason you are trying to unroot? Maybe I can help you with the end goal instead of just trying to remove tampered?

      1. thank you for your reply. what im trying to accomplish is to just send in my phone. as stock as possible. I cracked my screen. am going to send it in. I just dont want much proof that it has been messed with. the gentleman over the phone did tell me that they would do some diagnostic tests.

        1. I’m pretty curious how this went. I’ve got the same situation with the cracked screen and I’m about to send it in….

          Did they give you any trouble?

          1. I havent sent it yet. if you do before me. please let me know. I also have a camera defect so im gonna take it to att and if its covered

  2. Thank you for this.
    By the way on step V number 1(1. Download this file) you didn’t include the link.
    I tried to do the steps by reading but had to see the video to know where to find the file.
    Nevertheless great video and thank you.

  3. Excuse me but they don’t have my cidnum and version-main right now, can I follow you some other way or do I need to wait? My is cidnum : VZW__001, Version-main: 1.55.605.2

  4. Carson Tuttrup

    Hey thanks for making the video but I’m also having a problem. I have a rooted htc one m8 (TWRP) on sprint and there has recently been a OTA update that come out. I would like to install it and I really don’t mind if data or root are wiped, I just want to be able to update. Only problem is, when I try to install it, TWRP blocks it by just taking me to its menu. I did some google searches and found that I could unroot and flash stock rom, which lead me here. I saw some of the other guides and frankly, I am failry new to the whole rooting processes and all of the different terminoligy and can’t figure out how to get this update. I don’t necessarily need to unroot, I just want to be able to have the OTA updates. My final question is, is there any possible way to get this OTA update? I got stuck on #4 where I couldn’t find my CIDNUM of SPCS_001. Any ideas on what I could do?

    1. @carsontuttrup:disqus Firstly, thanks for ending up on my site. To answer your questions, you need to unroot to get OTA’s from Sprint, but if all you want is the latest version of Android or whatever they are pushing out, you are better off just flashing a custom ROM that is based on that version (you can even find ones that are essentially stock ROMs just with root enabled). I suggest you do that instead. The only reason you would want to unroot is if you had a warranty issue or just were done with root and ROMs, etc.

      1. Carson Tuttrup

        Okay, thanks for responding! So essentially I should just flash any ROM I want with the updates applied to it? Like in your video with the flashing custom roms tutorial, but there is only one ROM. Also, where would I find these types of roms? I’ve only seen google play, The harmen/kardman, and the viper one on your website archive list, does this mean the ROMs do not exist yet? Also, due to my devices’ CIDNUM, does that mean unroot is unavailable at this time for me? Thanks for all the help, I really appreciate it!

  5. ScubaSteve2797

    My CID Number is SPCS_001 and its not up there. What should I do to unroot my phone? I’ve Tried everything

  6. Everything was working great, but I got to the step where you flash the stock Nandroid kernel and it’s not showing up at all. I created a folder under TWRP called “backups”, and put the downloaded folder in there. Nothing. Any ideas?

    1. Boot into recovery and perform a backup. Then when its done look on the device’s storage from the computer and put the folder for the stock backup in that folder instead of creating your own backup folder.

      1. Just to add another thing.. when you perform a backup in TWRP to create the folder.. look if it’s creating that backup in “Internal Storage” instead of SD Card..mine was creating by default in SD (looks like a dumb statement..but someone might forget to look that).

        Best regards

  7. Óttar Ingólfsson

    Ok so Im having some problems getting my CID number. All the info seems to appear except the version main. See screenshot. Any ideas why this is happening and how to resolve the issue?

    1. Óttar Ingólfsson

      Well I sorted it out. My version main is viewable in the settings/about and that seems to work.

  8. Your website is pretty awesome, very helpful i have rooted my cousin’s htc m8 using your website and now he wants it unrooted i will be unrooting it easily i believe since your guide is so freakin easy to understand Big thumbs up mate ,Cool guy keep up the good work. 🙂

        I JUST HAVE UNLOCKED THE BOOTLOADER ONLY, i didnt root the phone. In the bootlaoder just say i have only “UNLOCKED”
        if i wanna relock the bootloaderi, i have to make all the steps or i just follow the step ” IX”

          1. I have done,thank you very much!
            Now relocked its the same like locked?
            Now i will able to recive the android updates right?

          2. Sorry im getting nervus and i still have some doubts.
            In the tutorial of “how ot root htc one m8” of this website i just have arrived in the step to “unlock bootloader”.I dindt install any custom recovery,i didnt install any custom rom and i didnt root it.
            then i saw that it is coming the now firmware update and i wanna recive it.
            So i just relock the bootloader following the step “IX” on this tutorial.
            Im from spain and i have the internacional version of htc one m8
            i will recive the update like if i didnt unlock the bootlader in the beggining?
            Sorry from my bad engilsh and thanks for youre help 😀

  9. My phone has been bugging out! tried to do a factory reset and it made it worse. so now im trying to follow this guide. I used your guide for rooting the phone. but when i try to do Getvar all. the cmd window says the AIO kit is not recognized as an internal or external comand,operable program or batch file..

    1. Means you aren’t in the right folder and it can’t find the file to run the command. Make sure you follow the steps exactly when extracting and copying files etc.

  10. I rooted my htcone m8 using a mac pro (there’s a video on youtube for mac users). So, I don’t know if its because I rooted my phone in a different way or what.. but when I connect my phone to the pc and press ‘gevtar all’ do command, and the command prompt window opens, it says ‘”c:users…” is not recognized as an internal or external command, operable program or batch file’

    PLEASE HELP. This is really frustrating >_<

        1. Oh, sorry didn’t realize you were in the toolkit when it gave that error. Try uninstalling and reinstalling the toolkit.
          Otherwise, if that doesn’t work, reach out to the toolkit developer on Twitter or on the xda thread to see if he is aware of the issue and how to fix it.

    I JUST HAVE UNLOCKED THE BOOTLOADER ONLY, i didnt root the phone. In the bootlaoder just say i have only “UNLOCKED”
    if i wanna relock the bootloaderi, i have to make all the steps or i just follow the step ” IX”

  12. Thank you so much for guide!! It’s the best I found for rooting and S-off my HTC one. I have sim unlocked it too (it was Sprint). But I have a question : if I unroot my phone (I need to unroot for security reasons to install BES 10 at work) will it remain sim unlocked?
    Thx again

  13. Pardon me sir in.
    – I no find version main. i find that number of software is that the same !!!! 1.54.771.9
    – BUT i dont find it in : HTC One M8 Stock Nandroids !!!!! i cant change with another !!!!! plzzzzz help i want unroot

  14. yes I have done the same thing. I have found 1.54.771.9 and I found nothing on the XDA link you give. ! I chose the 1.54.771.5 and I tried to restore In the CWD and I have not succeeded. he tell me: failed

  15. Hope you can help. I have a custom rom and superCID and when i try revert to the orange nandroid (it was originally orange uk) it completes in TWRP but then boots back to my custom rom. I cant seem to get any further and need to send it back to orange to exchange for a seperate issue. Please help!

  16. The CID number is given to me,but the version main information is not given to me,what can i do???I hope i hear from someone soon to see how i can find this info!!!!

  17. Step 4 is the step im encountering some problems!i have downloaded the nandroid backup,and i have succesfully put the files onto my M8,but when i go to the restore settings no files come up!Any tips or tricks???need to fix ASAP pleaseeee.

    1. Means its in the wrong folder. Make one of your own backups and then see where that is and how its saved and then make sure the restore file you downloaded matches that. Good luck!

  18. Hi David, my M8 is running a rooted 4.4.3 with S-On. Will this method still work?

    Because I know unrooting requires S-Off and devices with OTA to 4.4.3, there’s no method to S-Off on this version yet as far as I’m aware.

  19. ok so when i transfer the stock nandroid backup onto my phone and try to use recovery on Twrp ,it says failed.i also noticed that the files in my nandroid backup were different to the ones in the cid is HTC_J15. can anyone help thanks

  20. need help
    i am not getting into bootloader mode
    its saying device not found on first pop up window
    den on second pop up its showing waiting for the device please i am in problem

  21. hey. David.

    i just want to check with you. I want to update from OTA I cant do that it seems.
    and i decide to flash a new rom i have to root it first?


    1. You cannot update using HTCs OTA when rooted but you can flash a custom ROM and a lot of them will send you updates via OTA and they’re usually much faster at sending them than HTC.
      So if you’re only reason is to get an OTA, don’t unroot, just flash a custom ROM based on it. Its easier will be faster better performing and you’ll get it sooner.

      If you unroot and get an OTA from HTC then you’ll have to root it again (and there’s a chance they patched the root exploit in the new OTA and then you won’t be able to reroot).

      Bottom line, don’t unroot for an OTA. Just flash a custom ROM based on it.

  22. Hey, the mega link for my nandroid comes up with temporary error. I have what I believe to be stock firmware, I flashed the stock recovery and un rooted. Yet I still can’t fully complete the my OTA. It failed 1/4 way through. Please help 🙂

  23. When i try restoring the backup it always says failed. It may be becuase the check boxes that were there for you dont come up for me before i start the restoration. The error is: ‘no partitions selected for restore’. THIS IS URGENT, PLEEEEAASSSEEE ANSWER 🙂

    1. This is the screen that shown before i start the restore. Notice how none of the checkboxes are there. This is why it doesnt work. Can you please tell me how to fix it.

      Thanks David

          1. Unfortunately, not sure. If it isn’t showing those check boxes it isn’t recognizing them from the backup file. Is there any other backup files listed for your device you can try instead?

  24. Im having the same problem as some of you i have a blank version main however in settings it shows as 1.54.771.9 on the stock roms list there is 1.54.771.5 i dont know if i can use this and update or if i have to wait. Help please.

    1. You need to pick the firmware based on the main version, not the firmware version. Look for the main version in settings (as someone else demonstrated here in the comments). Use that number to decide what firmware to flash.

    2. same here HTC__E11 and main = 2.22.401.5
      (last one is not listed in HTC__E11 but in HTC__001, what should i pick? a random in HTC__E11 or just pick my main in HTC__001. Thx for this post and thx for your help ! 😉

  25. I tried to post already but dont think it worked i appologise if it does and it seems iv asked twice. I too have no version main when using the tool however when i use ottars method i find version 1.54.771.9 but on xda i only find 1.54.771.5 can i use this software and update to the later version or do i have to wait for someone to post the exact one i need? Please help.

          1. Actually make a backup in Nandroid so that that makes the folder for you, then go in and put the backup you downloaded in there next to the one you just made (that way you are guaranteed it’s in the right place).

  26. If I have never installed a custom ROM do I need to flash to a stock ROM or can I begin the process with the unrooting step, 5?

  27. ANY HELP PLEASE. I have rooted SPRINT m8 one with s-on im trying to unroot the phone for the most part your videos are helpful where im stuck is I did find my cidnum:SPCS_001 i did some digging and saw that I should use 1.54.651.8.didn’t find the main number on my screen its blank. I have never made a backup before so in my TWRP folder there is no stored backup already. I created a folder within that file(twrp) name back.when I rebooted into twrp the file was there. My goal is to unroot the phone back to stock so I can get the OTA updates and Im also have the notorious data issue with the sprint service so I will have to get my phone serviced. any help will be greatly appreciated!!!

    1. Sorry, you need that firmware to get it to work so you’ll have to wait until it exists (unless you did a backup of the device as soon as you installed a custom recovery, you could use that possibly).

  28. I have the Sprint M8 and cannot find my software version of 2.16.651.4. I tried flashing back to an older version and then update it but the updates failed. So I had to reroot. Now while I was still unable to find a backup of the Sprint One M8 to I did find 2 stock rooted odexed and deodexed. Can I just use one of these and then use the unsuperzip to unroot?

      1. Do you have and idea where I can find a stock backup for 2.16.651.4? I have looked everywhere and all I can find is 1.54 which I tried using but then the update failed to get back to 2.16. I found the RUU but I don’t know if it will work using this method. Or if I have to use a different method to use the RUU.

  29. 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?

  30. 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?

  31. 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?

    1. 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.

      1. 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

  32. 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

  33. 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.

    1. 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!

      1. 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?

  34. 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?

  35. Lorin Michelle Ponton


    I am trying to unroot. But when I go into recovery and search for files, it says internal storage empty and in the text area it says unable to mouont data. Any clue what I need to do?

  36. Hi,

    what if my HTC is still S-on ? will this work ? i just unrooted it and now cant get OTA updates. i would like to return it to stock. will this process work for me as well ?

  37. I have a super cid set on my phone. i am told this means i can flash any rom on my phone. does that include these stock nandroid back ups?

  38. great guide , only my phone has a blank for version_main ! is there another way to find it ? there is two files under my phone’s CID in the forum , and i don’t have my version main to be sure !!!! and i’m S-on btw . . .

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.