yashsingh1/xdaforums huggingface dataset:
[One (M9) General] Behold_this:
Use Sdcard method
[One (M9) General] an0ther:
Mine is 64 gig, guess i'll have to get a 32 gig to make it fat32. Dang. Thanks for your help
[One (M9) General] blueberry60:
Thanks for your very important knowledge.This question is not related to this thread, do you know which adb commands we can use to remove tampered flag as such in M7 and M8? I wonder mmcblk0p blocks might be different.
[One (M9) General] scotty1223:
The block where the tampered flag is write protected,so it cannot be written to with adb and have the change "stick". We know the command,it just doesn't work.

An ruu won't be available for all variants,so there will still be a work around,it will just be a bit more complicated. I just need to make sure it works and try to make it as user friendly as possible.
[One (M9) General] scotty1223:
What does 64gb have to do with anything? Just back it up and reformat
[One (M9) General] devatxda:
Not possible. Only cards up to 32gb can be formatted as fat32, it's because above 32gb cards are not SDHC anymore but SDXC and this doesn't work..
[One (M9) General] scotty1223:
Did a little bit of searching and found a couple references to this:

http://mympx.org/Downloads/p13_sectionid/2/p13_fileid/13

And

http://m.download.cnet.com/EaseUS-Partition-Master-Home-Edition/3000-2248_4-10863346.html

Have you tried either?

Sent from my HTC One max
[One (M9) General] scotty1223:
im a little confused on what methods reset the flag,and which dont :eek:

could someone clarify the results of

-flash 0PJAIMG.zip via download mode from sd card

-flash 0PJAIMG.zip via RUU mode from pc

-run .exe from windows machine

-any other methods??

thanks :D
[One (M9) General] Behold_this:
Ruu.exe worked for me.

Sdcard worked for [MENTION=1335001]Mutasek24[/MENTION], but download mode manual flash did not (as reported in your other thread).

Because all methods are flashing the exact same SIGNED zip, and exe flashes through RUU mode, it's likely that flashing zip manually from RUU mode would reset the flag while using download mode does not. That needs to be tested tho.
[One (M9) General] an0ther:
I used htcfastboot and the rom.zip. the ruu worked but it did not clear my modified in bootloader. People are saying sdcard is the only way. I will pick up a 16 gig aye work today and try it.
[One (M9) General] Behold_this:
Again it's not the only way. Another way is to run a real RUU (rom update utility) which is an exe file not a zip. That's how I restored mine. The problem with that is only US carriers have real RUU.exe files available. Everything else is a rom zip that's been ripped out of the package. Those are not RUUs! People need to understand the difference. The zip is not a RUU. It is a ROM.zip the RUU is the delivery method/flash utility.
[One (M9) General] scotty1223:
Awesome,thanks for the clarification. Those are the results I thot,but was for some reason a bit confused on the ruu mode vs download mode. I'll test that if someone doesn't beat me to it(assuming I can set the tampered flag ;) )

Sent from my HTC One max
[One (M9) General] an0ther:
Flashing recovery without soff sets the flag. Just to confirm, i used the rom.zip, went to download mode, and "oem rebootRUU" mode. This method does not clear modified. This does allow for ota updates but still leaves boot loader modified logo.
[One (M9) General] scotty1223:
I skipped HTCdev unlock stage, so I have no flags set ;)

Thanks for the info on RUU mode. So apparently the bootloader is clearing the flag with the SD card method, and the .exe must be doing its own thing that isn't getting done when manually applying rom.zip.

Interesting, indeed :)

Sent from my HTC One max
[One (M9) General] minotauri:
Yup I'll second that. I only was able to reset the flag with sdcard method. I entered RUU with fastboot and that did not work for me. I haven't tried using the Tmobile stock RUU exe file yet (I usually use a mac, so dont really need the pain of using wine or loading it all up on my work windows laptop).
[One (M9) General] an0ther:
Confirmed by me three. I went and picked up a smaller sd card, formatted to fat32, and used sdcard method. Status official even after root/flash etc..

"fastboot oem rebootRUU" mode will not put you back on official
[One (M9) General] Sh0X31:
when I set my Bootloader: "Locked", I have no permission on /system.

Can't activate AdAway and on root explorer, I can't set /system to R/W.
[One (M9) General] Behold_this:
HTC used to employ RW protection through the kernel. They no longer are doing that and as you noticed, all you need is to unlock your device to make changes to live system that do persist. That being said it makes sense that locking the device removes that ability. If you're s off, just leave unlocked until you have a reason to return to the locked state. Otherwise you can make changes through recovery or flash them through bootloader or download mode.
[One (M9) General] devatxda:
hello [MENTION=3437245]scotty1223[/MENTION]

i am s-off and have flashed official RUU, but when i type in adb devices, i get the message device not found. i do this in recovery and in bootloader but it doesnt work.. what can i do?
[One (M9) General] scotty1223:
theres a mess of things that can cause connectivity issues,and troubleshooting that is beyond the scope of this thread. make sure you have drivers installed,and usb debugging checked in development options. make sure youre in your adb/fastboot directory,and nothing is running on the pc that might interfer with the phone comunication. id also pretty strongly recomend using the usb cable that came with the phone(they arent all equal). beyond that,you may need to do some searching and/or ask in the help and troubleshooting forum.
[One (M9) General] jauhien:
Type it whilst booted in Android, and make sure the USB debugging is ON.. :)
[One (M9) General] mtva24:
Has anybody achieved this with the VZW version? I am s-off and it didn't work. Also, I type the command with the phone on normal, or in fastboot, or in download mode, or any of the above?
[One (M9) General] nitsuj17:
i used the method successfully on the verizon variant. was previously factory s-off and locked; assuming you are on a test device as well, or javacard? either way should work

fwiw, i did it successfully while on viperone: was booted in android at the time
[One (M9) General] mtva24:
Yup, im on Verizon w/ java card s-off. Script seems fine, but the boot loader still says locked. I am also running viper BTW...
[One (M9) General] nitsuj17:
what was the output in the terminal when you ran the script? are you sure you ran the one to unlock, versus lock?
[One (M9) General] meists01:
I think it's more difficult, try this

http://xdaforums.com/one-m9/general/how-to-restore-software-status-original-t3092882
[One (M9) General] mtva24:
Ok apparently I'm impatient. I didn't wait for the "SU" prompt on my phone before continuing in adb. I'm all unlocked and good to go now LOL!
[One (M9) General] zjor2000:
htc one m9 sprint

would this unlock the device to any GSM network ?
[One (M9) General] scotty1223:
No

Sent from my Nexus 9
[One (M9) General] ntflc:
thanks for this
[One (M9) General] iElvis:
[MENTION=3437245]scotty1223[/MENTION], do you have any idea why fastboot oem writecid would fail converting back from supercid? It keeps telling me "input is not super cid."
[One (M9) General] scotty1223:
That is the typical output. As long as you are s off,the cid will change.

Fastboot reboot-bootloader

and you'll see the new cid
[One (M9) General] iElvis:
Thanks, that did it.
[One (M9) General] xantonin:
Does this only change the wording, or does it reinforce the actual restrictions of a locked bootloader?

In other words is this only cosmetic or does it lock down flashing the system/boot/recovery partitions?
[One (M9) General] scotty1223:
this is changing the flag that aboot checks to see if it is locked or not.it is NOT a fake or cosmetic fix. if you lock your bootloader,it is in fact locked.

however,with s off you can still flash any partition,so your question is somewhat of a trick one ;) it is my understanding that in order to make permnanent changes within a booted system,you will need to remain unlocked. apparently this write protection has moved from the kernel to the lock status.

sorry for the late reply,hope that answers your question :)
[One (M9) General] w3by:
Oh. My. God.

Locked/unlocked is definitely not just about cosmetics, I had trouble with ROMs based on the 1.40 WWE base rebooting when used with 1.40 firmware.

Totally forgot about this, and after trying flashing everything again with the phone being flagged as unlocked (I mainly went back to locked assuming it was cosmetic), it now works :D So definitely not cosmetic, and should probably be left unlocked unless you need to send it in for repairs or something.
[One (M9) General] Alech02:
htc m9 vzw

don´t work with htc m9 vzw?

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

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

dd: /dev/block/mmcblk0p2: Permission denied.
[One (M9) General] donmarkoni:
Did you read OP? ;)
[One (M9) General] scotty1223:
Yes, it does. You need to be s off and rooted

Sent from my Nexus 9
[One (M9) General] zeletrik:
So.. If I unlocked before with htc dev the BL but now the status is Locked instead of relocked the warranty is live?

This is 100% sure?
[One (M9) General] iElvis:
Nothing is ever 100% sure. Especially if you used htcdev, HTC knows you may have unlocked. Some devs I have talked to believe HTC may have a "secret" method of knowing you ever modded your phone. It would explain their historic friendliness toward the dev community.

In my experience, HTC will fix things that are their fault, like hardware defects, and charge you for repairing things you screwed up. But this doesn't always extend to carriers and third-party vendors/repair shops.
[One (M9) General] zeletrik:
Thanks for the answer!

I wanna buy an M9 in a local Tmobile. But root is my essence, and as far as i know rooting only avaliable with unlocked and modifed bootloader.

So Root or 100% sure warranty.. :(

This is a hard choice.
[One (M9) General] cellim:
About rooting?

I am very confused.. I got m9 soff. I couldn't unlocked bootloader. I bought this soffed already. I tried adb shell su but im not rooted.. Is there anyway to root or unlocking BL?

Thank you
[One (M9) General] iElvis:
Per the OP, you have to be rooted.
[One (M9) General] cellim:
Sorry i couldn't get it. What is OP? But i know i am not rooted. Su gives error when i install it.
[One (M9) General] iElvis:
Even with s-off, you have to do the first unlock with htcdev. This is not a method to bypass that.

Once you're unlocked, flash a custom recovery in fastboot, and flash su in recovery or flash a rooted rom.
[One (M9) General] nkk71:
probably a bit late to the party, but you can just flash TWRP recovery masked in a firmware.zip

ie, a proper "android-info.txt" + "recovery.img" (TWRP renamed to recovery.img) zipped up and fastboot flash it

then boot to recovery (now TWRP), and use an adb shell while in TWRP recovery

for example [MENTION=1102297]Sneakyghost[/MENTION] keeps his firmwares updated with TWRP already inside

EDIT: this is what we used to do on the M7 and M8, it

may

even be possible to flash recovery directly if you are S-OFF, I havent tested that, but a lot of things have changed on the M9.... however the above should work just fine, if normal flash recovery doesnt work
[One (M9) General] scotty1223:
Correct. With M 9, you can flash recovery directly. Enter the unlock command in recovery, or use recovery to install super su.

With any device, you do not need htc dev once you are s off.

Sent from my HTC One
[One (M9) General] iElvis:
Except you need root to get s-off on sunshine, no?
[One (M9) General] nkk71:
will test when I get a chance (fastboot flash recovery ... while LOCKED), and report back :angel:

---------- Post added at 18:23 ---------- Previous post was at 18:21 ----------

for the time being yes, but that user stated ".... I got m9 soff. ..."
[One (M9) General] scotty1223:
Yes. To achieve s-off on most variants, you need to unlock the bootloader, install root in recovery then run sunshine.

The original question came from a user that it purchased the phone s off, but not rooted.

Sent from my HTC One
[One (M9) General] scotty1223:
It works. I have personally done it twice, and the verizon crowd does it all the time. I have helped a few folks through it :D

Boot to download mode, then fastboot flash recovery

Sent from my HTC One
[One (M9) General] nkk71:
nice, thanks :good: , saves me the time to try it myself :D
[One (M9) General] iElvis:
:silly: Missed that bit. :laugh:
[One (M9) General] nkk71:
hope you dont mind a little sense of humour

i am kidding ;) :o
[One (M9) General] scotty1223:
Grumpy cat is always funny :D

Sent from my HTC One
[One (M9) General] 1337jay:
I've read this whole thread and did not understand one thing..the OP says unlocking bootloader without HTCDev while some posts say you need to do the first unlock with HTCDev. I am about to buy an M9 and want to be able to restore it to the original state (restoring warranty) if anything goes wrong or is wrong with the device. Can anyone help me and clarify this for me? Thanks!

EDIT: The phone will be an International model bought in Slovenia.
[One (M9) General] nkk71:
as per OP:

in other words, this thread/method is for people who are

S-OFF

but to get S-OFF using sunshine you currently need to unlock using htcdev and do a proper root (twrp + SuperSU)
[One (M9) General] iElvis:
As noted, you have to be s-off to use this method.

Some people have gotten s-off phones from the vendor, somehow. Those folks can use this method to unlock without htcdev.

For everyone else, you need to use Sunshine to s-off. Sunshine requires root, and right now, there is no way to root this phone without first unlocking via htcdev.
[One (M9) General] scotty1223:
If you really read the whole thread,I'm not sure what you don't understand. It was explained as early as the 4th post:

As for the warranty,the only way to guarantee it won't be voided is do not root it.

Sent from my Nexus 9
[One (M9) General] kokinator02:
I'm looking into converting to AT&T DE my M9 so, as you know, your post (or HTCdev unlock) is a must-do prior conversion. My device is a Telcel-Mex variant. While checking my phone's info (cid, mid, etc) to my surprise, I found out it's MID is none other that the very same as the AT&T developer edition 0PJA11000 only it's CID it's different (HTC___332).

Given this, I'd like to try the regular "fastboot oem unlock" command before trying your method but, I've never issued this command on a none unlockable device. Do you think passing regular unlock command will somehow damage or badly modify the phone?
[One (M9) General] jollywhitefoot:
you mean without getting the unlock code from HTC dev?

If that's what you're talking about it's just not going to work. There is currently no way around using HTC dev unless you purchased an unlocked device.
[One (M9) General] kokinator02:
Yeah, I mean, with my nexus devices all it takes is a simple "fastboot oem unlock" and since I seem to remember, developer edition phones are very much alike as of unlock purposes, right?
[One (M9) General] jollywhitefoot:
No, there's no way around using htc dev in your situation. MID matching already just saves you a step after you unlock using htc dev.
[One (M9) General] kokinator02:
Well that sucks XDXD, thanks for fast reply though.
[One (M9) General] jollywhitefoot:
Why's it suck? It only takes about 5 minutes to get the unlock code.

NP about the reply. I'm avoiding work right now

At least you're not Verizon where you can't unlock at all...well unless you send it to someone with a java card.
[One (M9) General] kokinator02:
Sucks because of htc's register, not the unlock process itself. Register might be a downside if uh oh! warranty is issued after unlocking I guess.
[One (M9) General] jollywhitefoot:
Unlocking isn't supposed to affect uh oh, but unfortunately, not all CS reps know that...see the video I posted here: http://xdaforums.com/one-m9/help/uh-oh-protection-rooted-device-info-t3090274/page2
[One (M9) General] GoHskrs:
Worked like a charm!

I have nothing more to add, except to say that [MENTION=3437245]scotty1223[/MENTION] is awesome! :D

Actually, for Google-posterity, here were the steps I used to unlock my bootloader:

Go to Dayton and get S-OFF on my VZW M9. (If you are in need of S-OFF because you are a Verizon customer, the Java card community is a very willing and helpful community. Go to http://xdaforums.com/verizon-one-m9/general/m9-java-card-t3063247 for pointers.)

Download TWRP (http://xdaforums.com/verizon-one-m9/orig-development/recovery-twrp-touch-recovery-t3069188) to my Linux machine

Read http://xdaforums.com/one-m9/orig-development/recovery-twrp-touch-recovery-t3066720/post59745198 very, very carefully

Enable USB debugging on my M9

Flash TWRP image to recovery. (NB: if you are doing this on Linux, do this as root, by typing "sudo fastboot flash recovery twrp.img"; it didn't work for me as a non-root user)

Reboot phone into recovery, launching TWRP. Mount /system read-only.

Insert your microSD card. Out of an abundance of caution, I powered off my phone before doing this. (NB: you will need at least a 32GB microSD card for this backup, or at least I did. It can't be formatted as VFAT/FAT32, because the system image file is >4GB, which is verboten under FAT32. I used mkfs.ext4 on my Linux box to format the SDHC card.)

Use TWRP to run a backup. Include "System Image" in the backup.

Reboot into normal system, remove the non-FAT32 SD card, store it in a safe place, and insert a FAT32 SD card.

Download SuperSU Beta (http://xdaforums.com/apps/supersu/2014-09-02-supersu-v2-05-t2868133) onto the SD card.

Reboot into recovery (TWRP), go to Install, and select the SuperSU Beta .ZIP file downloaded to the SD card

SuperSU should install and allow a reboot to the bootloader.

In the white bootloader screen, you should now see *** UNLOCKED *** and *** S-OFF ***

Reboot to normal Android system.

From my Linux box, I entered "adb shell" as documented in the OP. (NB: when you type in the "su" command in adb shell, SuperSU will launch with a "Superuser request: ADB shell". Touch "Grant" to allow this. Subsequent "su" commands will be logged, but you will not need to select "Grant" again.)

Also, if you need guidance when installing TWRP, the good folks at the #twrp IRC channel on chat.freenode.net can provide live "should I hit this button???" assistance. (Shout out to rashed, _that, and cybo from IRC if they inhabit these here parts also ... 8^)
[One (M9) General] onyx_64:
Ive a factory sim-unlocked M9 on lollipop. If i understand all this correctly, the only way you can unlock your device is to go thru the htc dev for bootloader unlock and root and then S-OFF the device (s-off being the first objective). Can someone let me know:

1: Whats the best way to S-off the phone when i have it unlocked/rooted from htcdev?

2: Once i have it bootloader-unlocked via htc dev, why should i still bother to unlock it again with S-OFF?
[One (M9) General] jollywhitefoot:
Who's your carrier?

If you're Verizon, you have to find someone with a java card, or buy one yourself.

As for the other carriers...

1) Sunshine ($25) method is the best way to s-off. the only other option is the java card mentioned above but they're expensive to buy, or you would need to send you phone to someone to s-off for you.

2) unlocking bootloader and s-off are two completely different steps. Unlocking bootloader allows you to install a custom recovery (TWRP) TWPR allows you to root your device and install custom ROMS, provided the rom is compatible with your EXISTING firmware. When HTC releases updated firmware specific to your device, you will have to return your phone to stock in order to get the OTA (over the air) update for your specific device/carrier. If you get s-off, you can update your firmware on your own regardless of which carrier/region it was intended.

For example, T-Mobile just released an update to take their devices from 1.32 firmware to 2.x. The latest 1.32 probably was released in April. Meanwhile, in the rest of the world, there has been a 1.40 firmware package that made improvements to the camera, a leaked 2.7 firmware that made improvements to charging and performance and now official 2.x releases (2.8 Dev Edition, 2.6 AT&T, 2.10 International, etc). If you were s-off, you could have installed these updated firmware packages on your own. With S-on, you are stuck waiting for T-Mobile to release your firmware and THEN you have the headache of getting your phone back to stock in order to update the TMO fw (do a forum search for people asking how to return to stock to take an OTA, there are a million threads on that and it seems like a lot of people struggled to do it properly).

Anyway, I hope this helps answer your questions.
[One (M9) General] onyx_64:
hey Thanks a lot for your informative reply! This clears up a lot of things.. and luckily im not on verizon!
[One (M9) General] rpadu2010:
Mine is HTC One M9 developer edition so is it possible to unroot and relock bootloader please help and guide me because due to security reasons so I wanted to relock bootloader.

Thanking you in advance.
[One (M9) General] scotty1223:
Answered on the other thread. Please do not ask questions in multiple locations
[One (M9) General] west2cool:
Does anyone knows if this works with HTC One M9 Plus. Thanks
[One (M9) General] clsA:
No the plus is a totally different phone

Nothing for the M9 will work with the plus

Their is a separate M9+ forum (search for it)
[One (M9) General] scotty1223:
as said above,no its a totally differnt phone with a different processor. DO NOT TRY IT

i am looking into m9+,and will open a thread there if it can work.
[One (M9) General] jimyv:
perfect

worked perfectly.

good work [MENTION=2312238]scotty123[/MENTION] , thank you for s-off ,and now unlocked.
[One (M9) General] Lrnxis:
question

i want to ask,i am s-off already,so i can do anything on my phone,why i need unlock bootloader?
[One (M9) General] azama02:
If you want flash new firmware can not without unlock bootloader

Hi I can't get token to unlock bootloader on htcdev do you have another way to unlock. My HTC m9 , China version
[One (M9) General] nkk71:
He is S-OFF, he can flash firmware regardless of bootloader locked/relocked/unlocked status

Please dont spread rumours around - considering the nature of this thread, and firmware - unless you are 100% sure, thanks.

1- Please don't quote the entire OP

2- this method only works if you are S-OFF

3- why not htcdev? unless it's banned by the carrier (afaik, those would be Verizon and KDDI or something like that), all other versions are allowed by htcdev
[One (M9) General] azama02:
I'M sorry for that maybe not all devices, but my HTC m8wlv can not flash firmware when the bootlader locked

---------- Post added at 03:18 AM ---------- Previous post was at 03:13 AM ----------

My HTC M9 not banned to any carrier, but before one month I sent back to HTC to repair, maybe they do that because when I bought it unlocked but after repair they were locked it