[GUIDE] Return your European M8 to 100% Stock - S-OFF REQUIRED

Search This thread

EddyOS

Senior Member
Jan 2, 2010
15,279
4,034
London
*** I HAVE SOLD MY M8 BUT I WILL TRY AND KEEP THIS UP-TO-DATE WHEN NEW RUUs COME OUT ***

*** NEW GUIDE AS WE NOW HAVE AN RUU!!! ***

This guide is for Windows-only. The reason for this is because the htc_fastboot file used is a Windows binary and there doesn't appear to be a version for Mac/Linux

This guide will allow you to return your EU, unbranded M8_UL device to 100% stock (inc. locking the bootloader and removing the tampered flag) for resale purposes or to return to HTC. It does not cover carrier-branded handsets and does require you to be S-OFF but Step 3 can be done on an S-ON EU M8 so long as your bootloader is relocked and you match one of the CIDs listed below. A lot of this can be used to restore a US carrier M8 as the RUUs are available, though, but you'd have to get the relevant RUU.zip from the EXE (which is very easy)

This process applies to the following CIDs:

HTC__001
HTC__102
HTC__203
HTC__E11
HTC__405
HTC__Y13
HTC__304
HTC__A07
HTC__032
HTC__J15
HTC__016
HTC__M27
HTC__K18
HTC__A48
HTC__002

You need the following files stored in your fastboot folder:

4.16.401.10 RUU ZIP - https://drive.google.com/file/d/0B17smFr95pleU2NqcVB3NWxoNnM/view (renamed to ruu.zip - not ruu.zip.zip!)
md5:4e03845aeab375746b4553e610047680
htc_fastboot.exe - *** REMOVED DUE TO HUGE AMMOUNTS OF SPAM REQUESTS ***
md5: 7343C5BCEC64373F83D69BD074954759
TWRP - http://techerrata.com/file/twrp2/m8/openrecovery-twrp-2.8.4.0-m8.img (renamed to recovery.img) md5:
e51c6ce8db0b7318ef31e1e7bd03c96e

And you'll also need HTC Sync Manager - http://www.htc.com/uk/support/software/htc-sync-manager.aspx (install it for the drivers and then uninstall it but leave the drivers on your PC)

All commands in bold are to be done in a command prompt window in your fastboot folder

1. 'Lock' the bootloader and reset the tamper flag

We know we can relock the bootloader by using the command 'fastboot oem lock', but it will show 'RELOCKED' on the bootloader and still show the phone has been unlocked in the past. With S-OFF we can set it back to 'LOCKED' ;). To do this, we need to use TWRP and adb shell

Flash TWRP in the usual manner by connecting the phone to the PC whilst in the bootloader and flash by using the command fastboot flash recovery recovery.img. Once flashed, boot the phone into TWRP and connect to your PC and make sure the drivers are successfully installed. To confirm it's working type adb devices and it should be listed with your devices serial number. Assuming you can see the device, we can now use adb shell to change the flag from 'UNLOCKED' to 'LOCKED' by using the following commands:

adb shell
echo -ne '\x00\x00\x00\x00' | dd of=/dev/block/mmcblk0p2 bs=1 seek=33796


Once the command has finished, we can continue using adb shell to reset the tamper flag by using the following command:

echo -ne '\x00' | dd of=/dev/block/mmcblk0p6 bs=1 seek=5314564

Once this has finished, we can exit out of adb shell by simply typing exit. Then reboot the phone into the bootloader through the menu in TWRP so we can confirm the flags are set back to stock.

2. Change the CID (if required)

Now we're in the bootloader and are 'LOCKED' and not listed as modified (but still S-OFF) it's best we reset the CID so moving forward things are easy. To do this, you just need to use fastboot oem writecid HTC__001, or whichever CID your device originally came with from the list at the beginning of this guide. Once you've reset the CID, reboot the bootloader to confirm the changes using fastboot reboot-bootloader

3. Flash the RUU


We are now at the point where we can flash the RUU and restore the phone to 100% stock. To do this, we first need to boot the phone into RUU mode using the command fastboot oem rebootRUU. Once in RUU mode, you'll see a silver HTC logo on the phone and that's it. At this point, we now use the HTC fastboot package to flash their RUU.zip file using the command htc_fastboot flash zip ruu.zip. This process will take a few minutes, and the phone will reboot a few times but once done it'll say complete. At this point, reboot the phone back to the bootloader using fastboot reboot-bootloader

4. Factory reset the device
*** OPTIONAL ***

Having flashed the RUU, I always prefer to do a factory reset to make sure everything is in order. To do this, boot into the stock recovery and once at the black screen hold volume up and press power to get into the menu and then select 'wipe data/factory reset' using the volume buttons and use power to select the option.

5. Reboot the phone

Pretty obvious this - just select 'reboot system now' and you should be good to go!
 
Last edited:

exad

Senior Member
Jan 26, 2010
3,459
1,518
Montreal
To adapt this for every single m8 would be incredibly simple, I'm not sure why you would target such a small group? Nice guide never the less.

Also you always need to flash firmware files twice.

Sent from my HTC One_M8 using xda app-developers app
 
Last edited:

EddyOS

Senior Member
Jan 2, 2010
15,279
4,034
London
To adapt this for every single m8 would be incredibly simple, I'm not sure why you would target such a small group? Nice guide never the less.

Also you always need to flash firmware files twice.

Sent from my HTC One_M8 using xda app-developers app

Because there aren't any pre-packaged ZIPs for any other build - only Nandroids. Now, I'm sure someone could make a flashable ZIP out of a Nandroid but I don't have the time for that! Plus, you've then got to make sure the right FW package is available as well as the stock recovery. I also DIDN'T have to flash the FW package twice, it worked doing it once only but it does mention to do it again as a precaution

As I have an unbranded EU handset I did this guide - if anyone wants to use it as a template then please feel free to do so! :D
 

EtherealRemnant

Senior Member
I also DIDN'T have to flash the FW package twice, it worked doing it once only but it does mention to do it again as a precaution

Any time hboot is flashed, you have to flash it twice for it to actually complete the full flash. There are no exceptions to the rule so if you did it once, you effectively didn't finish your firmware flash and run the risk of bricking your device instantly if you go S-ON to return it if the firmware was modified in any way over how it was stock. Please fix your guide before someone has modified their hboot to remove the red text and bricks their phone when they find the separate guide to go S-ON.
 
  • Like
Reactions: ducted

EddyOS

Senior Member
Jan 2, 2010
15,279
4,034
London
Any time hboot is flashed, you have to flash it twice for it to actually complete the full flash. There are no exceptions to the rule so if you did it once, you effectively didn't finish your firmware flash and run the risk of bricking your device instantly if you go S-ON to return it if the firmware was modified in any way over how it was stock. Please fix your guide before someone has modified their hboot to remove the red text and bricks their phone when they find the separate guide to go S-ON.

It says it already!! I didn't flash it twice as I was already on the correct FW. I've made it bold so people will notice it

e. Type: fastboot flash zip firmware.zip and wait for process to complete. Sometimes flashing for the first time doesn't work, so flash firmware.zip again just to make sure.
 
Last edited:

EtherealRemnant

Senior Member
It says it already!! I didn't flash it twice as I was already on the correct FW

You're on the correct firmware but not everyone will be. Currently your guide sets people up for a brick should they follow it and then follow the procedure to go S-ON afterwards as many actually get rid of the red text. Its not optional to flash it twice like you make it sound, its mandatory. If you won't change the text, I'll report the thread because this will result in bricks, end of story.
 

EddyOS

Senior Member
Jan 2, 2010
15,279
4,034
London
You're on the correct firmware but not everyone will be. Currently your guide sets people up for a brick should they follow it and then follow the procedure to go S-ON afterwards as many actually get rid of the red text. Its not optional to flash it twice like you make it sound, its mandatory. If you won't change the text, I'll report the thread because this will result in bricks, end of story.

In which case blame @mike1986. as it was taken from his firmware thread. I'll 'correct' it to please you but I don't agree with it as EU users will already be on the right FW. Nowhere does this mention that you have to go back to S-ON as that's nothing to do with this guide. All this is for is going back to stock
 

EddyOS

Senior Member
Jan 2, 2010
15,279
4,034
London
Text changed to make it a bit more obvious to do it twice, although this is different to flashing an RUU ZIP (where you HAVE to flash it twice as that's how the RUU ZIP works). Surely if it needed flashing twice it'd tell you to do it (as an RUU ZIP does)?
 
Last edited:
  • Like
Reactions: EtherealRemnant

EtherealRemnant

Senior Member
In which case blame @mike1986. as it was taken from his firmware thread. I'll 'correct' it to please you but I don't agree with it as EU users will already be on the right FW. Nowhere does this mention that you have to go back to S-ON as that's nothing to do with this guide. All this is for is going back to stock

I can't believe mike doesn't have it right either but I checked his thread and sure enough, there it is. Hopefully he'll change it since you tagged him here.

Even if you are on EU firmware, if you modify hboot to get rid of the red text and you have an incomplete firmware flash, you will brick if you turn the secure flag back on to return the device for warranty/exchange. Most people who return to stock are doing so in order to return the device so it is just smart to assume that they may have changed their hboot at some point.

Text changed to make it a bit more obvious to do it twice

Thank you.

EDIT: Noticed your edit to your post. It doesn't say something like this:

FAILED (remote: 90 hboot pre-update! please flush image again immediately)

After you do the first command? I suppose its possible HTC changed it. I don't have a firmware zip for me to go back to my T-Mobile firmware or I would try it myself to see but every HTC I've ever had before, if you are flashing an image with the hboot in it you had to do it twice. I wonder if the hboot is actually removed from mike's image.
 
Last edited:

EddyOS

Senior Member
Jan 2, 2010
15,279
4,034
London
I can't believe mike doesn't have it right either but I checked his thread and sure enough, there it is. Hopefully he'll change it since you tagged him here.

Even if you are on EU firmware, if you modify hboot to get rid of the red text and you have an incomplete firmware flash, you will brick if you turn the secure flag back on to return the device for warranty/exchange. Most people who return to stock are doing so in order to return the device so it is just smart to assume that they may have changed their hboot at some point.



Thank you.

EDIT: Noticed your edit to your post. It doesn't say something like this:

FAILED (remote: 90 hboot pre-update! please flush image again immediately)

After you do the first command? I suppose its possible HTC changed it. I don't have a firmware zip for me to go back to my T-Mobile firmware or I would try it myself to see but every HTC I've ever had before, if you are flashing an image with the hboot in it you had to do it twice. I wonder if the hboot is actually removed from mike's image.

That's correct, it's not there any more. And the HBOOT is in the FW ZIP (see attached). That's why I didn't make it 'mandatory' as I assumed it wasn't needed as that warning didn't come up :D
 

Attachments

  • Untitled.png
    Untitled.png
    64.1 KB · Views: 2,282

EtherealRemnant

Senior Member
That's correct, it's not there any more. And the HBOOT is in the FW ZIP (see attached). That's why I didn't make it 'mandatory' as I assumed it wasn't needed as that warning didn't come up :D

I still don't trust it and would continue to flash it twice to make sure. I don't remember the exact reason why the hboot caused it to fail all the time, something to do with the signature checking I believe.

The only way to really verify if it is actually flashing or not is to flash a different hboot this way and see if it actually works. I don't have the time to mess with it right now so I'd still suggest the old way. You know what they say about things that aren't broke...
 

EddyOS

Senior Member
Jan 2, 2010
15,279
4,034
London
I still don't trust it and would continue to flash it twice to make sure. I don't remember the exact reason why the hboot caused it to fail all the time, something to do with the signature checking I believe.

The only way to really verify if it is actually flashing or not is to flash a different hboot this way and see if it actually works.

You're probably right, I just did what I did but then again I never flashed a custom HBOOT so it wasn't gonna be an issue (and I'd never go back to S-ON anyway) :)
 

EtherealRemnant

Senior Member
You're probably right, I just did what I did but then again I never flashed a custom HBOOT so it wasn't gonna be an issue (and I'd never go back to S-ON anyway) :)

The only time I ever bother returning to stock is if I have to return the phone under warranty, sorry I was so mean about it, its just a serious issue when you have the potential to brick someone's device. I've never been unfortunate enough to brick but I've seen it posted before and what it came down to was something that wasn't explained clearly and could have been totally avoided. Thanks for the guide, I'm sure it will help many people. :) :good:
 

EddyOS

Senior Member
Jan 2, 2010
15,279
4,034
London
The only time I ever bother returning to stock is if I have to return the phone under warranty, sorry I was so mean about it, its just a serious issue when you have the potential to brick someone's device. I've never been unfortunate enough to brick but I've seen it posted before and what it came down to was something that wasn't explained clearly and could have been totally avoided. Thanks for the guide, I'm sure it will help many people. :) :good:

It's all good! I've made one last change to that point to highlight that although it's not strictly required it's strongly recommended to do it twice as a precaution

Not sure what else you can out as no doubt someone will get it wrong at some point...
 
  • Like
Reactions: EtherealRemnant

EddyOS

Senior Member
Jan 2, 2010
15,279
4,034
London
Added CIDs that will work with this guide to help users - if it's not listed then it won't work
 

Top Liked Posts

  • There are no posts matching your filters.
  • 108
    *** I HAVE SOLD MY M8 BUT I WILL TRY AND KEEP THIS UP-TO-DATE WHEN NEW RUUs COME OUT ***

    *** NEW GUIDE AS WE NOW HAVE AN RUU!!! ***

    This guide is for Windows-only. The reason for this is because the htc_fastboot file used is a Windows binary and there doesn't appear to be a version for Mac/Linux

    This guide will allow you to return your EU, unbranded M8_UL device to 100% stock (inc. locking the bootloader and removing the tampered flag) for resale purposes or to return to HTC. It does not cover carrier-branded handsets and does require you to be S-OFF but Step 3 can be done on an S-ON EU M8 so long as your bootloader is relocked and you match one of the CIDs listed below. A lot of this can be used to restore a US carrier M8 as the RUUs are available, though, but you'd have to get the relevant RUU.zip from the EXE (which is very easy)

    This process applies to the following CIDs:

    HTC__001
    HTC__102
    HTC__203
    HTC__E11
    HTC__405
    HTC__Y13
    HTC__304
    HTC__A07
    HTC__032
    HTC__J15
    HTC__016
    HTC__M27
    HTC__K18
    HTC__A48
    HTC__002

    You need the following files stored in your fastboot folder:

    4.16.401.10 RUU ZIP - https://drive.google.com/file/d/0B17smFr95pleU2NqcVB3NWxoNnM/view (renamed to ruu.zip - not ruu.zip.zip!)
    md5:4e03845aeab375746b4553e610047680
    htc_fastboot.exe - *** REMOVED DUE TO HUGE AMMOUNTS OF SPAM REQUESTS ***
    md5: 7343C5BCEC64373F83D69BD074954759
    TWRP - http://techerrata.com/file/twrp2/m8/openrecovery-twrp-2.8.4.0-m8.img (renamed to recovery.img) md5:
    e51c6ce8db0b7318ef31e1e7bd03c96e

    And you'll also need HTC Sync Manager - http://www.htc.com/uk/support/software/htc-sync-manager.aspx (install it for the drivers and then uninstall it but leave the drivers on your PC)

    All commands in bold are to be done in a command prompt window in your fastboot folder

    1. 'Lock' the bootloader and reset the tamper flag

    We know we can relock the bootloader by using the command 'fastboot oem lock', but it will show 'RELOCKED' on the bootloader and still show the phone has been unlocked in the past. With S-OFF we can set it back to 'LOCKED' ;). To do this, we need to use TWRP and adb shell

    Flash TWRP in the usual manner by connecting the phone to the PC whilst in the bootloader and flash by using the command fastboot flash recovery recovery.img. Once flashed, boot the phone into TWRP and connect to your PC and make sure the drivers are successfully installed. To confirm it's working type adb devices and it should be listed with your devices serial number. Assuming you can see the device, we can now use adb shell to change the flag from 'UNLOCKED' to 'LOCKED' by using the following commands:

    adb shell
    echo -ne '\x00\x00\x00\x00' | dd of=/dev/block/mmcblk0p2 bs=1 seek=33796


    Once the command has finished, we can continue using adb shell to reset the tamper flag by using the following command:

    echo -ne '\x00' | dd of=/dev/block/mmcblk0p6 bs=1 seek=5314564

    Once this has finished, we can exit out of adb shell by simply typing exit. Then reboot the phone into the bootloader through the menu in TWRP so we can confirm the flags are set back to stock.

    2. Change the CID (if required)

    Now we're in the bootloader and are 'LOCKED' and not listed as modified (but still S-OFF) it's best we reset the CID so moving forward things are easy. To do this, you just need to use fastboot oem writecid HTC__001, or whichever CID your device originally came with from the list at the beginning of this guide. Once you've reset the CID, reboot the bootloader to confirm the changes using fastboot reboot-bootloader

    3. Flash the RUU


    We are now at the point where we can flash the RUU and restore the phone to 100% stock. To do this, we first need to boot the phone into RUU mode using the command fastboot oem rebootRUU. Once in RUU mode, you'll see a silver HTC logo on the phone and that's it. At this point, we now use the HTC fastboot package to flash their RUU.zip file using the command htc_fastboot flash zip ruu.zip. This process will take a few minutes, and the phone will reboot a few times but once done it'll say complete. At this point, reboot the phone back to the bootloader using fastboot reboot-bootloader

    4. Factory reset the device
    *** OPTIONAL ***

    Having flashed the RUU, I always prefer to do a factory reset to make sure everything is in order. To do this, boot into the stock recovery and once at the black screen hold volume up and press power to get into the menu and then select 'wipe data/factory reset' using the volume buttons and use power to select the option.

    5. Reboot the phone

    Pretty obvious this - just select 'reboot system now' and you should be good to go!
    3
    Reserved in case I need it :)
    3
    flashed stock backup file 1.54.1540.9 / changed my cid to BS_US001/ flashed firmware 1.54.1540.9 / flashed stock recovery 1.54.1540.9 and if i go into recovery it shows me phone logo with red triangle is that fine ? and I'm still S-OFF and Unlocked will i receive OTA ?

    That's the stock recovery, press vol up and power to get into the menu ;)

    And yes, you'll get the OTA
    3
    You will need to have the stock recovery for OTA updates, but flashing the FW package restores the stock recovery so you're good to go

    Sent from my HTC One_M8 using XDA Premium 4 mobile app