[how to] lock/unlock your bootloader without htcdev(s-off required)

Search This thread

henryrk

Senior Member
Feb 24, 2007
122
4
hi i think new ota cant use this?

C:\Users\h\Desktop\miniadb>adb shell
shell@htc_m8:/ $ su
su
1|shell@htc_m8:/ $ echo -ne '\x00' | dd of=/dev/block/mmcblk0p6 bs=1 seek=5314564
lock/mmcblk0p6 bs=1 seek=5314564 <
/dev/block/mmcblk0p6: cannot open for write: Permission denied
1|shell@htc_m8:/ $ echo -ne '\x00\x00\x00\x00' | dd of=/dev/block/mmcblk0p2 bs=1 seek=33796
dd of=/dev/block/mmcblk0p2 bs=1 seek=33796 <
/dev/block/mmcblk0p2: cannot open for write: Permission denied
1|shell@htc_m8:/ $ exit
exit

my getvar


C:\>fastboot getvar all
(bootloader) version: 0.5
(bootloader) version-bootloader: 3.19.0.0000
(bootloader) version-baseband: 1.22.21331147A1.29G
(bootloader) version-cpld: None
(bootloader) version-microp: None
(bootloader) version-main: 3.32.707.9
(bootloader) version-misc: PVT SHIP S-OFF
(bootloader) meid: 00000000000000
(bootloader) product: m8_ul
(bootloader) platform: hTCBmsm8974
(bootloader) modelid: 0P6B11000
(bootloader) cidnum: HTC__044
(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: a3d0cb0d
(bootloader) hbootpreupdate: 11
(bootloader) gencheckpt: 0


tthanks
 

scotty1223

Inactive Recognized Contributor
Jan 3, 2011
2,813
3,056
hi i think new ota cant use this?

C:\Users\h\Desktop\miniadb>adb shell
shell@htc_m8:/ $ su
su
1|shell@htc_m8:/ $ echo -ne '\x00' | dd of=/dev/block/mmcblk0p6 bs=1 seek=5314564
lock/mmcblk0p6 bs=1 seek=5314564 <
/dev/block/mmcblk0p6: cannot open for write: Permission denied
1|shell@htc_m8:/ $ echo -ne '\x00\x00\x00\x00' | dd of=/dev/block/mmcblk0p2 bs=1 seek=33796
dd of=/dev/block/mmcblk0p2 bs=1 seek=33796 <
/dev/block/mmcblk0p2: cannot open for write: Permission denied
1|shell@htc_m8:/ $ exit
exit

my getvar


C:\>fastboot getvar all
(bootloader) version: 0.5
(bootloader) version-bootloader: 3.19.0.0000
(bootloader) version-baseband: 1.22.21331147A1.29G
(bootloader) version-cpld: None
(bootloader) version-microp: None
(bootloader) version-main: 3.32.707.9
(bootloader) version-misc: PVT SHIP S-OFF
(bootloader) meid: 00000000000000
(bootloader) product: m8_ul
(bootloader) platform: hTCBmsm8974
(bootloader) modelid: 0P6B11000
(bootloader) cidnum: HTC__044
(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: a3d0cb0d
(bootloader) hbootpreupdate: 11
(bootloader) gencheckpt: 0


tthanks
You are not rooted. re read the original post.

Sent from my HTC0P3P7 using Tapatalk
 

Ampicillin

Senior Member
Mar 17, 2010
669
15
Tianjin
Is this method still works with latest 4.4.4 and 3.28.401.9 firmware and latest hboot? I want to unlock the bootloader without htcdev
 

Jamal Ahmed

Senior Member
Jun 23, 2012
942
979
I'm on Google Play Edition Lollipop, and want to relock bootloader to get Drive storage. Will my storage be wiped after I relock from this method? If not, then will it be wiped if I unlock again after getting the Drive storage? A bit off-topic but is it possible to get Drive storage on Google Play Edition version?
Thank you, I hope someone can answer these 3 questions :)
 

jshamlet

Senior Member
Aug 25, 2014
997
313
I'm on Google Play Edition Lollipop, and want to relock bootloader to get Drive storage. Will my storage be wiped after I relock from this method? If not, then will it be wiped if I unlock again after getting the Drive storage? A bit off-topic but is it possible to get Drive storage on Google Play Edition version?
Thank you, I hope someone can answer these 3 questions :)

No. One of the advantages of this method (and probably why Sunshine uses it) is that it doesn't trigger the format of user data. You can lock/unlock at will.
 
  • Like
Reactions: Jamal Ahmed
It should. An OTA does not generally change anything at the level at which that this works

Sent from my HTC One using Tapatalk

Thank you Scotty. I have bootloader 3.19, but I am not sure if that makes a difference or not. I'm thinking that HBOOT is separate from Bootloader, right?
I'll let you know what happens (crossing fingers....)

EDIT:
Successfully locked bootloader. Trying to get the Google Drive bonus....
Thank you!

EDIT 2:
Apparently the locked bootloader doesn't fool HTC. I couldn't get the drive space...

EDIT 3:
Removing the tampered flag AND locking bootloader did the trick. Got the Google Drive space update!
 
Last edited:

bambam1978

Senior Member
Dec 7, 2010
419
38
hi

Bell canada htc one m7 and i copy and pasted the adb command to lock the bootloader
shell@m7:/ $ su
su
root@m7:/ # echo -ne '\x00\x00\x00\x00' | dd of=/dev/block/mmcblk0p2 bs=1 seek=3
3796
of=/dev/block/mmcblk0p2 bs=1 seek=33796 <
4+0 records in
4+0 records out
4 bytes transferred in 0.018 secs (222 bytes/sec)
root@m7:/ # exit
exit
shell@m7:/ $ exit
exit

C:\Android>adb reboot-bootloader

but my bootloader is still unlocked?? Any ideas guys?
 

scotty1223

Inactive Recognized Contributor
Jan 3, 2011
2,813
3,056
Bell canada htc one m7 and i copy and pasted the adb command to lock the bootloader
shell@m7:/ $ su
su
root@m7:/ # echo -ne '\x00\x00\x00\x00' | dd of=/dev/block/mmcblk0p2 bs=1 seek=3
3796
of=/dev/block/mmcblk0p2 bs=1 seek=33796 <
4+0 records in
4+0 records out
4 bytes transferred in 0.018 secs (222 bytes/sec)
root@m7:/ # exit
exit
shell@m7:/ $ exit
exit

C:\Android>adb reboot-bootloader

but my bootloader is still unlocked?? Any ideas guys?
You're writing to the wrong partition. this thread is for m8

Sent from my HTC One using Tapatalk
 
Last edited:
  • Like
Reactions: bambam1978

scotty1223

Inactive Recognized Contributor
Jan 3, 2011
2,813
3,056
lol duh thats what happens after working a 12 hour midnight shift!!!
I should have mentioned this earlier, be aware that you have damaged your stock p2 and will brick your phone if you attempt to turn it back to s on.

The best way to fix this is to find and flash a firmware.zip for your particular variant.

You are not by any means the first to make this mistake, & I thought I had put a big warning right at the top of the first post of the thread. Apparently I haven't, so I'll make sure I get that added

Sent from my HTC One using Tapatalk
 
  • Like
Reactions: The Fer-Shiz-Nizzle

winner61

Senior Member
Oct 24, 2008
104
5
Amsterdam
You're writing to the wrong partition. this thread is for m8

Sent from my HTC One using Tapatalk

OK, that makes sense. But it does not make sense that the pictures in the first post are from a m7. That put me on the wrong idea it was for the m7.
I came across this by a search and did not look at the forum title at first.
Can you Scotty or anyone direct or tell me (and maybe some others) (to) the right shell lock/relock lines for the m7
searched the m7 general forum but could not find it.

It would be very much appreciated. Thanks.
 

scotty1223

Inactive Recognized Contributor
Jan 3, 2011
2,813
3,056
OK, that makes sense. But it does not make sense that the pictures in the first post are from a m7. That put me on the wrong idea it was for the m7.
I came across this by a search and did not look at the forum title at first.
Can you Scotty or anyone direct or tell me (and maybe some others) (to) the right shell lock/relock lines for the m7
searched the m7 general forum but could not find it.

It would be very much appreciated. Thanks.
The pics are because I didn't have m8 at the time,and there is an explanation of that afterwards.

Go to m7 general and post this title in the search box.

Sent from my Nexus 9 using Tapatalk
 
  • Like
Reactions: winner61

BerndM14

Senior Member
Apr 8, 2014
1,454
543
OK, that makes sense. But it does not make sense that the pictures in the first post are from a m7. That put me on the wrong idea it was for the m7.
I came across this by a search and did not look at the forum title at first.
Can you Scotty or anyone direct or tell me (and maybe some others) (to) the right shell lock/relock lines for the m7
searched the m7 general forum but could not find it.

It would be very much appreciated. Thanks.

It's the same command, the only difference is the partition to which you write it. On the M8 it gets written to mmcblk0p2 on the M7 it gets written to mmcblk0p3

http://xdaforums.com/showthread.php?t=2475914
 
  • Like
Reactions: winner61

Top Liked Posts

  • There are no posts matching your filters.
  • 86
    READ THIIS!
    *this thread is for m8. it will NOT work on m7,or any older device. please check the general forum for your particular device for a similar thread.


    this thread will let you unlock your bootloader without htcdev,or let you change your hboot watermark from relocked or locked back to stock.


    advantages
    -no hassle with htcdev,tokens,or unlock codes
    -no submitting your phones personal info to htc
    -the ability to get back to 100% stock without any visual traces or records of having been s off or unlocking your bootloader.

    you do NOT need to downgrade your hboot. this simple adb command works without any scary hboot downgrades.

    *you must be s off.
    *you must have superuser installed

    read this:
    this will not work if your s on. its not a way to magically unlock

    the usual disclaimers:
    use this info at your own risk. if it melts your phone into a little pile of aluminum goo,its not my fault.

    credits
    -beaups for schooling me on echo comand protocol
    -strace for originally discovering the location of the lock status flag(check out this thread for more info)
    -kdj67f for fearlessly testing on vzw m7_wlv and putting up some screenshots in post 2. thanks!
    -matthew0776 for fearlessly testing for sprint m7_wls
    *i dont have m8. let me know if it works and ill add you to the credits.

    IF you are an advanced user with adb/fastboot set up and some basic knowlede of the cmd window,you can skip to #2
    1)set up adb(windows 7 and older)


    -download this file
    -install drivers: if you have htc sync installed,you should allready have drivers. if not,you can install htc sync,or install these modified htc drivers from revolutionary (driver mirror)
    -unzip your miniadb_v1031.zip file. this is native funtionality in windows 7. you otherwise may need a utility such as "7-zip" to extract,or unzip it. place the unzipped folder onto the root of your C drive on your PC. root means the top level,not inside any folders. so just copy and paste,or drag and drop the folder onto C with everything else that is there. you may want to rename it to "miniadb_m7" since youll be putting some device specific files in here.
    -open a command window. on windows 7,click the start bubble in the lower left and type "command" in the search box. xp i believe is similar or the same. doing this should open a small black command window.
    -change to your miniadb_m7 directory. type the following at the prompt in your cmd window:

    cd c:\miniadb_m7

    your command promt should change to "c:miniadb_m7>" provided you: 1)unzipped the miniadb_v1031 zip file,and 2)put the folder on your c drive,and 3)entered the name of the folder correctly ("miniadb_m7" in this case)

    -now make sure usb debugging is checked in developer options(you will need to turn it on first),and plug your phone into your PC with a usb cable
    -make sure your phone is being recognized- type:

    adb devices

    if your drivers are installed correctly,this should return your phones serial number. you should hear the "found device" noises when you plug your phone in. if it starts installing drivers,wait for it to finish before typing the adb devices command.

    if you get your serial number back,then enter this command:
    adb reboot bootloader

    this should take your phone to the "fastboot" screen,wich is white with colored letters. this is one mode of your bootloaders interactive modes. at the top youll see fastboot devices as confirmation youre in fastboot.

    now enter:
    fastboot devices
    again,this should return your phones serial number. you should hear the "found device" noises when you plug your phone in. if it starts installing drivers,wait for it to finish before typing the adb devices command.

    if you get your serial number back,you can enter the following to boot back to the phones OS:
    fastboot reboot

    and now,youve installed adb/fastboot and tested youre phones drivers. if at either spot,you have trouble and dont get your serial number back,there is some sort of connection issue. use these steps to troubleshoot:
    troubleshooting connectivity issues:
    -try a reboot of the PC
    -try different usb cables and ports
    -dont use a usb hub
    -dont use usb 3.0
    -make sure nothing capable of comunicating with the phone is enabled and running. htc sync,pdanet,easy tether,and even itunes have all been known to cause issues.
    -windows 8 has been known to have issues. try a windows 7 or older machine

    failing the above,
    -i use these drivers for fastboot and adb(donwload and run as admin): http://downloads.unrevoked.com/HTCDriver3.0.0.007.exe (mirror)

    failing that,try manually updating the drivers in the following manner:
    -put the phone in fastboot mode(select fastboot from the hboot menu)
    -open device manager on the PC
    -plug in phone,watch for it to pop up in device manager.
    -update drivers with device manager,pointing the wizard to the extracted
    driver download folder from above

    note that you can check the connectivity of the phone,and make sure drivers are working by in the following manner:
    -open cmd window. change to directory containing adb/fastboot utilities

    -adb with the phone in the booted OS,usb debug enabled,enter:
    adb devices in a cmd window

    -fastboot with phone in fastboot,enter:
    fastboot devices in cmd window

    in either case,a properly connected phone with working drivers installed should report back the phones serial number.

    this process,in your cmd window,should look something like this:
    Code:
    Microsoft Windows [Version 6.1.7601]
    Copyright (c) 2009 Microsoft Corporation.  All rights reserved.
    
    C:\Users\Scott>[COLOR="red"]cd c:\miniadb_m7[/COLOR]
    
    c:\miniadb_m7>adb devices
    * daemon not running. starting it now on port 5037 *
    * daemon started successfully *
    List of devices attached
    FAxxxxxxxxxx    device
    
    
    c:\miniadb_m7>[COLOR="red"]adb reboot bootloader[/COLOR]
    
    c:\miniadb_m7>[COLOR="red"]fastboot devices[/COLOR]
    FAxxxxxxxxxx    fastboot
    
    c:\miniadb_m7>[COLOR="red"]fastboot reboot[/COLOR]
    rebooting...
    
    finished. total time: 0.037s
    
    c:\miniadb_m7>


    2)reset your "lock status flag"

    to LOCK your bootloader,enter the following:

    adb devices

    adb shell

    su (if needed to get a # prompt)

    echo -ne '\x00\x00\x00\x00' | 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

    verify you are now locked
    _____________________________________________________________________________________________

    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

    verify you are now unlocked



    *i have tested this on my gsm htc one. if someone wants to test on vzw,ill add you to the credits :)





    (yes this is m7. i dont have an m8 yet)

    other useful threads:
    remove tampered banner: http://xdaforums.com/showthread.php?t=2708565
    change mid without an eng bootloader: http://xdaforums.com/showthread.php?t=2708581
    7
    Finally got it!

    Yes it is possible. Having a locked bootloader will NOT prevent you from flashing a recovery, firmware, or an ruu.

    Files just need properly packed as a zip file, you cannot use the fastboot flash command.

    Sent from my One using Tapatalk

    Dear scotty1223, StuMcBill, Brds7t7, skulldreamz, miggsr, EddyOS, David Cogen from "The Unlockr" site, the always available Mr. Hofs and all the others that I may have forgotten to refer,..

    THANK YOU ALL for your excellent support .. my HTC is finally stock (firmware and stock recovery) with my bootloader locked :D:D:D


    Let me just make a quick summary for future reference for all other users that may also need to bring their HTC One m8 fully stock and that may find some of the (maybe noob) problems that I found..


    Initial state: Unbranded HTC One m8 CID HTC__102 (s_off) with locked bootloader and with mikes1986 firmware ("Android Revolution HD 8.1 by mike1986")..

    Main objective: return device to full stock firmware like if it was coming directly from store....


    1. Used the excellent step by step tutorial from "The Unlockr" site in here..

    2. Downloaded the Stock nandroid and stock recovery for my CID (in this specific case, I downloaded "1.12.401.17 - TWRP Thanks to MaximN97" and "stock recovery 1.12.401.17") from Mr. Hofs thread

    3. After flashed the stock nandroid accordingly with the tutorial, I had trouble in flashing stock recovery... received error:
    "writing 'recovery'
    FAILED (remote: not allowed)
    finished. (...)"

    4. Mr. Hofs told me that was due to locked bootloader...

    5. Unlocked the bootloader following Scotty1223's post

    6. Flashed stock recovery flawlessly (following the above tutorial)..

    7. Ignored every HTC system updates that I was already getting notified in the device (not sure if it would have any impact);

    8. Tried to lock bootloader through the same post from Scotty1223, but no "# prompt" appeared when I was working with adb.. this was when I understood that this situation happened due to the fact that supersu had "disappeared" after flashed stock firmware (was unrooted)....

    9. Downloaded supersu from Google Play... although, when I ran it.. I received the message that it "wasn't possible to install the binary (bla (...) bla (...)".. spent several days trying to understand how could I solve that, since, without supersu I couldn't lock the bootloader...

    10. After lots of time spent and some posts...I finally got it... downloaded twrp's img (got it from here.. and placed it in fastboot directory and followed StuMcBill's tip

    11. When I was rebooting system in TWRP it told me that system was unrooted and if I wanted to install supersu.. I've installed it... after system reboot.. I ran supersu.. it asked for the binary update (again the fuc**** binary)... therefore,.. I downloaded the SuperSU v2.02 update from here (CWM / TWRP / MobileODIN installable ZIP), placed it in a directory from phone's SD card..and once again ran TWRP without flashing it, thru StuMcBill's tip... selected Install option in TWRP, selected the directory where I've placed SuperSU v2.02 update and installed it....

    12. After system reboot, Supersu was already working :highfive::highfive: ..locked the bootloader thru scotty1223's post already referred..

    13. Reboot system,.. uninstalled supersu, thru its uninstall option.. and .. ended all this long journey :D :cool: :cool:

    Hope that this could help anyone with the same problems.


    Thank you and my apologies for the long post.

    Best regards,
    SkElEtIkO
    4
    @scotty1223 will this royally mess anything up if I try this on my Sprint M8?

    Possibly. If the flag is in a different spot,and you overwrite something important. You can dump p2 and p6 and I can take a look,if you'd like.

    Sent from my HTC PG09410 using Tapatalk 2
    3
    A couple questions:

    1). Does this actually change you back to locked the way <fastboot oem lock> would? or is it just changing the header text?
    2). I see references to the Sprint M8 and this is in the M8 forum, but would if foul anyting up to try it on a Verizon M8 with the 3.16 HBoot?

    Thanks for the clarification.

    1) actual lock

    2) it will work on vzw m8

    Sent from my HTC One VX using Tapatalk