yashsingh1/xdaforums huggingface dataset:
[One (M7) General] scotty1223:
if you are s off,all you need to do is pack your recovery image with an android-info document that you pull from a firmware package for your device/variant. the image must be named "recovery" and not "recovery-twrp-m7" or whatever it happened to be. zip them up,the zip file can be named whatever.

install the zip file like this:

fastboot erase cache

fastboot oem rebootRUU

fastboot flash zip zipname.zip

after it finishes,you can

fastboot reboot-bootloader (wich will also get you back to normal fastboot if something goes wrong)

fastboot reboot
[One (M7) General] scotty1223:
you cant. youll have to install a custom recovery(see post above),then re-install a stock one in the same manner or run an ruu.
[One (M7) General] sjorge3442:
So i need to:

1) flash twrp

2) install Superuser

3) flash stock recovery

4) lock bootloader

5) delete and remove superuser files.

This will work, right?
[One (M7) General] scotty1223:
Yup :)

If you've changed cid or mid,make sure you restore them prior to removing su as well.
[One (M7) General] sjorge3442:
Cool. Good stuff. I am going to take care of this tonight so I can finally send back to AT&T
[One (M7) General] sjorge3442:
sooo. I installed twrp, flashed a stock recovery and when i run echo -ne '\x00\x00\x00\x00' | dd of=/dev/block/mmcblk0p3 bs=1 seek=33796 , it says cannot open for write.

Any suggestions?
[One (M7) General] Uzephi:
Do you have su access? Need su to run that command.
[One (M7) General] sjorge3442:
Yeah I had installed SuperUser with TWRP. I ended up using Guru Bootloader Reset Tool to lock the boot loader. I am still S-Off right now, so I think the next step would be to flash the RUU file now and then once it reboots, turn S-off back to S-On?
[One (M7) General] Uzephi:
Correct
[One (M7) General] scotty1223:
I wouldn't. If you have an htcdev compatible device and are on an s offable firmware you can try it.

If something isn't quite right,it's possible s on will result in a security warning or the reappearance of the tampered banner

I persoanally would run the ruu and leave it s off
[One (M7) General] tetakpatak:
You don't need S-On for guarantee, sjorge3442. I would leave it off.

tetakpatalked from N7100
[One (M7) General] nkk71:
i would stay s-off too, but if you want 100% stock (including safely going s-off to s-on), you can check out my guide:

http://xdaforums.com/showthread.php?t=2541082
[One (M7) General] sjorge3442:
Oh. Never thought to just run the OTA update. Now that I am on stock recovery with locked bootloader I should be good to go with this right? Just run the OTA and let it do its thing at this point? When I returned my last One for warranty work, I dont remember it being this difficult.
[One (M7) General] nkk71:
OTA?? that's only needed if you're using CWM restored method (for those who don't have an RUU available), since you're on AT&T (so MID=PN0712000 and CID=CWS__001), you just RUU back and be done with it.
[One (M7) General] andyjohhg:
HTCDev Unlocker not working

Im a newbie here sorry, have been unable to get OTA update to install Check /data/preload/soundhound_freemium.apk failed, error No such file or Directory () so after some reading thought I'd unlock bootloader and install a stock rom then try again. Followed instructions on the HTC dev ste everything appears to work but after wiping the phone and restarting bootlocker is still locked. Found this site that says unlock without using HTC dev however it states you need S off, in order to get S off I need to unlock the boot loader, catch 22. How can I do this seem to be going around in circles. Thanks have M7 UL PVT SHIP S on HBOOT 1.56
[One (M7) General] FxJohnnyEng:
WHEN WE RELOCK BOOTLOADER and REMOVED TAMPERED FLAG.

WILL MY DEVICE LOST THE CURRENT OS?

WILL MY DEVICE LOST CURRENT CUSTOM RECOVERY?

Thanks :)
[One (M7) General] tetakpatak:
NO AND NO

You're welcome.

tetakpatalked from P5110
[One (M7) General] FxJohnnyEng:
Thanks bro for the response

so the procedure i gonna perform as below. I have nandroid backup for the stock rom.

I will restore the stock rom using CWM.

Then i relock bootloader and remove tampered flag.

Is my device safe to send to HTC for warranty repair?

Thanks again ya :)
[One (M7) General] Reza::::600:
hi

1- can i use this thread in HTC one Dual 802w with Stock 4.4.3 rom?

2- may i use SuperSu for this thread instead superuser ?

thanks
[One (M7) General] scotty1223:
1) look back thru the thread and see if its been verified (i honestly don't remember)

2) yes
[One (M7) General] scotty1223:
Return to stock:

-restore mid

-restore cid

-remove tampered

-lock bootloader

-restore stock os/recovery/firmware (preferably by running an ruu)
[One (M7) General] ancola66:
Forgive my stupid questions because I go back a long time not to use HTC :

My M7 have s-off, super CID but locked and and no superuser ( device OTA update notification but I do not update ).What do I do next to flashing custom rom. Very thanks.
[One (M7) General] tetakpatak:
Just unlock the bootloader (that will wipe all your data) and flash via fastboot any custom recovery if you didn't yet and then you can flash zips of any ROM in recovery.

tetakpatalked from Nexus 7 flo
[One (M7) General] ancola66:
Very thanks for your help and use the tools in this topic or with htcdev to unlock bootloader?. Sorry, I was asked many because I bought this device second hand ( I'm not used from the first) :o

p/s: as far as I know, my device is using the stock TELUS rom because I saw TELUS featured app icon in the application menu but I used to be with my Vittel sim card (network of Vietnam)
[One (M7) General] ancola66:
All Done! >>> Unlocked, S-off and Supercid :D, thanks you for all xda developers.
[One (M7) General] uwotm7:
Does this still work on HBOOT 1.57, T-Mobile?
[One (M7) General] Big Bread:
Fantastic, worked on my HTC One M7 UL S-OFF with TWRP.
[One (M7) General] bimobae:
thanks very much,you make this so easy man :)
[One (M7) General] HudanAchmad:
Ask

can you explain step by step in Indonesia ? Tolong Hehehe:)

---------- Post added at 02:13 PM ---------- Previous post was at 02:06 PM ----------

why when I'm flash the zip (on flash the customrecovery) , this always show

C:\adb>fastboot flash zip a.zip

sending 'zip' (11602 KB)... OKAY [ 2.319s]

writing 'zip'... INFOzip header checking...INFOzip info parsing...

INFORead zipped android_info fail

FAILED (remote: 24 parsing android-info fail)

finished. total time: 2.578s

Hboot 1.57

4.4.3

Thanks
[One (M7) General] alray:
probably because the android-info.txt file is missing from the package you are flashing or because the info inside doesn't match your phone specs (CID/MID)

And you don't flash a recovery using "fastboot flash zip name_of_file.zip" its "fastboot flash recovery name_of_recovery.img" and there is no header check when flashing a custom recovery.

IDK what you are trying to do but you are doing it wrong. Maybe providing more info about your phone and what you are trying to do would help...
[One (M7) General] HudanAchmad:
ok, i want to unlock . my phone is s-off , Hboot 1.57

in this Thread, I must flash customrecovery. so I can root my phone, and I can unlock.

but I'm confused with this step ( look at post #333)

thanks :)
[One (M7) General] nkk71:
do the commands while booted into custom recovery (flashed using a masked firmware):

http://xdaforums.com/showpost.php?p=54076760&postcount=300
[One (M7) General] HudanAchmad:
thanks

Thanks alot , :) . Now I have customrecovery and rooted,but i have new problem.

when i'm execute the command

C:\miniadb_v1031>adb reboot bootloader

C:\miniadb_v1031>adb devices

List of devices attached

____________________________(this is blank space, in firstpage . it must contain with "my_device_serial_number recovery")

C:\miniadb_v1031>adb shell

error: device not found

C:\miniadb_v1031>
[One (M7) General] nkk71:
Try FAQ #2 http://xdaforums.com/showthread.php?p=52135024
[One (M7) General] nathan.r.bristow:
Does this method of locking the boot loader work for hboot 1.57?

I am unlocked, S-OFF, but no tampered flag. I am using stock ROM, but I want to relock the boot loader to send in for warranty repairs on the camera

Thanks!
[One (M7) General] tetakpatak:
Yes, it should work normally :)

Just don't go S-On, as it doesn't matter for the warranty and it can be nasty to get rid of it.

tetakpatalked from Nexus 7 flo
[One (M7) General] bower1994:
Hi there, i was reading stuff to send my phone to the warranty because the phone has a faulty microphone and i was trying to set it back to stock.

are you 100% sure that there is no need to put the phone s-on? just locking the bootloader would be enough to send it?? and why? it's the first time i read sometinhg like that... maybe i'm a bit confussed.
[One (M7) General] hacka247:
If it's UK leave it s-off as it won't make a difference but your phone will come back s-on anyways so up to you but as it stands it won't void warrenty in UK anyways.
[One (M7) General] overthatscreen:
So I'm picking up brand new M7 today for At&t. From what I've read, this should work just fine. I assume I have to root and perform this before updating. Is that right?
[One (M7) General] deeevan:
As per thread title, S-OFF is required so you'll have to do that first.
[One (M7) General] anko184:
Guys i have an issue using this method.. I Locked my HTC One using the OP's command and returned it to s-on in order to send it back to htc to replace the camera module (purple tint issue)..

Now i got it back but when i try to unlock the bootloader through htcdev nothing happens on the phone (no unlock screen pops-up). Can anyone help me??
[One (M7) General] romano19:
hi. My phone has unlocked bootloader, s-off, custom recovery (with stock fw 4.4.2). Now I want to upgrate FW by OTA. So I just relocked bootloader or to do anything else? pls help me. thank you
[One (M7) General] scotty1223:
You don't need to relock the bootloader or turn s on. Do NOT turn s on!!

All you need to do is run a release keys ruu so you're on un modified software and a stock recovery.

Once again,do NOT turn s on!!!
[One (M7) General] scotty1223:
Does your token flash successfully? Other than that,not sure what could be wrong.
[One (M7) General] anko184:
Yes it does.. I assume that locking the phone with the command that you provide although it locks the bootloader,

it doesn't inform it that it's locked. The Lock somehow is cosmetic therefor when flashing the token nothing happens..

The token doesn't trigger any command in order to have the unlock screen pop up..
[One (M7) General] scotty1223:
your assumptions are incorrect. the command changes the flag that hboot checks to see if it is in a locked,or unlocked state. as such,the flag tells the bootloader wether or not to be legitimately locked or unlocked,there is nothing cosmetic about this.

the bootloader unlock by htcdev is a function of hboot,and not affected at all by this command. upon flashing the unlock token,hboot should show the pop up,wich will set the flag and wipe data,among other things(reference this thread) if you select the unlock option

not showing the pop up is an issue with hboot,or possibly with some other data that we do not know about,or possibly due to hardware mismatches. ive heard of unlock issues when phones are sent in repair,but id have to go back and research wether the token was failing or the issue was same as yours.

ill continue to ponder it and research,but at this time you seem to have 3 options:

1)use sunshine for s off

2)run an ruu if one exists for your current s on state,followed by a factory reset(wouldnt hurt to factory reset even without an ruu)

3)call htc and tell them you cannot unlock your bootloader

this is a good example of why i personally would never turn s back on. even for warranty work.
[One (M7) General] Golv:
I know that very well! I'm owner of HTC is

not first year

(HTC Touch Dual, DesireHD, Sensation)! ;)

And I do everything myself, using the HEX- editor! I tried to explain that flag seek = 33796, appear to cut the size of file! Size of the original mmcblk0p3 should be - 133 807 104 b, and therefore after running all the offsets after 0x008404 can be filled with 00 ! After the offset 0x008408 there is some data that will be filled with zeros.

For proper treatment you need to add the flag :

conv=notrunc

The notrunc conversion option means do not truncate the output file — that is, if the output file already exists, just replace the specified bytes and leave the rest of the output file alone.

And the line should look like this :

echo -ne '\x00\x00\x00\x00' | dd of=/dev/block/mmcblk0p3 bs=1 seek=33796 conv=notrunc

Then all data ( from 0x008409 to the end of block 0x07f9bbff) after recording 4 bit (0x008404 - 0x008408) - will remain in place and will not be filled 00 ! !

I hope I've clearly explained? Check it out!

For information (Data modification)....

Awairing your prompt reply!

PS: Please try to run 2 bat files: with notranc and without notranc and compare files!
[One (M7) General] Golv:
Here scripts (*.bat) to run from command line in one click.

These scripts makes backup of the /dev/block/ and puts it in a folder with script, change block in /dev/block/ and reboots into bootloader for check.

All scripts are tested by me. Changes only necessary data, and rest remained unchanged.
[One (M7) General] scotty1223:
thanks for the tips,but again,i think the variance is the way youre collecting your data. ive looked at an unknown number of mmcblk0p3 from different devices,and the command does not alter the file size. ive looked before and after. the rest of that block is zeros(nulls) to start with,the command isnt truncating or writing them.

after you issue the command,you see its only writing 4 bytes.

more accurate way to check the work of the command is to

-dd p3 to sd card,pull and observe

-run command

-dd p3 to sd card,pull and observe,compare
[One (M7) General] Golv:
Size of each block in /dev/block/ CAN'T be changed, block can be OVERWRITTEN only! Therefore, when you run your script without "conv = notrunc" data is changed only at specified offset and size (in this case from 0x008404 to 0x008408), and rest of data remains from original block ( I assumed that rest of data filled with 00 and very well that I was wrong! ) .

BUT if this script without "conv = notrunc" run in other directory ( eg /data/local/temp/), then file will be CROPPED!

It's wrong, therefore it's necessary to use option "conv = notrunc".

Example in my post : http://xdaforums.com/showpost.php?p=46731712&postcount=21

And thank you for your work!
[One (M7) General] scotty1223:
thanks again for your posts,but im still not sure what to tell you. i have looked at mmcblk0p3 before and after the command and have not found the changes you describe. perhaps i am not understanding.
[One (M7) General] Golv:
I wanted to say:

Copy mmcblk0p3 in /data/local/tmp/ ( dd if=/dev/block/mmcblk0p3 of=/data/local/tmp/mmcblk0p3_backup_1 ) and apply your script:

adb shell
su
chmod 755 /data/local/tmp/mmcblk0p3_backup_1
echo -ne '\x00\x00\x00\x00' | dd of=/data/local/tmp/mmcblk0p3_backup_1 bs=1 seek=33796

and see what happens with file mmcblk0p3_backup_1!

And then again copy mmcblk0p3 in /data/local/tmp/ ( dd if=/dev/block/mmcblk0p3 of=/data/local/tmp/mmcblk0p3_backup_2 ) and apply your script script with option bs=1 seek=33796 conv=notrunc :

adb shell
su
chmod 755 /data/local/tmp/mmcblk0p3_backup_2
echo -ne '\x00\x00\x00\x00' | dd of=/data/local/tmp/mmcblk0p3_backup_2 bs=1 seek=33796 conv=notrunc

Once again look what happened with file mmcblk0p3_backup_2 ...

After compare, you'll see the difference. That's what I wanted to say. ;)
[One (M7) General] scotty1223:
I do not understand the significance of doing that.
[One (M7) General] Golv:
Not always good to make changes once in system partition! Sometimes it's better to copy, make changes, and then reload changed file into the system partition.

And in your case options to change the file written is not entirely correct.
[One (M7) General] maarawoe:
Gyus this sounds tooo easy for me... :D

Could you please ensure me that when I am s-off I can lock and unlock my bootloader using this simple command on my will? No data loss, no wipe, no matter what is my rom etc...?? Really so easy? :)

EDIT: I just tried and yes - its really so easy :))
[One (M7) General] scotty1223:
lol,glad it was helpful :)
[One (M7) General] gjlowe:
This worked perfectly. Unfortunately it did not allow Google Drive to believe that the HTC One was bootloader-locked and give me the free 40GB of space :(. I think they must be checking for S-OFF.
[One (M7) General] maarawoe:
Nothing to do with the s-off....

Check this thread http://xdaforums.com/showthread.php?t=2497148
[One (M7) General] gjlowe:
Thanks - yeah found it right after this one. I think it must be the Google Drive update.
[One (M7) General] scotty1223:
thisis not a fake hboot,or visual banner change,it is

legitimately unlocking and unlocking

,just like htcdev,so it stands to reason that it doesnt work,if locked bootloader is a requirement.

just lock the bootloader,if you want the space. if you cant re-unlock once youve claimed it,then just leave it locked. all that being unlocked gets you is a couple extra fastboot commands. you can still install recoveries,splash images,radios etc. with the bootloader locked.
[One (M7) General] jaypeg123:
I just done it. It Works 100% although I had to try several Times before I got it tight. But that is just normal for me, ha ha

So of to the store and get me a working Camera.

:):thumbup:
[One (M7) General] stephl:
Thanks, 100% first time round.....:good:
[One (M7) General] intramorph:
Just a question ... How does Revone leave tracks? I assure you it doesn't as I had to return my phone to HTC and get it replaced. Revone was easyer way to lock unlock bootloader and also more convinient. However I'm not complaining as rumrunner s-offed my 1.55 h-boot. so yeah I'm happy that either method exists . IT'S AWESOME !!!!!
[One (M7) General] zaphodbeeb:
there is no revone file left on your phone. No tracks.
[One (M7) General] intramorph:
But you can easily remove the file. This is not even worth mentioning
[One (M7) General] EtherealRemnant:
Thanks for this, it was much easier than dealing with revone and I got my free 25 gigs on Google Drive :D:good:
[One (M7) General] anko184:
1) Unfortunately i can't s-off now because the phone was send to service for repair and they update it to 7.19.401.2 version and therefor sunshine can't work on it.

2) I can't find an appropriate RUU as of now. Please tell me if you find it.. Also i already did a factory reset without any luck. Also i tried to flash the stock firmware again without any luck either.

3) I don't think that they would help me with that, but i 'll give a try when my phone returns again from service.

Thanks a lot for your help.. And if you find anything regarding this issue please let me know..
[One (M7) General] alray:
The 7.19.401.2 ruu.zip is available in 2 different threads in the general section.

http://xdaforums.com/htc-one/general/lollipop-ruu-zip-small-collection-t3053944

http://xdaforums.com/htc-one/general/htc-one-m7-european-signed-ruu-t3048384
[One (M7) General] anko184:
Those are zip's. I'm pretty sure i'll need a RUU.exe in order to fully restore the device..
[One (M7) General] scotty1223:
the zip will work fine. It is the same thing the .exe is installing.

If you have a machine with enough ram,you can install the zip from Fastboot/ruu mode. Failing that,you can rename it,then install from a FAT32 formatted sd card and otg cable(it may need to be a powered Y cable) and hboot. The name and format are important.

Sent from my HTC One max
[One (M7) General] iuly_vn:
Hi, asking for a little help. I was unlocked M7 with revone metod- s-off and status unlock. Now the phone has update to stock fw 7.19.401.2 via OTA and it is S-OFF and unlocked too. Can i Locked it again with this metod? I want to send it back to htc to replace the camera module (purple tint issue) Also i must get S-ON but when im trying to downgrade to stock version 1.29.401.16, by RUU metod /to be able to use comand revone -l/, it send me error code 155. How i can downgrade to 1.29.401.16 from 7.19.401.2?

Error code is: "ERROR [155~159]: IMAGE ERROR

One of these error messages will appear when you use the incorrect RUU to update and the image file size is larger than the Flash ROM size. In this case, download the correct RUU version and try again."

But Im sure, that my RUU 1.29.401.16 is correct! I thing also that the update 7.19.401.2 resize the partitions of memory, and then it is impossible to downgrade to 1.29.16 or similar stock?!

Solved.
[One (M7) General] GIA131:
Guys i've got a problem. Finally i flash the ruu so now i need to lock my htc.

All works fine but when i put the command su it told me not

So i tried to put the echo command and it told me that i haven't the permission.
[One (M7) General] PlayPetepp:
You probably aren't rooted.

-. typewrited .-
[One (M7) General] ach1:
Hey guys, I'm trying to revert to the stock sense rom and first unlock my bootloader again so I can flash the rom - atm it's still marked 'RELOCKED'.

I have s-off, USB debugging enabled.

After fastboot erase cache

I've flashed the token to which I get..

But NO splash screen asking if I want to unlock afterwards like so many tutorials have shown.

Also tried fastboot oem unlock with no success. Tried all above again after a factory reset and nothing :(

Can somebody help/suggest what may be wrong?

Thanks
[One (M7) General] alray:
answered your question in the other thread.
[One (M7) General] Jayzonl:
Hi there, I need to send my phone back to Verizon for a warranty replacement and wanted to verify some of these instructions before I proceed. I have RUU'd back to a stock ROM/recovery/etc; looking to lock the bootloader and S-ON. My HBOOT is 1.61.0000, CID-VZW_001. Will the command lines in the first post work for me? Assuming I need to re-root and install superuser to do that? Thanks for any help.
[One (M7) General] Uzephi:
Yes, they will
[One (M7) General] tester2:
method from first post will work on S-OFF'ed HBOOT 2.49?
[One (M7) General] Uzephi:
Yes, it will.
[One (M7) General] hunting_:
plz anyone help me i want to unlock my htc m7 bootloader im on s off

im on 4.4.3 hboot1.60 i try to unlock from htc site but im not getting unlock options
[One (M7) General] alray:
What is your "fastboot getvar all" ?
[One (M7) General] zorbakun:
how can I install recovery with locked bootloader?
[One (M7) General] Theshawty:
Rename it recovery.img and pack it into a zip file with an android-info.txt and flash it from rebootRUU using

fastboot flash zip name.zip

Where "name" represents the name of the zip.

To reboot into rebootRUU

fastboot oem rebootRUU

Enter the above while in "fastboot-USB" mode.

The android-info should look somewhat like this:

modelid: PN0710000
cidnum: 11111111
cidnum: HTC__001
cidnum: HTC__E11
cidnum: HTC__102
cidnum: HTC__203
cidnum: HTC__405
cidnum: HTC__Y13
cidnum: HTC__304
cidnum: HTC__032
cidnum: HTC__A07
cidnum: HTC__016
cidnum: HTC__J15
mainver: 3.57.401.500
btype:1
aareport:1
hbootpreupdate:3

of course you have to alter the modelid, cidnum and mainver to match your current setup.
[One (M7) General] scotty1223:
Easy way to get a correct android info text document is to simply borrow it from an otapkg or ruu zip fie that you have used.

It's a couple extra steps,but how often do you change recovery?

Same method works to change splash image,firmware,etc
[One (M7) General] Theshawty:
Indeed it does. :D But with all the power S-OFF gives comes an incredible amount of carefulness/responsibility. :p
[One (M7) General] FreeK200:
Will this method work for a 1.55 hboot, or does it not make a difference at all?
[One (M7) General] PillowMetal:
Also, if you flash the PN07IMG.zip on the phone from within hboot using a powered USB-OTG cable (the old school method used when we all had SD Cards), you can use an empty android.txt file.
[One (M7) General] SuperStar1080:
Can I just flash an older T-Mobile RUU to get the 1.44 unpatched hboot so I don't have to root my phone?
[One (M7) General] Prema:
Yep works as well on hboot 1.55 (S-OFF)