[One (M8) General] GuestK0058:
Hi all,

I've created a simple guide to restore your HTC One M8 back to stock firmware while still being on S-ON.

This guide will provide you with all the files required to restore your EUROPEAN device back to stock.

If you have an device from another region, you'll need to find the RUU & recovery image yourself. (see below)

Prerequisites:

- HTC Drivers (just install HTC Sync and the included drivers, then remove HTC Sync)

- Fastboot package

- Stock recovery.img (you'll need the recovery.img with the same fw version as the RUU you're going to flash) (Link to 4.16.401.10 recovery.img for European non-carier devices)

- The RUU for your region/carrier. (Link to 4.16.401.10 for European non-carier devices)

If you have an USA /USA carrier device, go here for the RUU files

If you have an device from another region than Europe or USA, good luck finding the correct RUU

Look here to find recovery.img files for all regions (thanks to [MENTION=4366077]exocetdj[/MENTION])

Because this guide is intended for S-ON, only the RUU for your region/carrier will work.

If you don't have an RUU or cannot find one for your region/carrier, S-OFF your device and follow this guide to restore your HTC One M8 back to stock. (thanks to [MENTION=2258271]EddyOS[/MENTION])

After you've gone trough all steps;

- The red text during boot will be gone

- You'll have the stock firmware, system, recovery and boot.img

- Your bootloader will say

"Relocked"

- Your bootloader will say

"Software status: Official"

Let's start:

Step 1:

Start the RUU exe by double clicking on it, it will take a few seconds before it starts. After it has started, do not continue but go to your temp folder (type %TEMP% in your address bar)

Find the folder with the temporary files from the RUU (mine was called: {C48DBAA3-1CC0-4DF6-B069-B9CCB27F93C9})

Inside this folder there should be a few files and another folder with a long code as name (mine was called: {50F2F878-636A-496F-A7CB-544C067E0C4B})

Inside this folder, scroll down until you find rom.zip, open this file

Extract boot_signed.img and place it in a folder with the downloaded stock recovery and the fastboot.exe file

Now close the RUU installation wizard

Step 2:

Turn off your device

Hold

VOL-Down + Power

, after a few seconds you'll be in the bootloader. Now release the buttons

Navigate with the volume buttons to fastboot and confirm with the power button.

Step 3:

You should now have a folder with the following files:

- fastboot.exe

- AdbWinApi.dll

- AdbWinUsbApi.dll

- boot.img (extracted from the rom.zip)

- recovery.img (see prerequisites)

Inside the folder while holding shift, click right mouse and choose Open command window here

Before starting, it's recommended to rename the recovery file to recovery.img and the kernel to boot.img

Type the following commands in order (make sure to check the output and see if every command is successful before executing the next command)

fastboot flash boot boot.img
fastboot flash recovery recovery.img
fastboot oem lock

This will push the stock kernel & recovery and relock your device.

Step 4:

Open the RUU installation wizard again and follow the instructions.

It will start flashing the RUU on your device.

After 8-12 minutes, the installation will be complete and your device will boot into system.

Step 5: (optional)

Power off your device

Hold

VOL-Down + Power

, after a few seconds you'll be in the bootloader. Now release the buttons

Verify that your bootloader says

"Relocked"

&

"Software status: Official"

Congratulations, your device is back to stock again. After it's finished booting and optimizing 261(!) pre installed apps, you'll be greeted by the setup wizard on your phone.

If you have any questions, let me know.

Common problems:

Fastboot cannot find my device?

- try reinstalling the HTC drivers included with HTC Sync, and make sure to remove HTC Sync afterwards but leaving the drivers installed

I've got error 155 when trying to flash the RUU

- make sure your bootloader is locked. This tool only works when you have stock kernel, recovery and your bootloader is locked or relocked.