Hovatek Forum DEVELOPMENT Android [Development] How to unlock and relock Android bootloader with fastboot
Try our Online TWRP Builder..its free!
Can't login? Please, reset your password.


[Development] How to unlock and relock Android bootloader with fastboot

[Development] How to unlock and relock Android bootloader with fastboot

Pages (6): 1 2 3 4 5 6 Next
hovatek
hovatek
hovatek
Administrator
49,612
26-07-2017, 02:47 PM
#1



This guide will explain how to unlock and relock the bootloader of an Android device using fastboot. Except for rare cases like Motorola devices, your bootloader must be unlocked to flash even factory files via fastboot. While you can flash modified files (TWRP/GSI/Custom ROMs) to your Mediatek (MTK), Spreadtrum (SPD) or Qualcomm (QLM) Android devices using their flash tools on a locked bootloader, doing so is just asking for a boot loop or bricked device.

It is important to mention that this is a generic approach and doesn't work for all devices. Some relevant guides on bootloader unlock to checkout include:



Requirements


How to unlock Android bootloader using fastboot


Follow the steps below to unlock the Bootloader of an Android device


See the video tutorial below or @ https://youtu.be/DL5NMR-n4_Q

  1. Open the adb folder

    [Image: Hovatek-How-to-unlock-the-Bootloader-of-...one-1.webp]

  2. Hold Shift (on the keyboard) then right-click on a blank space in the folder > Select Open Command window here

    [Image: Hovatek-How-to-unlock-the-Bootloader-of-...one-2.webp]

  3. Command prompt screen (ADB) should now be open

    [Image: Hovatek-How-to-unlock-the-Bootloader-of-...one-3.webp]

  4. Connect the device to the PC (via USB cord) while ON then run the command below (by "run", I mean type then press Enter
    Code:

    adb devices

    [Image: Hovatek-How-to-unlock-the-Bootloader-of-...one-4.webp]

  5. If you've set up everything right, the device should get detected under the List of devices attached

    [Image: Hovatek-How-to-unlock-the-Bootloader-of-...one-5.webp]

  6. Run the command below to get the device into Bootloader (fastboot)
    Code:

    adb reboot-bootloader

    if that fails

    Code:

    adb shell reboot fastboot

    [Image: Hovatek-How-to-unlock-the-Bootloader-of-...one-6.webp]

  7. The device should now boot into fastboot (a black or coloured screen with the text fastboot)

  8. In fastboot, test detection/connection to the device using the command:
    Code:

    fastboot devices

    [Image: Hovatek-How-to-unlock-the-Bootloader-of-...one-7.webp]

  9. If fastboot is set up right, you should see its ID printed out

    [Image: Hovatek-How-to-unlock-the-Bootloader-of-...one-8.webp]

  10. Now, check the device's Bootloader lock status using either of the two commands below (if it's locked or unlocked)
    Code:

    fastboot oem device-info
    fastboot getvar unlocked

    [Image: Hovatek-How-to-unlock-the-Bootloader-of-...one-9.webp]

    1. If you use the fastboot oem device-info command and the result is false then your bootloader is locked but if the result is true then the bootloader is unlocked

      [Image: Hovatek-How-to-unlock-the-Bootloader-of-...ne-14.webp]

    2. If you use the fastboot getvar unlocked command and the result is no then your bootloader is locked but if the result is yes then the bootloader is unlocked

      [Image: Hovatek-How-to-unlock-the-Bootloader-of-...ne-12.webp]

  11. If you've confirmed your bootloader is locked, then run the command below to unlock the Bootloader
    Code:

    fastboot oem unlock

  12. If that doesn't work then try the commands below:

    Code:

    fastboot oem unlock-go
    fastboot flashing unlock
    fastboot flash unlocking
    fastboot bbk unlock_vivo

    Note: Vivo phones require a custom fastboot binary (attached at the end of this post)

    [Image: Hovatek-How-to-unlock-the-Bootloader-of-...ne-13.webp]

  13. Some devices require you to also run:

    Code:

    fastboot flashing unlock_critical

  14. You should get a prompt (on the device) asking you to press Volume up to confirm or Volume down to cancel. Press Volume up on the device (for some phones it is actually the opposite; Volume down would confirm while up would cancel or do nothing)

  15. Once the Bootloader is unlocked, reboot the device using
    Code:

    fastboot reboot

  16. The device might take a while to boot up (since it is a first boot) so be patient

How to relock Android bootloader using fastboot



It is important to return the device to stock ROM by flashing its factory/stock/official firmware before relocking the bootloader. Relocking the bootloader with a custom partition (TWRP/Custom ROM/GSI) still in place will brick the device.
Depending on the unlock command you used, try its corresponding bootloader relock command:

Code:

fastboot oem lock
fastboot oem lock-go
fastboot flashing lock
fastboot flash locking
fastboot bbk lock_vivo


Important Notice
  • This guide isn't guaranteed to work on all (Mediatek, Spreadtrum, Qualcomm, Exynos, Hisilicon, Intel etc) Android devices
  • Ensure to backup your important stuff because unlocking your Bootloader wipes your data (/userdata)
  • Unlocking the bootloader bricks some devices so ensure to relock or flash the firmware if you find yourself in such a situation
  • If you successfully installed ADB / fastboot and your device still isn't detected then it is most likely due to old ADB or drivers, fix it using the guide on fixing ADB and fastboot detection problems
This post was last modified: 17-11-2023, 12:25 PM by hovatek.
Attached Files
.zip
vivo_fastboot_for_windows.zip
Size: 891.91 KB / Downloads: 65

Note!
We have a reply schedule for Free Support. Please upgrade to Private Support if you can't wait.
sparleta
sparleta
sparleta
Junior Member
18
06-04-2018, 03:58 PM
#2
(26-07-2017, 02:47 PM)hovatek ...
This post was last modified: 07-04-2018, 10:05 AM by hovatek.
Attached Files
.jpg
IMG_20180406_175243.jpg
Size: 942.95 KB / Downloads: 295
freshtyt
freshtyt
freshtyt
Senior Member
2,949
06-04-2018, 10:27 PM
#3
(06-04-2018, 03:58 PM)sparleta Hi guys,I have been using the step by step guide to unlock my Infinix Hot5 Model X559C. Unfortunately, once i send the code to unlock bootloader the screen pops out on my phone but does not respond to either Volume Up/Down or Power button. What could be the case? Attached is the image where it hangs

did you enable oem unlocking in settings before trying to unlock?
and why are you trying to unlock bootloader?
This post was last modified: 06-04-2018, 10:34 PM by freshtyt.
slichy
slichy
slichy
Enthusiastic Member
10
21-04-2018, 10:49 PM
#4
i have been following the instructions to unlock my leagoo t5c. my phone is detected in adb, but when i want to reboot in bootloader using adb reboot bootloader, my phone stuck in boot logo. and when i checked in fastboot devices, is showed the message <waiting the devices>. whats wrong with my phone ? i have installed the driver clearly. my phone is use spreadtrum sc 9853i. thanks before
This post was last modified: 21-04-2018, 10:50 PM by slichy.
hovatek
hovatek
hovatek
Administrator
49,612
23-04-2018, 09:28 AM
#5



(21-04-2018, 10:49 PM)slichy i have been following the instructions to unlock my leagoo t5c. my phone is detected in adb, but when i want to reboot in bootloader using adb reboot bootloader, my phone stuck in boot logo. and when i checked in fastboot devices, is showed the message <waiting the devices>. whats wrong with my phone ? i have installed the driver clearly. my phone is use spreadtrum sc 9853i. thanks before

Boot into recovery mode and check if there's an option to boot into Bootloader from there

Note!
We have a reply schedule for Free Support. Please upgrade to Private Support if you can't wait.
paeffiong
paeffiong
paeffiong
Senior Member
138
24-04-2018, 09:10 AM
#6
Nice and well detailed. Could you please attach a video cos there are so many who learns faster when taught with a video tutorial.
arip jumaing
arip jumaing
arip jumaing
Newbie
2
17-06-2018, 04:38 AM
#7
Nice and well detailed. ADB AND FASTBOOT MODE FOR UBL..THANKS
Muhanad Samaty
Muhanad Samaty
Muhanad Samaty
Enthusiastic Member
5
03-07-2018, 04:36 AM
#8
guys everything went well except rightnow how do i install supersu.zip when i dont have twrp or philz recovery for my phone ,, im using Tecno CX AIR build number : cxair-H3713A-N-171207V139 please help.
hovatek
hovatek
hovatek
Administrator
49,612
03-07-2018, 10:31 AM
#9
(03-07-2018, 04:36 AM)Muhanad Samaty guys everything went well except rightnow how do i install supersu.zip when i dont have twrp or philz recovery for my phone ,, im using Tecno CX AIR build number : cxair-H3713A-N-171207V139 please help.

Use our TWRP or Philz porter @ https://www.hovatek.com/forum/forum-39.html

Note!
We have a reply schedule for Free Support. Please upgrade to Private Support if you can't wait.
belinda1093
belinda1093
belinda1093
Newbie
1
09-07-2018, 09:42 PM
#10
Great post, I am a newbie and it took me two days to get this far. I use both linux and windows and first a lot of problems with the adb fastboot drivers...and all the familiar problems. Then after much hassle I found out that my bootloader is already unlocked and I thought it wasn't. Big Grin Big Grin
Now my biggest issue is that I cannot find a suitable custom ROM for my phone (strange device I have, a Mango C9 android marshmallow, kernel 3.10.65 (!) with quad core chipset). So I should learn how to port a Rom, but I am in a hurry because I started this whole process because my phone has a virus in android system file. So I have to completely wipe it clean. I cant find a stock rom either. What would your advice be?
Pages (6): 1 2 3 4 5 6 Next
Users browsing this thread:
 1 Guest(s)
Users browsing this thread:
 1 Guest(s)
YtWhTl
live chat
whatsapp telegram