[One (M8) Q&A, Help & Troubleshooting] pauluthupm:
Solved : Unbrick HTC M* - Revert to Stock

Thank you for the help. fortunately i did find the solution. just the way u said only. I was in office and dint have access to xda in office. Let me also put what i have done.

I downloaded the correct version of Marshmallow from Android Ghost : url below.

https://www.androidfilehost.com/?fid=24369303960687057

Make sure u download the htc fastboot files: Google is ur friend.

Place the image in the same folder as the htc fastboot files are.

rename the file to 0P6BIMG.zip( remember not to add two zips at the end.,windows generally hides the extension

Now open ur command prompt.

naviagate to the htc fastboot folder , i my case, i put in c drive

so it would like c:\htc_fastboot_files

Now Voulme Down Button and then press the power button.

In my case i had to use Power+Volume up to reboot the phone . And the moment it rebooted i pressed just the vol down button.

So we would be in Bootloader. Now switch phone to fastboot mode.

Navigate using volume buttons and power button to enter.

in fast boot mode

bring up ur command prompt:

We are already in the fastboot file folder. like i mentioned before: c:\htc_fastboot_files

type fastboot get var all

look for this info: (bootloader) version-main: 6.12.401.4 ( This might be different case to case, according to this you can search for relevant ruu, just google with the version number firmware)

Now htc_fastboot oem lock ( To relock the bootloader)

htc_fastboot oem rebootRUU

htc_fastboot flash zip Firmware_xx.zip ( in my case its 0P6BIMG.zip)

Once the flash completes, you will have a window which says Flash complete. OKAY. Mind you it takes some time.

After this,

htc_fastboot reboot . Thats it. Phone will take quite some time to reboot and complete the process.

My phone was up and running from here. But in case of errors. You might want look down.

IF IT SAYS "FAILED" do not immediately reboot the device If you reboot with a FAIL It could brick! If no flash is being accepted you have to find out what is causing the malfunction before rebooting your phone. Keep it alive while trying to figure out the error. It might be your cable, your USB ports (don’t use hubs! Always direct-mainboard connections), it might be USB 3.0 which is not good yet, it might be bad configuration of your ADB and Fastboot...

The least dangerous FAILED messages are listed below and are safe to reboot (below this section you find CRITICAL errors, please observe):

Safe to reboot / Flash didn't happen Errors (if you encounter one of them, you can just reboot. Nothing changed):

- 12 signature fail (unknown yet but safe to reboot)

- 23 parsing image fail (means something wrong with the image in the zip)

- 24 android-info fail (means something wrong with android-info.txt in the zip)

- 32 header error (means the zip couldn't be read and unzipped properly)

- 41 Wrong Model ID (means it's not the right device)

- 42 Wrong Customer ID (wrong CID means you gotta swap CID first as explained below)

- 90 hboot pre-update (means it only flashed hboot and you have to run the process again immediately to flash all other partitions WITHOUT a reboot in-between).

- 99 UNKNOWN usually indicates you are S-ON, sometimes other Security related issues.

- 130 wrong model ID (seems it's the same like 41, just that it shows in the FUU as 130.

- 155 seems to indicate different things. It can mean: 1.) You need to relock bootloader (If S-ON); 2.) You cannot run the RUU/FUU because the software versions of ROM, Firmware and RUU/FUU don’t match.

- 170 Check USB - FUU won’t run because of not working ADB.

In fact, if it aborts before the "(bootloader) start image[hboot] unzipping & flushing..." line it actually didn't write anything and you can probably just reboot. If you see it flashing stuff though (the stages after that line) and then it stops with a FAILED, chances are a little higher that something is now broken. In that case do NOT reboot but do as i said above.

For Error 12 “signature fail" do:

- might indicate that a signed firmware package is required. This would only happen with S-ON phones though.

For Error 23 "parsing image fail" do:

- change image names in the zip to stock image names like “hboot.img" or “radio.img" or whatever failed there....

For Error 24 "android-info fail" do:

- check that your ZIP isn’t some HTC OTA or anything thats got no android-info.txt - those cannot be flashed with fastboot flash zip nameof.zip command.

- check that your zip has a good MD5 and is not broken, check android-info.txt etc...

For Error 32 "header error" do:

- Sorry i haven’t found the exact cause yet and don’t know a definite solution.

- Make sure there is only one . (dot) in the filename, before the extension. fastboot reads anything after the first dot it sees as the extension. If that is not zip, it fails.

- If that doesn't help, you can also try: make the zip new with recommended settings, re-run the command, check your connections...

For Error 42 "Wrong Customer ID" and: 41 "Wrong Model ID" do:

Code:

htc_fastboot getvar all

Read that output, take note of your CID and MID and then edit the "android-info.txt" in your firmware.zip accordingly (For Wrong MID change the MID in the text, for wrong CID add your CID to the text).

Alternative method for MID and CID errors:

go SuperCID. Do:

Code:

htc_fastboot oem writecid 11111111

You can change back to any desired CID after a successful firmware flash. Notice: this command only works on S-OFF phones (which you have already of course or else you wouldn't be here).

For “Error 90 hboot pre-update..." do:

- Run the same flash command again which you just ran (press arrow up on your keyboard to get to the previous command in console)

- Don’t reboot in-between! (It wouldn't brick you but it would just make you run the flash command twice again)

- This might be caused by the newer encrypted RUU's, they need their hboot to be flashed first so it can then decrypt the rest of the ROM.zip. Look at an encrypted ROM.zip from a RUU, you will notice that you can mostly extract the hboot without decrypting the ROM.zip, but you can't extract much else.)

For “Error 99 UNKNOWN" do:

- Check with other zip’s if they work!

- Check if your S-OFF is correct

- You are S-ON? Then almost definitely this means the ZIP is not signed - get an unmodified zip!

For “Error 130 wrong model ID" do:

- Please refer to Error Code 41/42.

For “Error 155 relock bootloader" do:

- Since my thread works only with S-OFF phones anyway, this error can be read as: you need to S-OFF first!

- Error 155 can mean that you need SuperCID. On a few occasions this was shown when the RUU/FUU refused to run because of a wrong region lock.

- Lately, Error 155 has occurred when a FUU was launched from within android. When encountering a FUU error 155 with the process stalling after the rebootRUU (stuck at black screen with silver HTC logo), please just restart the FUU and leave the phone in that mode, or reboot the phone, then reboot to bootloader, then do “htc_fastboot oem rebootRUU” and then launch the FUU again (thanks [MENTION=2677046]anarchychris[/MENTION] for pointing it out).

- run the fastboot command “htc_fastboot oem lock" - only applies to S-ON phones that want to update the firmware with a stock OTA package (not offered on this thread!!). Stock OTA files sometimes need a locked bootloader.

For “Error 170 Check USB" do:

- Sometimes shown when running a RUU or FUU. Indicates issues with drivers. One way to solve is to run the ARUWizard with the phone already in Fastboot mode. Else you will have to re-install HTC Sync manager. Also, avoid USB 3 ports (the blue ones) - they have a complete new driver stack and that doesn't work well currently.

NOT safe to reboot / Flash (partly) happened Errors (if you encounter one of them, DON’T reboot:

- 152 Image Error - Phone Screen shows a little triangle beside a full green bar

For “Error 152 Image Error" do:

- Error 152 is quite rare, have seen it only once with a friend’s phone and it aborted the flash nearly at the end. The flash was started by the FUU. We could resolve the matter by NOT rebooting the phone and flashing the zip again through a manual fastboot flash as outlined further up.