How to Restore AT&T HTC One M8 to Stock with RUU

54

We are all fond of installing new ROMs now and then. Moreover, many of us root our devices the very day it comes out-of-the-box, probably in a haste, without realizing its consequences. While some of us like the  Custom experience, others don’t. And therefore there is a need to Restore to Stock Firmware. Rolling back to stock in devices like Nexus is pretty easy and takes least amount of time as compared to Samsung or HTC. We have covered a lot of guides about moving back to stock condition from as many devices as possible.

And here we’re today with the AT&T HTC One M8. This guide beholds the complete procedure to Restore AT&T HTC One M8 to stock condition. This involves, relocking the bootloader, RUU installation, removing TAMPERED banner and finally relocking the  bootloader.

Warning!

The procedure if performed wrong, may damage your device. Read and understand the instructions carefully before proceeding. DroidViews or any of its members shall not be held responsible for any damage to your device.

Prerequisites

Update: Firewater method has been discontinued by the developer now!

  • We assume your device is already S-OFF. If its not, use Firewater and do it.
  • Install HTC Sync USB drivers: Download here
  • Charge your M8 to at least 60% battery level to avoid any uncertain shutdowns during the process.
  • Gain S-Off on your AT&T HTC One M8
  • Setup Android SDK: View guide
  • Enable USB Debugging: View guide

Download AT&T M8 RUU

AT&T HTC One M8 Stock RUU: Click to download

Restore AT&T HTC One M8 to Stock

Change the CID

Since we’re going to use the RUU executable to restore, we need to confirm that the device CID is CWS__001, which is the AT&T HTC One M8’s stock CID. It could be changed easily using the steps below.

  1. Connect your device to the PC via USB cable, while its booted in OS already.
  2. Open a Command Prompt window and enter the command to boot into bootloader mode:
    adb reboot bootloader
  3. Once in bootloader mode, use the volume keys to highlight FASTBOOT and select it by pressing the power button.
  4. When the M8 has entered fastboot mode, enter the commands below:
    fastboot oem writecid CWS__001
  5. And finally reboot the device back to normal:
    fastboot reboot

Okay, we have been successful in changing back the CID, so the device is now eligible for restoring to Stock using RUU.

Relock your device’s bootloader and Restore RUU

Note: It might be a case that the RUU restore won’t work if your device has an unlocked bootloader. So, to overcome this issue, it is advised to relock the device bootloader using fastboot commands.

  1. Connect your M8 to the PC via USB cable
  2. Open a CMD window and type in the command below to reboot the device into Fastboot mode.
    adb reboot bootloader
  3. It will boot into Bootloader (HBOOT) mode. Now select highlight the FASTBOOT option using the volume down keys and then press the power button to get into Fastboot Mode (see below):htc-one-m8-bootloader
  4. Enter this command to relock the device’s bootloader:
    fastboot oem lock
  5. The bootloader will now display a relocked banner.
  6. Do not exit the Fastboot mode yet.
  7. Download the AT&T HTC One M8 Stock RUU from the downloads section (filename: RUU_M8_UL_K44_SENSE60_ATT_SECURITY_Cingular_US_1.58.502.1_Radio_1.16.21331931.LA11G_20.31A.4145.02L_release_368350_signed_2.exe)
  8. Double-click the file and run it as any other executable program. Follow the instructions by the program.
  9. The procedure will take sufficiently required time to complete and once done the device will reboot.

Install TWRP And SuperSU

You will need TWRP recovery to be flashed and SuperSU to be installed again for adb shell commands to work. Click the link below for our guide.

How to Root AT&T HTC One M8 and Install TWRP on It

Remove TAMPERED Banner

  1. Removing the TAMPERED flag from the bootloader mode is just a matter of a minute using some simple Command lines.
  2. Enter the commands below to get it done. When you will enter the shell, the device will prompt for Superuser access, press on GRANT.
    adb devices
    adb shell
    su
    echo -ne ‘\x00′ | dd of=/dev/block/mmcblk0p6 bs=1 seek=5314564
    exit
    adb reboot bootloader

Restore Bootloader to Locked state

Since the flag has been removed, the last thing left to do is to reset the bootloader state from ***RELOCKED*** to ***LOCKED***. A bunch of commands will do this for you, enter the list of commands below:

adb devices
adb shell
su
echo -ne ‘\x00\x00\x00\x00′ | dd of=/dev/block/mmcblk0p2 bs=1 seek=33796
exit
adb reboot bootloader

Your M8 will now boot into bootloader mode and display ***LOCKED*** status.

Completely Unroot

The last step is to unroot using the SuperSU interface itself. Open the SuperSU app, swipe to the SETTINGS tab. Scroll down and press on Full unroot. When prompted, tap on CONTINUE. The app will remove root from your AT&T HTC One and reboot the device automatically when done.

Congratulations! You’ve been successfully able to restore AT&T HTC One M8 to stock firmware. If you have queries regarding the process, post the comment below and we shall get our best hands on it. Stick with us, put some feedback and wait until we get back with more stuff on the HTC One M8.

  • Kristian Martin

    Thanks for the writeup, Dhananjay. I’m having an issue booting into recovery. After following the steps to download TWRP (as of this writing there is now version 3.x, I try to enter recovery but it doesn’t load the usual TWRP splash screen. Instead, it shows the “htc” logo with “Entering Recovery…” in pink text at the top. I also tried flashing TWRP v2.8.7.0 with the same issue. Any ideas?

  • Trent Handlovsky

    I trey to run the RUU and it tells me I don’t have the minimum battery percentage of 30%, but I know i fully charged it before starting the process. Can i override this?

  • J.Snipes

    I’m currently running the RUU installation for my m8. The steps in the program said that it should take about 10 minutes but it has taken much longer and still hasn’t made any progress. Wondering if I should restart the process somehow or just try to wait it out?

  • After using the RUU, you will lose root abut you can root the device again.

  • J.Snipes

    So, if I wanted to restore stock the Sense interface but keep the root would I just stop after using the RUU?

  • Hi, Firewater has been discontinued now.

  • jimmy8170

    hi i have htc one m8 that all went well till i tryed firewater it will not s-off it tells me that my phone is not suported any idea

  • James Conrad

    Nevermind, got it.

  • James Conrad

    How do I do that? Because I’m experiencing the same error.

  • James Conrad

    Thanks, @DJBhardwaj:disqus
    Sorry it took so long to respond. Got busy with other things.

    I tried it again with device unlocked and S-Off. This time got the RUU to run, but was met with Error 150 – Unknown Error.

  • I have updated the steps for better assistance. Thank you for notifying 🙂

  • The last two parts may come in handy. The major procedure finishes with installing the RUU. It will restore everything.

  • AdamKW33

    Umm… how are you supposed to SU AFTER you unroot your device? Shouldn’t you restore the RUU AFTER YOU UN-TAMPER?

  • The only known way is Firewater: http://firewater-soff.com/
    But, it is not confirmed to work on newly manufactured devices. You can give it a try though.

  • Gurmeet

    AT&T

  • On which variant? GSM or AT&T?

  • Gurmeet

    How do you gain s-off for free???

  • Hello @disqus_rkloROFXQh:disqus
    Try the RUU with the device unlocked and S-Off. Kindly Report back with results.

  • James Conrad

    The device reboots after locking the Bootloader. Ran the RUU exe. and accepted the license agreement, nothing happens… No error, just sits.

  • Most of these issues are because you’re S-ON. S-Off your device and try everything again.

  • James Conrad

    Any ideas?

    C:UsersConrad Family>fastboot oem writecid CWS_001

    (bootloader) fail: [writecid] Invalid cid
    OKAY [ 0.013s]
    finished. total time: 0.013s

  • Brandon Welch

    HTC One M8 and I relocked it right before I tried to install the stock RUU because the guide told me to do so…I’m working to unlock it right now. I’ll upload a picture of my current fastboot menu

  • State the device model number and is it unlocked?

  • Brandon Welch

    Here’s the command line all the way up till it screwed up.

  • Brandon Welch

    I followed all the steps down to step 7, and once I run it I get an error…I’ll upload the screenshot of it. I’m not sure what can be done to fix this though.

  • Jeff Bilder

    When it going into the Black HTC screen, through RUU. The error is showing in the HTC Android ROM Update utility.

  • At what step do you get the error?

  • Jeff Bilder

    I have followed this example step-by-step and keep getting Error[155]: UNKNOWN ERROR. And AT&T HTC one m8.

  • Patrick Christensen

    Got 100% stock. LOCKED, S-ON, stock recovery and ROM.
    1. flash the stock RUU.exe
    2. fastboot unlock phone
    3. fastboot install TWRP
    4. from TWRP install SU
    5. sunshine APK s-off
    6. fastboot install stock recovery
    7. adb remove ***RELOCKED***
    8. flash stock RUU.exe again
    9. fastboot s-on

  • Patrick Christensen

    After flashing the ROM from the HTC .exe file I no longer have SU. So how can I get the commands to work to remove *** RELOCKED *** ? Aslo I didn’t have the TAMPERED banner.

  • AP

    I unlocked the phone, and I am using a T-mobile SIM card. I let the CID remain the same, and the phone works fine.

    If I change the CID to the T-Mobile one CID, can I just install the T-mobile RUU on my HTC One M8 rather than flashing it to another carrier device?

  • Are you using a T-Mobile SIM card?
    And, have you SIM unlocked by changing the CID?

  • AP

    Hi,I unlocked my ATT HTC One M8 and use it on the T-Mobile network. Would I follow this guide, or the T-Mobile guide to restore my M8 to original stock?

  • I’m glad it could be of help 🙂

  • Joshua Lutz

    I did follow the instructions at that link and got myself back to AT&T stock from the GPE conversion. Thanks!

    All of this was to get back to stock so my unlock code would work, now I’m right back to GPE again.

  • You risk your partition table when you convert from Sense to GPE. You might want to try this: http://forum.xda-developers.com/showthread.php?t=2733523

    Kindly, report back with conclusions.

  • Joshua Lutz

    I’m in the same boat. Did you get this figured out?

  • Joshua Lutz

    I’m having the same problem. Did you resolve this? I assume we have to fix partition sizes.

  • Sabri

    There is no ruu for my m8 only for T-Mobile (1,6gb). I think others just update files (400mb).
    Thank you.

  • Yes, you’ll be able to flash the RUU using the same steps.

    You can look for the RUU here: http://www.htcdev.com/devcenter/downloads/P00

  • Sabri

    Hi Dhananjay and other devs
    I have M8 HTC__J15 and i wan’t to flash it with HTC__M27 RUU (When the ruu is available). Is this possible with your guide? If not how ?
    Thank you.

  • Ryan Huntsman

    I have the ATT HTC one M8 that i converted to the google play edition. I know that it makes the partition on the phone smaller than the one of the STOCK RUU. Will running this stock RUU bring my phone back to standard or will it not be able to flash due to partition sizes?

  • Travis Blount

    please help when I run the installation file…my phone boots…I get the black screen with the HTC logo and the error message on my computer ERROR 159: IMAGE ERROR

    The ROM update utility cannot update your Android phone.
    Please get the correct ROM Update Utility and try again.

    I’m coming from a converted Google play edition HTC One M8 on ATT.

  • You’re always welcome! 🙂

  • guest

    Understood – CAN’T THANK YOU ENOUGH! You’re Awesome!

  • That matters if you want to send you device to AT&T for warranty claim. Else, it doesn’t have any significance.

  • guest

    Got it! It worked for me, thank you so so much!
    In terms of removing the tampered banner and restoring bootloader to locked state, is this something that is required? What happens if I don’t do these steps?

  • It means that you have to reboot into the bootloader mode using ‘adb reboot bootloader”. When you enter the bootloader (HBOOT) mode, scroll down to FASTBOOT option using the volume down key and then select it by pressing the power button.
    See the screenshot.

  • guest

    Thanks – sorry for all the questions, doing this as we speak. I’m at the point of relocking the Bootloader. However am a little confused on the bottom:

    “It will boot into bootloader mode, now select Fastboot using the physical keys

    Enter this command to relock the device’s bootloader”

    So on the phone, do i physically select “REBOOT FASTBOOT” or am i selecting something else? Once I hit that, where do I go from there? Do I then go back to the computer and do “fastboot oem lock”?

  • No.

  • guest

    Thank you – also, I converted my phone from stock Sense to Google Play Edition but then to Stock Sense interface, Viperone Rom. Does that make a difference?

  • Yes, after restoring to stock, you will be entitled to get OTA.

  • guest

    Thanks – can you confirm that this includes normal OTA updates?