yashsingh1/xdaforums huggingface dataset:
[One (M8) General] Einwod:
This is the only current way to gain S-OFF. Worth every cent. http://theroot.ninja/
[One (M8) General] c5satellite2:
If you are still s-off you can flash a ruu packaged recovery through RUU mode, then install su through recovery, then use adb shell to unlock.

Or you can use kingroot, towelroot, or sunshine app to get root without recovery and then unlock bl.

I just went through the same thing with a m7.

Posted using xda app in 2-D
[One (M8) General] olie3146:
Perhaps someone would be kind enough to help me with my situation.

Need to send my phone in for repair so wanted to put it back to full stock (including ***LOCKED*** not ***RELOCKED***)

Ive managed to get it back to stock with ***software status : Official*** and ***LOCKED*** but I stupidly didn't flash the stock image so currently has TWRP, now I figure I will have to unlock it again in order to flash stock recovery, but then how to I change it back to ***LOCKED*** without having SU? the phone is also S-OFF (using the sunshine method) so I will need to set this back to S-ON last.... is that correct?

Thanks for any help.
[One (M8) General] scotty1223:
The best thing would be to run a full ruu. Failing that, you can install recovery as a zip file.

I personally would leave it S OFF.

Sent from my HTC One
[One (M8) General] olie3146:
Thank you very much for replying, I really appreciate it as I've been at this for a good few hours now. please bare with me, im not a novice with these things but I certainly am no expert.

So in order to run a full ruu, I would need to unlock my phone again and flash the stock recovery then run the RUU?

If it's left as S-off would they not pick that up and void the warranty? in all honesty ive got an upgrade now so this phone will be going for sale once I get it back
[One (M8) General] olie3146:
Ok so have done some more reading up and can see what I have to do in order to do RUU, but I cannot find the correct one, I downloaded (what I thought was the correct one from the HTCDEV website) but it failed when I tried to flash it.

C:\adb>fastboot flash zip m8ul-3.4.0-g924f94b.zip

target reported max download size of 1826418688 bytes

sending 'zip' (450413 KB)...

OKAY [ 19.074s]

writing 'zip'...

(bootloader) zip header checking...

(bootloader) zip info parsing...

FAILED (remote: 24 parsing android-info fail)

finished. total time: 19.527s

my phone is VODAP001 if thats any help if you could point me in the right direction
[One (M8) General] scotty1223:
The ruu will need to match your cid and mid,and be for your carrier/build. Wed need to know all of that information and then look at the ruu you're trying to run. You can show the results of fastboot getvar all(x out meid and esn),and your correct software build number,and a link to the ruu

To complicate things newer versions of android are starting to use RUUs that contain a special htc modified version of fastboot to install the ROM.zip contained within,and youll get errors if you try to use fastboot/ruu mode with the normal fastboot. You can avoid that by simply running the .exe once you've gotten a correct ruu. Alternatively, you can install an older ruu and then let the phone ota to current.

As I said,you can easily install a stock recovery as a zip file with the same steps you used to try and flash the ruu. You'll just need to zip up the image with an android info text document.

Just be warned,that if things are not 100% correct(which there is absolutely no way of knowing),you could easily become locked into bootloader with a security warning within a number of reboots after turning s on.

Sent from my Nexus 9
[One (M8) General] olie3146:
Ok so details below

(bootloader) version-cpld: None

(bootloader) version-microp: None

(bootloader) version-main:

(bootloader) version-misc: PVT SHIP S-OFF

(bootloader) serialno: XXXXXXXXXXXX

(bootloader) imei: XXXXXXXXXXXXX

(bootloader) imei2: Not Support

(bootloader) meid: XXXXXXXXXXXXX

(bootloader) product: m8_ul

(bootloader) platform: hTCBmsm8974

(bootloader) modelid: 0P6B10000

(bootloader) cidnum: VODAP001

(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: 26b322e5

(bootloader) hbootpreupdate: 11

(bootloader) gencheckpt: 0

SOFTWARE BUILD : 3.29.161.9

Currently I now have a stock recovery successfully installed on the phone, but in order for me to use the command to set the phone to ***LOCKED*** I cant via stock can I?

I think the problem I'm having is getting the order correct.

Currently my phone is ***UNLOCKED*** S-OFF with stock recovery and official firmware. but I cant set it to locked with a stock recovery and if I flashed TWRP again to set it to locked then I'm stuck without stock recovery..
[One (M8) General] scotty1223:
Your problem is easy to fix:

1)install twrp

2)lock bootloader(by entering command while booted to twrp)

3)install stock recovery as a zip file(as described above)

Sent from my Nexus 9
[One (M8) General] olie3146:
Great, I can do all that fine, my last question to you (and I promise it'll be the last) do I just zip the recovery.img file up? what did you mean by android info text file, and does the zip need to be named anything particular or can I just name it recovery.zip?

Thanks again for all your help
[One (M8) General] Shikaiya:
Hi @ scotty1223 is this procedure good for the HTC One M8 Dual Sim too?
[One (M8) General] scotty1223:
i think it has been tested. look back thru the thread.

best thing to do is find a "firmware.zip" file for your particular variation. this firmware file is frequently pulled from the OTA update package for folks to flash and update their firmware. this zip is not encrypted,and can be unzipped conventionally with 7-zip or other utility. all youll need to do is rezip your stock recovery image with the android info document from this file. you can be locked,but you must be s off for this to work.
[One (M8) General] olie3146:
That's cool, I'm backed to locked and I'm still s-off. When you say my variation do you mean one that matched my cid or software version?

EDIT : Well I'm not sure whats the problem now, I found the firmware file for my software version, did what you said and it seems to have flashed the stock recovery (when i go into recovery now it shows up red triangle with !) booted my phone up and disabled SU and downloaded the OTA update, but it gets about 3/4 of the way through and comes up with red triangle !......... feel like im fighting a loosing battle at the moment. this is the 3rd days of trying to get this sorted :(

EDIT : Tried again and the bar goes all the way to install.....phone has restarted and android is now upgrading.... fingers crossed
[One (M8) General] scotty1223:
You probably are using the wrong stock recovery. They're not all exactly the same, and it is probably failing some sort of checksum or security check. The best thing would be to run a full, signed ruu, even if it is old. Second best thing would be to find a firmware.zip that updates to the build(ie matches your software build number) you are currently on, and has not been modified. It will install the correct stock recovery.

Sent from my HTC One
[One (M8) General] olie3146:
Thanks for replying again scotty, I just edited my post again, I don't think I had disabled SU, once I did that the update went through and now its initializing.... so fingers crossed that's me back to complete stock (bar setting it to S-ON)
[One (M8) General] scotty1223:
Awesome. Glad you are sorted :)

Sent from my HTC One
[One (M8) General] andreglud:
Hm.. nothing seems to be happening here with S-Off:

It just keeps displaying "Relocked".
[One (M8) General] scotty1223:
You may need to enter the su as a separate command
[One (M8) General] Passi0509:
Is it possible to unlock the bootloader on lollipop without HTCDev?
[One (M8) General] scotty1223:
If you are s off and rooted,yes
[One (M8) General] Passi0509:
Both not :( There is no way to get a custom rom without HTCDev right?
[One (M8) General] scotty1223:
None that I am aware of.
[One (M8) General] c5satellite2:
Kingroot and sunshine. Mixed results. There is more info in the sunshine thread.

http://xdaforums.com/showthread.php?t=2792487
[One (M8) General] Passi0509:
In the first try i want able to gain root access. i am trying it now again.

Doesnt work. Tried it three times.
[One (M8) General] c5satellite2:
Make sure to read back through the thread. There are some good suggestions in there. May take more than 3 attempts and certain tricks.
[One (M8) General] Be6i4:
Awesome tutorial. It works great. Just wanted to say thanks!
[One (M8) General] krele90:
I pass all steps but it is not work for me, i am still UNLOCKED. m8 (HTC_059) i want to LOCK bootloader becouse of redeem G Drive free storage. HTC stock 5.0.1 with twrp and SU last version...
[One (M8) General] ~clumsy~:
Worked perfectly fine for me when I was sending my device back for warranty. Perhaps you should give some more information in what you did and really make sure you typed the command correctly!
[One (M8) General] scotty1223:
Also make sure you are s off
[One (M8) General] jshamlet:
Jcase and Beaups apparently have announced a new version that no longer requires a third-party app for getting temp root on the M8.
[One (M8) General] hamo1234:
GPE?

Will this work with a HTC One M8 converted to GPE running marshmallow 6.0?

Thanks
[One (M8) General] ILoveYouAll:
Sunshine won't let me do anything since it says I am already S-OFF. The issue is, how do I gain root access if I can't use sunshine?
[One (M8) General] scotty1223:
Sunshine has never rooted you,it gives you s off after you've rooted.

If you're s off,install recovery,install superuser. Do some searching this thread is not the place for this discussion.
[One (M8) General] ILoveYouAll:
So you mean, that If I am S-OFF I can bypass having my bootloader relocked and install TWRP? Didn't mean to post on the wrong thread.. I've been off rooting and visiting xda for too long and I've forgotten so much. Thanks.

EDIT:NVM I just went and used htc dev.
[One (M8) General] long.nguyen:
ok so this method does not work. it only reset the flag and text on bootloader screen but does not change anything. I relock my bootloader using fastboot oem lock, used this method to unlock, done, but unable to install cm 13 (got unable to perform updater script error something). i relock and unlock again using htcdev and able to install cm13
[One (M8) General] nkk71:
Nice demonstration

Euronews - No Comment
[One (M8) General] Captain_Throwback:
Cool story bro
[One (M8) General] drondu:
something for huawei?
[One (M8) General] rkahoi:
Hey so...I can't seem to get past the 2nd command....after entering adb shell...it just blinks endlessly and even if I continue on it doesn't do anything...

I am trying to relock sprint M8 Hk edition, S-off

Thanks.
[One (M8) General] scotty1223:
what blinks endlessly? the cursor on your cmd window? you need to be rooted,you need to not have anything else running that might interfere with the pcs ability to comicate with the phone(htc sync,etc). you need to recieve your phones serial number back when yuo enter adb devices

failing those things,you have an issue with drivers,software,or something else on your phone and/or pc,wich is beyond the scope of help via this thread,youll need to do some searching on getting adb to work on your pc configuration
[One (M8) General] bjl:
Thanks for this info. Still works great on vzw m8!
[One (M8) General] Nana Ayeh:
[MENTION=3437245]scotty1223[/MENTION]

I would like to fllash the Marshmallow firmware. I rooted the device with kingroot and with your comands I have unlocked bootloader. I have a faulty USB port. I would like to flash the firmware.zip file using the external SDCARD but I do not know how to rename the file and flash with HBOOT. Kindly help me out. Thanks.
[One (M8) General] Sloth:
I'm pretty sure you have to be s-off to use that method.

Sent from a Glade Plugin. ;)
[One (M8) General] redpoint73:
Off topic for this thread (you don't need unlocked bootloader to flash firmware - although you do need s-off for tis method, as mentioned). But you just rename firmware.zip to 0P6BIMG.zip (first character is a zero, not letter "O") put on external SD card, and boot into bootloader, and it will install automatically.

After updating the firmware, be sure to delete the firmware from SD. Otherwise it will try to update every time you enter bootloader.
[One (M8) General] ricardod1:
So its been a long time, like 2 years!!! I partially rooted my phone if that is correct to say ( i have S-On but unlocked and running TWRP 2.8.1 with custom ROM Viper One 1.8.1) So now it's time to update to marshmallow and boy things have changed.

Since I have S-ON i need to relock my phone so I can update firmware and then update rom etc.... CAN ANYONE HELP ME??? All I want to do is Lock my phone again. OMG I have been at this for 2 days now... I have adb installed on my PC and ready to so something but everything I have tried has failed. I even went as far as putting stock kernel back on. THIS DID NOT WORK (echo -ne "HTCU" | dd of=/dev/block/mmcblk0p2 bs=1 seek=33796)

Last thing I'm on Sprint

Thank you in advance
[One (M8) General] Captain_Throwback:
That's the command for unlocking, not locking....
[One (M8) General] ricardod1:
Do you happen to know the command for locking?
[One (M8) General] Captain_Throwback:
Um, you mean the one in the OP? Right above where you got that one?

P.S. You did read in the thread title where it says this is for S-OFF only, right?

P.P.S. You don't need anything from this thread. You need Step 11 from the HTCDev unlock instructions.

P.P.P.S. [MENTION=830797]ckpv5[/MENTION] gives you the answer below - I was trying to encourage you search for it ;)
[One (M8) General] ckpv5:
I did ask you in other thread to ask in Q&A section and explain what you are trying to do.

You have S-On device. To flash a signed firmware and to run RUU, you don't need S-Off to do update, just relock bootloader by running command

fastboot oem lock

Note : you only can flash a htc signed firmware on S-On device
[One (M8) General] ricardod1:
OMG OMG OMG Thank you. . . Updated and new ROM being installed. THANK YOU

---------- Post added at 06:52 PM ---------- Previous post was at 06:51 PM ----------

You know I copied and pasted the wrong line. I did do a lot of reading but got lost. . . But I'm off to a great start THANKS A MILLION
[One (M8) General] Jongla:
Works without any hesitation.

:good:
[One (M8) General] browntown412:
Anybody able to answer a few questions from somebody whose last htc phone was an evo?

I have a tmobile htc one m8 that was purchased from amazon (awhile ago and I was just given it to see if I could fix some stuff).

It was sim unlocked by the seller and left in a weird state. seemingly unrooted, has a locked bootloader, but does have s-off. Is there an easy way to get things set up with possibly an international version or at&t version of the rom or even just root to hide the tmobile bloat?

sadly it's been so long that I went from slightly non-noob right back to noob, so any help is appreciated.
[One (M8) General] Einwod:
May I suggest you have a look at this thread? You'll find lots to read and catch up on. Another thing you could do is post the results of fastboot getvar all after removing your serial and IMEI numbers. Someone will surely try to help.
[One (M8) General] redpoint73:
Define "easy". You can do all those things, but I don't know how "easy" you want it to be.

Since the phone is s-off, its easy to unlock the bootloader using the instructions in the OP of this thread.

After that, its your choice how you want to do it, you can change the CID and MID and "convert" it to AT&T (don't know why you would want that particular version, their bloat and customizations are awful) or international version by RUU. Or you can just root and run write protection mod to allow you to remove bloat apps on the stock ROM.
[One (M8) General] jshamlet:
This is when you use the Developer Edition firmware. It will work on either AT&T or T-mobile, and since you are S-off, you can just run the Windows based RUU and blow it away to stock entirely. You will need to set the MID/CID, but since it's S-off, that is readily done either using a recovery ADB shell or by rooting the current install. If the owner wants to keep it stock for OTA updates, that works too - just don't re-root the new install.
[One (M8) General] mastershen23:
OK, so I've been reading guides left and right and have a similar situation as posted above.

Got my M8, it reads as "software status: official" and "locked" but says S-OFF

I'd like to flash some custom roms and stuff, what I need to do is get TWRP, flash it via fastboot command, then SuperSU and flash via TWRP, then unlock via OP instructions and I'm free to install and do whatever as I was used to on my Nexus 4?

CID reads as HTC__001

HBOOT as 3.19.0.0000

Radio as 1.29.214500021.12G

OS as 6.12.401.4

Thanks for any help in advance.
[One (M8) General] Einwod:
So if you are S-OFF simply do this:

to UNLOCK your bootloader,enter the following:

adb devices

adb shell

su (if needed to get a # prompt)

echo -ne "HTCU" | dd of=/dev/block/mmcblk0p2 bs=1 seek=33796

(i would very strongly recomend you copy/paste this)

exit

(exit a second time if you need to to get back to a normal > prompt)

adb reboot bootloader

Remember to copy and paste not type the commands individually. You need to be unlocked before you can install TWRP. Make sure you take the latest version as well.
[One (M8) General] mastershen23:
When I get to adb shell there's no # and trying to gain superuser just results in a /system/bin/sh su not found

Is there any way to gain root without a custom recovery? Does using the supersu app and clicking "normal" when prompted work as it's s-off?
[One (M8) General] Einwod:
No idea if you can use the SUapp. Give it a try and confirm root with root checker. If not, then TWRP is the only option. It's easily done and you can go back to the stock recovery easily as well. Just make sure you have a stock recovery first.
[One (M8) General] mastershen23:
Welp. Using SuperSU app returns an error and twrp installing without unlocked bootloader returns an error

Seems like I'll have to use htcdev to unlock anyways? lol
[One (M8) General] Captain_Throwback:
You can flash TWRP using the SD card method, and then you can access root shell from TWRP to run the unlock command.
[One (M8) General] mastershen23:
Sorry to bother mate, but where could I find some info about that method? Searching flash twrp from sd card yields too much info, none of which has been to the point.

Thanks for your help.
[One (M8) General] redpoint73:
You can try kingroot; which has mixed results from folks, but seems to work if you run it enough times.

SueprSU app won't do anything without the binaries installed, for which you need to flash the SuperSU zip form custom recovery.
[One (M8) General] Captain_Throwback:
Place the attached zip on the root of your external SD card (i.e. in no folder) and then reboot to HBOOT and install when prompted. You'll be forced to reboot once the flash is complete, so make sure you either move or rename the file so that it no longer gets picked up by HBOOT when you reboot. Then you should be able to reboot into TWRP and run the unlock command.
[One (M8) General] aer0zer0:
delete
[One (M8) General] unknownkind:
Does this STOL work?
[One (M8) General] null0seven:
For this to work you need to have saved in youre PC the "Unlock_code.bin". I save it from my first unlock.

Assuming that you have ADB folder in "C" (with adb, fastboot, etc in it). It's a kids play!

1.Copy Unlock_code.bin in "C"/adb.

2.Open Command promt. Shift+right click of the mouse in the same time.

3.Paste the next text: fastboot flash unlocktoken Unlock_code.bin.

4.The phone shows YES/NO option. Press VOLUME+ and move to YES. Press POWER button.

Done! You're unlocked.

To Re-Lock bootloader.

Open Command promt. Paste the next text:

fastboot oem lock.

This it's useful if youre S-ON and need to upgrade firmware.
[One (M8) General] thodibhen:
Doesn't flashing via 'fastboot flash unlocktoken' wipe the user data & device completely?

I have an already S-OFF T-Mobile M8, but on accident in the process taking an OTA, relocked the bootloader (still have S-OFF), and root with it.

I was not using systemless root at the time; is there any way to unlock the bootloader -without- losing my data?
[One (M8) General] null0seven:
thodibhen

yes, it will erase internal memory.

Backup first.
[One (M8) General] ckpv5:
Yes .. if you use the unlock_code.bin

Yes .. follow the guide on post #1
[One (M8) General] thodibhen:
Instructions in post #1, I need a # prompt. There is no SuperSU installed, unless I'm missing something big here.

Only thing different from stock phone is that it's S-OFF.

I could try flashing twrp via Flashify?
[One (M8) General] anit77:
Got it. Thanks guys. Was hope to avoid HTCdev... At$t M8
[One (M8) General] ffforce:
Any way to turn it back to s-on?
[One (M8) General] scotty1223:
Yes,but don't. Even for warranty.
[One (M8) General] ffforce:
Could you explain why?
[One (M8) General] scotty1223:
It's unnecessary,and potentially just causes more prollems,especially for vzw users who can't htcdev unlock.

Phones did legitimately come s off,so finding it does not indicate you have messed with it.

All that's needed for warranty work,or just to be stock and get ota updates,is to restore stock cid/mid,reset lock status to locked,and run a stock release keys ruu(or restore a stock unrooted rom and stock recovery in the event no ruu available and other firmware has not been altered)

I a lot of folks turn s on and screw it up. From being locked into bootloader with a security warning,to tampered banner reappearing,to hard bricks. My advice is dont do it.
[One (M8) General] ffforce:
I see. I thought s-off would screw up warranty. Thanks for the information!
[One (M8) General] kman79:
Awesome work

Can I use this to lock/unlock an HTCDev unlocked M8?
[One (M8) General] scotty1223:
As long as it is s off
[One (M8) General] Darkseth:
So, this definitely works on the M8?

Did anyone tried yet to "relock" the bootloader after unlocking it from htcdev in order to get the 50GB Drive space?
[One (M8) General] Captain_Throwback:
Yes, I got the Drive space once I relocked.
[One (M8) General] Darkseth:
Thank you for confirming!

i just did it, and it worked perfectly.

But, setting the bootloader back on locked will not give you back the drive. You also have to remove tampered flag. After i did this, i now also got it :) Now i am 100% pleased with my device

Edit: It says up to 65gb...

But i still have the +10 gb bonus from Quickoffice. Will i now get only 40gb up to a max of 65gb, or will i land at 75gb? You also got experience with that?
[One (M8) General] rustykwak:
Yes my drive has jumped to 75gb :)
[One (M8) General] Jump1ng:
Also want to confirm that locking it and having the tampered flag removed made me able to claim my G-Drive offer, so for any one that forgot to claim before unlocking the your phone with HTC Dev just get it locked as per the guide claim your offer and then you can unlock again.

Big thanks [MENTION=3437245]scotty1223[/MENTION]
[One (M8) General] itzjonjon69:
guys i need your help i relocked my phone last night after trying to flash the new firmware and now i can't unlock it for some reason. I've tried getting a new token and i've also tried this method but it keeps saying this:

1|shell@htc_m8:/ $ echo -ne "HTCU" | dd of=/dev/block/mmcblk0p2 bs=1 seek=33796

lock/mmcblk0p2 bs=1 seek=33796 <

/dev/block/mmcblk0p2: cannot open for write: Permission denied

1|shell@htc_m8:/ $

C:\Users\haswell\Desktop\platform-tools>

I've come to realize that my recovery is no longer working as well as super SU... Can someone please help me?
[One (M8) General] c5satellite2:
You did not follow the directions. You needed a su # prompt. I don't know how to recover from this other than try again and follow the instructions.