Post Reply

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

OP scotty1223

9th October 2013, 01:03 AM   |  #1  
scotty1223's Avatar
OP Senior Member
Thanks Meter: 2,367
 
2,304 posts
Join Date:Joined: Jan 2011
*this thread is for m7. it will not work on m8. search m8 general for the thread there(same name)


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

originally,we used a zip file flashable in recovery. i have found it to work on gsm devices with 1.44 hboot and CW recovery. it did not work with twrp. if the following is too scary,feel free to test the zip files. that thread,info,and downloads can be found here. since not all recoverys are working,these values can be changed with simple adb commands.

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(seethis post] if you need help installing a recovery so you can install superuser)

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 giving me the echo comand,so yall didnt need to dump,edit with a hex editor,and copy back
-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

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


-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:
Quote:

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>cd c:\miniadb_m7

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>adb reboot bootloader

c:\miniadb_m7>fastboot devices
FAxxxxxxxxxx    fastboot

c:\miniadb_m7>fastboot reboot
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/mmcblk0p3 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/mmcblk0p3 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




Last edited by scotty1223; 10th September 2014 at 12:44 PM.
The Following 76 Users Say Thank You to scotty1223 For This Useful Post: [ View ]
9th October 2013, 01:04 AM   |  #2  
scotty1223's Avatar
OP Senior Member
Thanks Meter: 2,367
 
2,304 posts
Join Date:Joined: Jan 2011
99% is good enough for me haha! Phone just hut 50% charged, give me a minute. Will post back with pictures.

Sent from my HTC6500LVW using XDA Premium 4 mobile app

---------- Post added at 08:56 PM ---------- Previous post was at 08:41 PM ----------

Confirmed, code working. Flags set/reset. Phone even reboots and works will upload pics/screenshots.

Thanks!

Starting out unlocked:

Locking:

Locked:

Unlocking:

Re-unlocked:


Very good work!
The Following 11 Users Say Thank You to scotty1223 For This Useful Post: [ View ]
10th October 2013, 12:29 AM   |  #3  
akuma24's Avatar
Senior Member
Thanks Meter: 31
 
435 posts
Join Date:Joined: Jan 2010
More
Any idea how you would get rid of the tampered flag?

Sent from my HTC One using xda app-developers app
10th October 2013, 01:47 AM   |  #4  
scotty1223's Avatar
OP Senior Member
Thanks Meter: 2,367
 
2,304 posts
Join Date:Joined: Jan 2011
Quote:
Originally Posted by akuma24

Any idea how you would get rid of the tampered flag?

Sent from my HTC One using xda app-developers app

http://forum.xda-developers.com/show....php?t=2477792
Last edited by scotty1223; 10th October 2013 at 10:49 AM. Reason: thot i was replying in the sprint general forum
The Following 4 Users Say Thank You to scotty1223 For This Useful Post: [ View ]
10th October 2013, 04:42 AM   |  #5  
Senior Member
Thanks Meter: 139
 
405 posts
Join Date:Joined: Mar 2013
Is this intended for people who got S-OFF and didn't use revone to unlock their bootloader at the same time? What would be the motivation for people doing that (not unlocking)?
10th October 2013, 07:10 AM   |  #6  
Junior Member
Thanks Meter: 1
 
19 posts
Join Date:Joined: Apr 2011
will this also remove the "Tampered" flag once S-on has been returned?
10th October 2013, 10:36 AM   |  #7  
scotty1223's Avatar
OP Senior Member
Thanks Meter: 2,367
 
2,304 posts
Join Date:Joined: Jan 2011
Quote:
Originally Posted by deeevan

Is this intended for people who got S-OFF and didn't use revone to unlock their bootloader at the same time? What would be the motivation for people doing that (not unlocking)?

it can be used for that,with the advantage of being able to unlock without having to submit ones perosnal phone info to htcdev for an unlock code(i.e. no record of having unlocked)

however,it is moreso intended for folks who are unlocked to get back to 100% stock locked. fastboot oem lock gets you relocked and before anyone can suggest it,using the bootloader modifier to just change the banner is IMO fraud.

if you need to return a phone for a legitimate warranty claim,its easy to make it 100% correct in case it makes it back out into the public

Quote:
Originally Posted by broli-zn

will this also remove the "Tampered" flag once S-on has been returned?

once s on,youll have to run an ruu. prior to s on,you can use the link mentioned above(this one) to reset the tampered flag and remove that banner
Last edited by scotty1223; 10th October 2013 at 10:50 AM.
The Following 2 Users Say Thank You to scotty1223 For This Useful Post: [ View ]
10th October 2013, 01:15 PM   |  #8  
Senior Member
Thanks Meter: 139
 
405 posts
Join Date:Joined: Mar 2013
Quote:
Originally Posted by scotty1223

it can be used for that,with the advantage of being able to unlock without having to submit ones perosnal phone info to htcdev for an unlock code(i.e. no record of having unlocked)

My question is, Can't both of these be achieved with revone -u and revone -l? I unlocked using revone, I never requested an unlock code from htcdev. If you need to be S-OFF ie, use revone, why wouldn't someone just add the extra -u parameter and unlock bootloader at the same time?

The lock command is definitely useful for those on a revone incompatible hboot (most).
11th October 2013, 04:09 PM   |  #9  
Senior Member
Flag Peel, Isle of Man
Thanks Meter: 141
 
863 posts
Join Date:Joined: Jan 2012
More
Just tried this and it worked just fine, thanks very much.
The Following User Says Thank You to maxal For This Useful Post: [ View ]
12th October 2013, 10:46 AM   |  #10  
zaphodbeeb's Avatar
Senior Member
Betelgeuse
Thanks Meter: 48
 
295 posts
Join Date:Joined: Mar 2011
More
Thumbs up Cool
Much better than using revone to do this, as it leaves no tracks. Kudos 2 u.

The Following User Says Thank You to zaphodbeeb For This Useful Post: [ View ]
Post Reply Subscribe to Thread
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Top Threads in One General by ThreadRank