Can't revert HTC One M8 to stock

Search This thread

speedee39

New member
Nov 9, 2017
4
0
I received an unlocked HTC One M8 (US, works on AT&T, not Harmon Kardon), factory reset, never been modded. Because it ran Android 6.x, I was concerned that it wasn't as secure as it could be, so I researched how to install the newest Android possible. I found many articles on these forums, guides from 2014 all the way to 2016. I didn't (and still don't) know enough to tell the difference between a good tutorial and a bad/outdated one. I saw that some tutorials were edited to reflect new mods, but now that I have read even more, I suspect that even those updated ones are now obsolete.

My problem is that I installed Resurrection Remix with v7.1.2, along with pico Open Gapps, and it won't let me install several apps like Chrome or even YouTube. I have decided that I don't want a newer ROM and I would rather just revert to stock. I have been attempting to revert to stock for the last three or four days, and I have spent many hours researching and reading (mostly this site...go figure), but so far I have not accomplished anything.

Current information about the phone: I did not make a backup (I've had little success doing this over the years on Android phones), I unlocked the bootloader with the HTC unlock code.bin file, the phone has S-ON and has not been rooted. In fact, I've tried SuperSU and Sunshine and neither worked. I have TWRP 2.7.1.0 installed. I have drivers from HTC Sync, but I also installed the Android Studio, along with some utilities that come with it. I have attempted the RUU from HTC (RUU_M8_UL_M60_SENSE70_MR_BrightstarUS_WWE_6.12.1540.4) and it always says that there was an error.

I have attempted several times to change the CID, but only because a tutorial told me to. I assume that it was changed when I installed the Remix mod. I have no idea what it should be. I have attempted to install firmware as well, both with the adb method and by copying it to the SD card and renaming it for bootloader, but both options fail. The adb method fails with...
(bootloader) zip info parsing...
FAILED (remote: 99 unknown fail)
...and the SD card method thinks for a bit, then says "press power to reboot" in the same type of text as the bootloader text.

I am only a little familiar with adb and fastboot, so please, be gentle. If you list commands, I will use them without even thinking, like how Ron Burgandy reads everything on the teleprompter.

Please help.

Here's the getvar:
(bootloader) version: 0.5
(bootloader) version-bootloader: 3.19.0.0000
(bootloader) version-baseband: INVALID_VER_INFO
(bootloader) version-cpld: None
(bootloader) version-microp: None
(bootloader) version-main:
(bootloader) version-misc: PVT SHIP S-ON
(bootloader) serialno: XXXXXXXXXXXX
(bootloader) imei: XXXXXXXXXXXXX
(bootloader) imei2: Not Support
(bootloader) meid: 00000000000000
(bootloader) product: m8_ul_ca
(bootloader) platform: hTCBmsm8974
(bootloader) modelid: 0P6B17000
(bootloader) cidnum: GOOGL001
(bootloader) battery-status: good
(bootloader) battery-voltage: 0mV
(bootloader) partition-layout: Generic
(bootloader) security: on
(bootloader) build-mode: SHIP
(bootloader) boot-mode: FASTBOOT
(bootloader) commitno-bootloader: 11459804
(bootloader) hbootpreupdate: 11
(bootloader) gencheckpt: 0
 
Last edited:
M

maultasche

Guest
Did I post in the wrong forum? Any help would be greatly appreciated. Thanks!
Hi,

no you did not post in the wrong forum. This section is not that active but there are still a handful of people visiting and trying to help.

You've posted plenty of info - which is good. First of all, you can't change the cid if you're s-on. You need to be s-off. Changing the cid is not really necessary unless you want to convert your carrier device into the dev edition or the Google Play edition M8. What cid were you trying? Was changing the cid successful? In that current state it shouldn't.

Speaking of the Google Play edition. You tried to revert to sense stock, according to the ruu you mentioned. The thing is your getvar result shows that your mid and cid directs towards a Google Play edition device. If you want to go on sense there are a few steps you have to do before you can (repartitioning system for example as the storage size is bigger on sense than on GPe).

Another thing is, the TWRP recovery you used is way too old for the firmware. The latest one can be found on twrp.me

Can you tell us how big your system partition is? If it's only over 1GB you certainly have a GPe device - in fact getvar says that as well.
 
Last edited:

speedee39

New member
Nov 9, 2017
4
0
You've posted plenty of info - which is good. First of all, you can't change the cid if you're s-on. You need to be s-off. Changing the cid is not really necessary unless you want to convert your carrier device into the dev edition or the Google Play edition M8. What cid were you trying? Was changing the cid successful? In that current state it shouldn't.

The guide I found for reverting to stock said to change to the super CID (fastboot oem writecid 11111111). I only did that because I thought that it was the "right way" to do this. But if the CID can't be changed unless the phone is s-off, then it must still be stock, because I doubt that I've ever achieved s-off while flashing a different ROM.

Speaking of the Google Play edition. You tried to revert to sense stock, according to the ruu you mentioned. The thing is your getvar result shows that your mid and cid directs towards a Google Play edition device. If you want to go on sense there are a few steps you have to do before you can (repartitioning system for example as the storage size is bigger on sense than on GPe).

Yes, I attempted the Sense stock because the tutorial told me to and also because that's what is listed on HTC's website. I don't want to go to Sense, just thought that I was supposed to. So you're saying that the phone is a Google Play Edition? I'll need to look that up.

Another thing is, the TWRP recovery you used is way too old for the firmware. The latest one can be found on twrp.me

Thank you for that, I didn't know. I'll get it. One question that I've never found the answer to is, if I installed TWRP to change the ROM, what is the stock recovery image? Or, is it bad to simply leave TWRP installed? I have no plans to sell the phone.

Can you tell us how big your system partition is? If it's only over 1GB you certainly have a GPe device - in fact getvar says that as well.

I think I did this correctly. Here's what I found through the shell:
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/block/mmcblk0p45 1032088 853196 178892 83% /system

Once I started looking this up, I found a post on XDA about GPe and different partition sizes. I'll check for GPe ROMs now. Do I need any other files besides that and the updated TWRP? Is the order to install a newer TWRP, then flash the GPe ROM, and then relock the bootloader?

I noticed that the bootloader has a persistent message about it being relocked and **WARNING**. Is there a way to clear the warning flag? One of the tutorials that I was following listed several shell commands to do this. I'm going to list them, so let me know if that is the way to clear the flag.
adb shell
su
echo -ne '\x00\x00\x00\x00' | dd of=/dev/block/mmcblk0p2 bs=1 seek=33796
exit
exit
adb reboot-bootloader

Thanks for your help.
 
Last edited:
M

maultasche

Guest
You indeed have a GPe device. If you want to go back to GPe this thread has all your answers, links and ruu's

https://xdaforums.com/showthread.php?t=2708589

Since your device is a GPe device there is no need to change cid, mid etc. - with s-on you can't change them anyways. Just grab the latest GPe ruu and follow flashing instructions.

Stock recovery is only needed for ota-updates. On sense the updates would fail as this particular recovery is missing. I assume on GPe that would happen as well. It's up to you if you use twrp or stock recovery. GPe won't get updates anymore, same as sense.

I recommend not to mess with this stuff in bootloader. Once you go back to stock (ruu etc), it should fix itself. Besides that to temper with it you need to be s-off anyway.
 
Last edited:

speedee39

New member
Nov 9, 2017
4
0
You indeed have a GPe device. If you want to go back to GPe this thread has all your answers, links and ruu's

https://xdaforums.com/showthread.php?t=2708589

Yes, I had found that exact thread earlier today, thanks to you, and I was just replying to tell you that I have successfully reverted my phone back to stock.

In the spirit of contribution to the site that has helped a novice such as me, I want to share the steps I took so that others might be helped.

The phone, as mentioned earlier, is an HTC One M8 Google Play Edition (Gpe), was s-on, not rooted, bootloader unlocked. I had an old version of TWRP and Resurrection Remix ROM using Android 7.1.2.

Prerequisites
1. Stock GPe ROM: https://androidfilehost.com/?fid=817550096634750828
2. TWRP 3.1.1-0-m8: https://dl.twrp.me/m8/twrp-3.1.1-0-m8.img.html
3. Backup account fix (linked in aforementioned thread): https://www.androidfilehost.com/?fid=24686680535467942
4. ADB and fastboot
5. Unlocked bootloader

**This assumes that you have a Windows computer. I used Windows 10 v1709**

Steps
1. Copy the ROM and TWRP files to the same folder in which fastboot and ADB are located. This makes it easier to run commands.
2. (There might be another way to do this one, but I don't know it) Copy the backup account fix file "MRA58K.H15_backup-account-fix.zip" to a micro SD card and put it in the phone.
3. Open a command prompt or PowerShell window in the folder that contains ADB and fastboot by right-clicking + Shift in an open area and selecting "Open PowerShell/Command Prompt window here."
4. In the PowerShell/Command Prompt window, type "fastboot flash recovery twrp-3.1.1-0-m8.img" and press Enter to install TWRP
5. Reboot into the bootloader and choose "fastboot," then choose "recovery"
6. In TWRP, browse to ADB sideload and then "swipe to start sideload."
7. In your PowerShell/Command Prompt window, type "adb sideload HTC_One_M8_GPe_Marshmallow-6.0_MRA58K.H15_AROMA-Installer-v6-020817.zip" and press Enter to start the installation
8. On the phone's screen, choose the top option, which should be the unrooted, completely stock installation.
9. On my machine, the PowerShell/Command Prompt window showed progress up to 41% and then it finished successfully.
10. After that, do not reboot, but go back into the main TWRP menu and go to Install. Browse to the MRA58K.H15_backup-account-fix.zip file that you previously saved on your SD card and install it.
11. Once that is installed, reboot the phone. My phone took between 5 and 10 minutes to boot the first time.
12. (Optional) I wanted to have a completely reverted phone, so I locked the bootloader again by rebooting the phone into the bootlader and typing "fastboot oem lock" in the PowerShell/Command Prompt window. It then said "relocked" but no warnings or errors.

I hope this helps somebody. All credit goes to maultasche for pointing me in the right direction and to graffixnyc for the other thread.