[Q] Re-stockify can of worms

tmorterlaing

Senior Member
May 9, 2013
279
55
0
London
Sorry, me again!
I needed to re-lock and ‘stockify’ my HTC M8 today for a few reasons. It ended up taking me 4 hours, and I still have no idea if it’s ‘back’ to the way it was before I rooted it. Before you carry on reading, please know I’m fully aware any lack of understanding is my fault, and perhaps I should have realised that compared to the N4s blissfully easy steps, the HTC was a massive can of worms. However, I’m going to ask the below anyway, so hopefully someone is friendly and helpful enough to aid me in my quest for enlightenment of android stuff without me having to spend more hours searching than actually reading useful stuff… :D
So coming from a Nexus 4, where the guide is super simple:
http://forums.androidcentral.com/ne...3923-guide-nexus-4-factory-image-restore.html
It turned out to be SERIOUSLY complicated. I’ve put down a ‘typical’ guide below, and put my questions about each step in bold. Sorry if it seems like I’m just complaining and being trite, but I’d like to know if A) I’ve missed a far easier way of doing this and if not B) is it just me that seems to have a massive amount of issues?

1. Made sure your device is S-Off. If not, download firewater and S-Off your device.
Assume this is just a thing that some phones have and some don’t?

2. Restore a nandroid of the stock Sense ROM, or find a stock ROM to flash. You'll have to dig around; I used a nandroid.
WHY? Is there no such thing as downloadable factory images for HTC One M8s? Also, where’s the step that says ‘run the commands fast boot erase user data, fast boot erase cache’ etc.?

3. Flash SuperSU.zip in recovery on top of the stock Sense ROM. You can find the SuperSU.zip here: http://download.chainfire.eu/396/SuperSU
Fair enough… still an another extra step compared to N4.

4. Use fast boot to flash the stock firmware zip to your device based on CID (this includes the stock recovery)
-This took SO MUCH EFFORT. Turns out I had to Super CID so that one of the recovery zips worked, because I was getting “FAILED (remote: 42 custom id check fail)” - and I’m now paranoid because I have no idea how important it is to get the correct CID-numbered ‘stock firmware’ etc. The ‘stock firmware’ zips seem to contain boot, radios, recovery .imgs, and with about 4 billion versions of the M8 apparently existing, could I have flashed a wrong boot or radio or something? ARE they even different per CID? Then I changed the CID back to O2___001 in case I need to take it in for warranty repairs, but is that trackable? Would someone know that I’ve messed around with the CID? Could someone going to look at my Nexus and be like “Oh this radio seems to be the one we’d expect on a HTC_001, NOT an O2___001 CID device, they must have tampered with it”.
—OH, and I had to boot into RUU mode as well, which apparently no one felt like explaining what the hell that’s for. So I’ve got and HBoot, a Fastboot, and RUU mode, which no clear way of knowing what to flash where…??
—-ALSO there was a HELL of a lot of faffing by people throwing around CID, MID, Verizon, Sprint, and comments like this doesn’t work on this AT&T model but will only work on non branded eu models with a flag attached to the speaker with an SSID of “600TZL” and a it MUST have a holographic projector otherwise your CID must equal the square root of the MID so that the factory image will know which ID your phone carrier provides through an inter web”.


5. Boot back up into sense, and follow this guide to remove the tampered banner in recovery. http://forum.xda-developers.com/show....php?t=2708565
-Is this just removing a banner? or is it ‘you’ve removed the banner from a visual point of view only, but if they actually look into it it will still appeared ‘tampered’.

6. Follow this guide to lock your boot loader and make it say **LOCKED** instead of **RELOCKED**. http://forum.xda-developers.com/show....php?t=2708571
-So ‘fast boot OEM lock’ doesn’t work on HTCs then- is that an N4 thing? Why all that complicated cmd line stuff? And on a side note, why is it that when referring to re-locking a N4 people call it just that- locking. But with an HTC people on XDA seem to say ‘to make the banner say locked’ as if its not actually locking it, just changing a bit of writing on the boot loader.

7. Boot your device back up, and open SuperSU. Go into settings and find the "full unroot" option and run that. Reboot your device like it suggests.
Does running the unroot zip (can’t find the thread) work? So I can make it appear like the HTC is brand new out of the box? Rather than having to go through the ‘first setup’ screen?

Other question: people seem to keep yammering on about modded RUUs, is there one? is there a couple? (i.e. should I view it a bit like TWRP and CWM- there’s others but there’s one everyone really uses). And if I ‘flash’ a modded RUU, again, is there an easily accessible stock one?
 

Matt

Senior Member
Feb 4, 2012
1,850
1,221
0
23
Nottingham, UK
It's really not that complicated! I think the problem is comparing it to a Nexus 4 which is designed to be easily unlocked and locked, due to being a more developer orientated device.
An RUU is a stock image (like the Nexus images) and a modded one would just have the CID/MID requirement removed or something so it can be used on more phones. It would still be the stock, untampered image.
Also, the whole CID/MID thing is only applicable to American devices which vary between GSM and CDMA radios. ANY international modem will work in Europe and you will never find the wrong one.
S-Off is like unlocking the bootloader on a Nexus device except that in this case, its an extra step after unlocking the bootloader in order to be able to modify every partition and flash unsupported firmware in OEM mode. Every consumer phone is initially shipped S-On.
 
  • Like
Reactions: tmorterlaing

tmorterlaing

Senior Member
May 9, 2013
279
55
0
London
Thanks very much :) Veryone's v. helpful around here. Just a few more questions based on what you've said:
Also, the whole CID/MID thing is only applicable to American devices which vary between GSM and CDMA radios. ANY international modem will work in Europe and you will never find the wrong one.
Why did I have to Super-CID to install the stock recovery? And did I do the right thing by going back to my carrier CID afterwards?

S-Off is like unlocking the bootloader on a Nexus device except that in this case, its an extra step after unlocking the bootloader in order to be able to modify every partition and flash unsupported firmware in OEM mode. Every consumer phone is initially shipped S-On.
Although I've read in quite a few places I shouldn't have to S-On to take it in for a warranty repair, because some arrive to people S-off and they can't prove that you did it? Is that right?
 

legolator

New member
May 9, 2012
2
0
0
blog.monkii.net
Thank you for the step-by-step list. I am in the process of restoring my phone and all the guides say to look for "version-main", but that line is empty for me. What other information can I use to determine what recovery image to flash. Also the reason I want to go back to unrooted is so I can recieve OTA updates.
 

tmorterlaing

Senior Member
May 9, 2013
279
55
0
London
Thank you for the step-by-step list. I am in the process of restoring my phone and all the guides say to look for "version-main", but that line is empty for me. What other information can I use to determine what recovery image to flash. Also the reason I want to go back to unrooted is so I can recieve OTA updates.
this also happened to me- just another thing to confuse....
Can you not receive OTA updates if you're rooted? I thought it was just if you were running a different ROM?