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

Search This thread

voz79

Member
Apr 16, 2008
14
1
So if I wanted to use this guide to convert my branded unit to unbranded, I would first have to change the CID to one of the supported ones, then I can continue as per your instructions, right?
 

ring_GT

Senior Member
Oct 18, 2010
396
39
Tokyo
Sony Xperia 1 III
Q

Can I Change my CID to any of the supported CIDs ( or SuperCID)
and follow the steps to put it to stock again?
I have the Asia Taiwan version, but I want the European WWE.
 

EddyOS

Senior Member
Jan 2, 2010
15,279
4,035
London
So if I wanted to use this guide to convert my branded unit to unbranded, I would first have to change the CID to one of the supported ones, then I can continue as per your instructions, right?

So long as you're S-OFF it should work, yes

Sent from my HTC One_M8 using XDA Premium 4 mobile app
 
  • Like
Reactions: voz79

VectorM8

Senior Member
May 10, 2014
106
21
OnePlus Nord CE 5G
Im on HTC___Y13. It did not work for me. Afret fastboot oem reboot stock in HTC logo any help here? Thanks

Microsoft Windows [Version 6.3.9600]
(c) 2013 Microsoft Corporation. All rights reserved.

C:\Users\admin>adb devices
'adb' is not recognized as an internal or external command,
operable program or batch file.

C:\Users\admin>cd documents

C:\Users\admin\Documents>cd !!!! M8 !!!!!

C:\Users\admin\Documents\!!!! M8 !!!!!>cd fastboot

C:\Users\admin\Documents\!!!! M8 !!!!!\fastboot>fastboot oem rebootRUU
...
(bootloader) Start Verify: 0
OKAY [ 0.025s]
finished. total time: 0.032s

C:\Users\admin\Documents\!!!! M8 !!!!!\fastboot>fastboot flash zip firmware.zip
error: cannot load 'firmware.zip'


C:\Users\admin\Documents\!!!! M8 !!!!!\fastboot>fastboot flash zip firmware.zip
error: cannot load 'firmware.zip'


C:\Users\admin\Documents\!!!! M8 !!!!!\fastboot>fastboot reboot
rebooting...

finished. total time: 0.019s

C:\Users\admin\Documents\!!!! M8 !!!!!\fastboot>
 
  • Like
Reactions: leon8.8

ring_GT

Senior Member
Oct 18, 2010
396
39
Tokyo
Sony Xperia 1 III
Hi

Never mind.
I tried supercid and it flashed fine.
I think I really need Supercid. Thanks


**************************************

Hi EddyOS
I took your advice and set my CID to HTC__001
I followed the steps to the tee, except relocing the bootloader.
However when I try to run flash the firmware.zip I get an error:

C:\adb> fastboot flash zip firmware.zip
target reported max download size of 1830711296 bytes
sending 'zip' (50706 KB)...
OKAY [ 2.836s]
writing 'zip'...
(bootloader) zip header checking...
(bootloader) shift signature_size for header checking...
(bootloader) zip info parsing...
(bootloader) checking model ID...
FAILED (remote: 41 model id check fail)

Do I have to change my ModelID as well? My getvar is:


C:\adb>fastboot getvar all
(bootloader) version: 0.5
(bootloader) version-bootloader: 3.16.0.0000
(bootloader) version-baseband: 1.15.2133156.UA14G
(bootloader) version-cpld: None
(bootloader) version-microp: None
(bootloader) version-main:
(bootloader) version-misc: PVT SHIP S-OFF
(bootloader) serialno:
(bootloader) imei:
(bootloader) imei2: Not Support
(bootloader) meid: 00000000000000
(bootloader) product: m8_ul
(bootloader) platform: hTCBmsm8974
(bootloader) modelid: 0P6B11000
(bootloader) cidnum: HTC__001
(bootloader) battery-status: good
(bootloader) battery-voltage: 0mV
(bootloader) partition-layout: Generic
(bootloader) security: off
(bootloader) build-mode: SHIP
(bootloader) boot-mode: FASTBOOT
(bootloader) commitno-bootloader: ab0efa49
(bootloader) hbootpreupdate: 11
(bootloader) gencheckpt: 0





finished. total time: 3.244s
Should work, yes. I'd use HTC__001 personally as the CID

Sent from my HTC One_M8 using XDA Premium 4 mobile app


---------- Post added at 10:27 PM ---------- Previous post was at 09:30 PM ----------

Did you poot the firmware.zip in the same folder as your fastboot?


Im on HTC___Y13. It did not work for me. Afret fastboot oem reboot stock in HTC logo any help here? Thanks

Microsoft Windows [Version 6.3.9600]
(c) 2013 Microsoft Corporation. All rights reserved.

C:\Users\admin>adb devices
'adb' is not recognized as an internal or external command,
operable program or batch file.

C:\Users\admin>cd documents

C:\Users\admin\Documents>cd !!!! M8 !!!!!

C:\Users\admin\Documents\!!!! M8 !!!!!>cd fastboot

C:\Users\admin\Documents\!!!! M8 !!!!!\fastboot>fastboot oem rebootRUU
...
(bootloader) Start Verify: 0
OKAY [ 0.025s]
finished. total time: 0.032s

C:\Users\admin\Documents\!!!! M8 !!!!!\fastboot>fastboot flash zip firmware.zip
error: cannot load 'firmware.zip'


C:\Users\admin\Documents\!!!! M8 !!!!!\fastboot>fastboot flash zip firmware.zip
error: cannot load 'firmware.zip'


C:\Users\admin\Documents\!!!! M8 !!!!!\fastboot>fastboot reboot
rebooting...

finished. total time: 0.019s

C:\Users\admin\Documents\!!!! M8 !!!!!\fastboot>
 
Last edited:
  • Like
Reactions: leon8.8

ring_GT

Senior Member
Oct 18, 2010
396
39
Tokyo
Sony Xperia 1 III
Its weird but i cannot uninstall superuser. I only have the option to reinstall it from playstore. I tried select reinstall, so it removed the superuser icon from the app drawer. I rebooted but with no superuser icon in the drawer i still have root access! I had to reinstall the app and select full unroot and reboot to remove root.

Sent from my HTC One_M8 using XDA Premium 4 mobile app
 
Last edited:

voz79

Member
Apr 16, 2008
14
1
Its weird but i cannot uninstall superuser. I only have the option to reinstall it from playstore. I tried select reinstall, so it removed the superuser icon from the app drawer. I rebooted but with no superuser icon in the drawer i still have root access! I had to reinstall the app and select full unroot and reboot to remove root.

Sent from my HTC One_M8 using XDA Premium 4 mobile app

Are you sure the firmware flashed properly? Sounds to me like you never succesfully flashed the firmware and are therefore still rooted?

---------- Post added at 11:14 AM ---------- Previous post was at 10:47 AM ----------

Are you sure the firmware flashed properly? Sounds to me like you never succesfully flashed the firmware and are therefore still rooted?

Hmm well forget I said that. I finished the procedure and am also still rooted. I checked my MID and I have a EU phone.

Question to the TS, would it maybe be better to unroot after resetting Tampered & Unlock flags and BEFORE flashing the firmware?
 

leon8.8

Member
Aug 31, 2010
8
0
stucked in Red Triangle Screen when try recovery

I thought I'd write this guide after doing it myself and with the lack of RUUs it may be of use to others...

This covers returning an unbranded, European One M8_UL to stock, running 1.54.401.5. It does NOT cover returning carrier-branded handsets back to stock, nor other country unbranded variants - only the EU model. It also doesn't cover adb/fastboot as you should really already know what you're doing with that if you're running a custom ROM.

Although I run 100% stock these days I wanted to be S-OFF so had to use the following to get back to 100% stock but keep S-OFF for future freedom

This guide will assume that you're using CID HTC__001 (which is my CID) because you need to reflash the FW but if you were already running on 1.54.401.5 BEFORE flashing a new ROM then it can be skipped so if you're S-ON you can still use this guide - just not the parts about resetting the unlocked/tamper flags. It also assumes you already have the latest TWRP recovery on your phone. I did this using 2.7.0.2 available here.

Other CIDs that will work are:

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

So lets begin...

1. Restore the phone back to stock

I used the odexed package provided by @mike1986., which is available to download here

Once downloaded, copy the file to your phone and flash as you would any other custom ROM in TWRP. Once complete, reboot the phone but when TWRP asks if you want to root it, select 'No'

2. Install SuperSU

To reset the 'unlocked' and 'tamper' flags, you need SU permissions so using the SuperSU package is ideal for this. Download it from here and flash it via recovery. Once installed, reboot the phone

3. Reset the 'tamper' flag (REQUIRES S-OFF)

To reset the tamper flag, follow this guide (thanks to @scotty1223)

4. Reset the 'unlocked' flag (REQUIRES S-OFF)

To reset the unlocked flag, follow this guide (again, thanks to @scotty1223)

5. Flash stock FW package

Now your phone is back to 100% stock, we need to get the stock recovery back on the phone. To do this, you have to flash the 1.54.401.5 FW package from here (again, thanks to @mike1986.). To flash this file, do the following:

a. Reboot phone into fastboot
b. Copy the FW file to your fastboot folder on your PC (if you don't have fastboot in your system path)
c. Rename the FW file firmware.zip (NOT firmware.zip.zip)
d. Type: fastboot oem rebootRUU and wait for device to reboot
e. Type: fastboot flash zip firmware.zip and wait for process to complete. Although you don't have to do this twice as you used to do with RUU ZIPs, it's STRONGLY recommended that you run this command a second time after the first has finished to make sure it 'takes' properly
f. Type: fastboot reboot

The phone will now reboot

6. Remove SuperSU

So, your phone should now be back to 100%, locked and have the stock recovery but you still have the SuperSU app in the app drawer. To remove this, open the app and go into the app settings and uninstall it. Once it's removed, reboot the phone to complete the process

7. All done!

Voila, you are now back to 100% stock but still S-OFF so you have the option in future to do anything you want!

Never mind.
I tried supercid and it flashed fine.
I think I really need Supercid. Thanks


**************************************

Hi EddyOS
I took your advice and set my CID to HTC__001
I followed the steps to the tee, except relocing the bootloader.
However when I try to run flash the firmware.zip I get an error:

C:\adb> fastboot flash zip firmware.zip
target reported max download size of 1830711296 bytes
sending 'zip' (50706 KB)...
OKAY [ 2.836s]
writing 'zip'...
(bootloader) zip header checking...
(bootloader) shift signature_size for header checking...
(bootloader) zip info parsing...
(bootloader) checking model ID...
FAILED (remote: 41 model id check fail)

Do I have to change my ModelID as well? My getvar is:


C:\adb>fastboot getvar all
(bootloader) version: 0.5
(bootloader) version-bootloader: 3.16.0.0000
(bootloader) version-baseband: 1.15.2133156.UA14G
(bootloader) version-cpld: None
(bootloader) version-microp: None
(bootloader) version-main:
(bootloader) version-misc: PVT SHIP S-OFF
(bootloader) serialno:
(bootloader) imei:
(bootloader) imei2: Not Support
(bootloader) meid: 00000000000000
(bootloader) product: m8_ul
(bootloader) platform: hTCBmsm8974
(bootloader) modelid: 0P6B11000
(bootloader) cidnum: HTC__001
(bootloader) battery-status: good
(bootloader) battery-voltage: 0mV
(bootloader) partition-layout: Generic
(bootloader) security: off
(bootloader) build-mode: SHIP
(bootloader) boot-mode: FASTBOOT
(bootloader) commitno-bootloader: ab0efa49
(bootloader) hbootpreupdate: 11
(bootloader) gencheckpt: 0





finished. total time: 3.244s

---------- Post added at 10:27 PM ---------- Previous post was at 09:30 PM ----------

Did you poot the firmware.zip in the same folder as your fastboot?


Hello Guys,
:cowboy:
I've done all the single steps of the guide (actually only the point nr.1 and 5 cause I was S-on).
Even the last 2 steps
d. Type: fastboot oem rebootRUU and wait for device to reboot
e. Type: fastboot flash zip firmware.zip and wait for process to complete.

No long story but short, now I have the Original stock firmware 1.54.401.5 (updated to 1.54.401.10)without SuperSU(unroot).

The problem is that I get stucked in Red Triangle Screen when try recovery from Hboot.
Seem's that the phone don't recognize the original stock recovery :confused: :(

I've got the english ver. CID HTC__001
TEMPERED
RELOCKED
 

ekkelon

Senior Member
Apr 24, 2005
110
4
Venice
ekkelon.it
I have follow this tutorial ... but when it's time to write the firmware.zip a error appear:

writing 'zip'...
(bootloader) signature checking...
FAILED (remote: 12 signature verify fail)

Same help?
Thnx.
 

leon8.8

Member
Aug 31, 2010
8
0
try with adb

I have follow this tutorial ... but when it's time to write the firmware.zip a error appear:

writing 'zip'...
(bootloader) signature checking...
FAILED (remote: 12 signature verify fail)

Same help?
Thnx.

Did you already try with adb instead of fastboot to flash the firmware.zip?
PS remember that your fw need to be 50.707 kb,not all the fw.
 

ekkelon

Senior Member
Apr 24, 2005
110
4
Venice
ekkelon.it
Did you already try with adb instead of fastboot to flash the firmware.zip?
PS remember that your fw need to be 50.707 kb,not all the fw.


Sorry ... I don't understand what you mean "your fw need to be 50.707 kb,not all the fw"
I follow the tutorial ... but not via adb ... can you give me the command via adb?
My installed ROM is the 1.54.401.5 with root.
Can you explain please?
Thnx.
 
Last edited:

EddyOS

Senior Member
Jan 2, 2010
15,279
4,035
London
Hello Guys,
:cowboy:
I've done all the single steps of the guide (actually only the point nr.1 and 5 cause I was S-on).
Even the last 2 steps
d. Type: fastboot oem rebootRUU and wait for device to reboot
e. Type: fastboot flash zip firmware.zip and wait for process to complete.

No long story but short, now I have the Original stock firmware 1.54.401.5 (updated to 1.54.401.10)without SuperSU(unroot).

The problem is that I get stucked in Red Triangle Screen when try recovery from Hboot.
Seem's that the phone don't recognize the original stock recovery :confused: :(

I've got the english ver. CID HTC__001
TEMPERED
RELOCKED

That IS the stock recovery, press volume up + power to enter the menu (or might be volume down + power, can never remember!)
 

ekkelon

Senior Member
Apr 24, 2005
110
4
Venice
ekkelon.it
Are u s-off?
Can you post your getvar all?


Sent from my HTC One_M8 using XDA Premium 4 mobile app

No ... actually I'm S-ON, I have also relocked the bootloader, installed the stock recovery and insert the original CID HTC_304.
Why the other user inform me that I don't must use the complete ROM file (1.4Gb) but only the file of 50707Kb?
Thnx.
 

ring_GT

Senior Member
Oct 18, 2010
396
39
Tokyo
Sony Xperia 1 III
Step 5 is only to flash firmware.zip on fastboot. You do not flash the whole rom from here. Firmware.zip is only a part of the package and only contains recovery.img, radio.img etc.

The rom part is already done when you install the stock rom from step 1.
Read the op again. The firmware file is under firmware collection link in the arhd page.


No ... actually I'm S-ON, I have also relocked the bootloader, installed the stock recovery and insert the original CID HTC_304.
Why the other user inform me that I don't must use the complete ROM file (1.4Gb) but only the file of 50707Kb?
Thnx.



Sent from my HTC One_M8 using XDA Premium 4 mobile app

---------- Post added at 06:13 AM ---------- Previous post was at 06:06 AM ----------

Step 5 is only to flash firmware.zip on fastboot. You do not flash the whole rom from here. Firmware.zip is separate from the rom and only contains recovery.img, radio.img etc.

The rom part is already done when you install the stock rom from step 1.
Read the op again. The firmware file is under firmware collection link in the arhd page.






Sent from my HTC One_M8 using XDA Premium 4 mobile app



Sent from my HTC One_M8 using XDA Premium 4 mobile app
 

ring_GT

Senior Member
Oct 18, 2010
396
39
Tokyo
Sony Xperia 1 III
Sorry ... but I have a big confusion now ...
Pratically via fastboot in RUU mode I must flash only a part of ROM, not all the ROM but only that? http://xda7.androidrevolution.org/db_mirror/Firmware/index.php?dir=HTC/HTC_One_M8/

And in any case if I already have the stock with root, can I flash only the last part of ROM (507070Kb?)

Yes just flash that one. That is the file in step 5 in OP

Sent from my HTC One_M8 using XDA Premium 4 mobile app
 

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