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

hovatek
hovatek
hovatek
Administrator
49,597
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: 49

Note!
We have a reply schedule for Free Support. Please upgrade to Private Support if you can't wait.

Messages In This Thread
How to unlock and relock Android bootloader with fastboot - by hovatek - 26-07-2017, 02:47 PM
RE: How to unlock the Bootloader of an Android phone via Fastboot - by sparleta - 06-04-2018, 03:58 PM
RE: How to unlock the Bootloader of an Android phone via Fastboot - by freshtyt - 06-04-2018, 10:27 PM
RE: How to unlock the Bootloader of an Android phone via Fastboot - by slichy - 21-04-2018, 10:49 PM
RE: How to unlock the Bootloader of an Android phone via Fastboot - by hovatek - 23-04-2018, 09:28 AM
RE: How to unlock the Bootloader of an Android phone via Fastboot - by hellera - 20-03-2021, 04:00 PM
RE: How to unlock the Bootloader of an Android phone via Fastboot - by Robal Hossain RH - 13-02-2022, 03:38 PM
RE: How to unlock the Bootloader of an Android phone via Fastboot - by hovatek - 14-02-2022, 12:16 PM
RE: How to unlock the Bootloader of an Android phone via Fastboot - by paeffiong - 24-04-2018, 09:10 AM
RE: How to unlock the Bootloader of an Android phone via Fastboot - by arip jumaing - 17-06-2018, 04:38 AM
RE: How to unlock the Bootloader of an Android phone via Fastboot - by Muhanad Samaty - 03-07-2018, 04:36 AM
RE: How to unlock the Bootloader of an Android phone via Fastboot - by hovatek - 03-07-2018, 10:31 AM
RE: How to unlock the Bootloader of an Android phone via Fastboot - by belinda1093 - 09-07-2018, 09:42 PM
RE: How to unlock the Bootloader of an Android phone via Fastboot - by hovatek - 10-07-2018, 11:16 AM
RE: How to unlock the Bootloader of an Android phone via Fastboot - by Dafi11 - 24-08-2018, 02:52 AM
RE: How to unlock the Bootloader of an Android phone via Fastboot - by xerxes - 24-08-2018, 03:59 PM
RE: How to unlock the Bootloader of an Android phone via Fastboot - by freshtyt - 24-08-2018, 04:34 PM
RE: How to unlock the Bootloader of an Android phone via Fastboot - by Dafi11 - 24-08-2018, 07:37 PM
RE: How to unlock the Bootloader of an Android phone via Fastboot - by maxpayne - 24-08-2018, 08:57 PM
RE: How to unlock the Bootloader of an Android phone via Fastboot - by Dafi11 - 25-08-2018, 01:33 AM
RE: How to unlock the Bootloader of an Android phone via Fastboot - by hovatek - 25-08-2018, 08:45 PM
RE: How to unlock the Bootloader of an Android phone via Fastboot - by Falkentyne - 16-09-2018, 08:06 PM
RE: How to unlock the Bootloader of an Android phone via Fastboot - by hovatek - 17-09-2018, 04:50 PM
RE: How to unlock the Bootloader of an Android phone via Fastboot - by Falkentyne - 17-09-2018, 04:59 PM
RE: How to unlock the Bootloader of an Android phone via Fastboot - by ismail tabl - 22-04-2019, 10:22 PM
RE: How to unlock the Bootloader of an Android phone via Fastboot - by X3non - 23-04-2019, 09:22 AM
RE: How to unlock the Bootloader of an Android phone via Fastboot - by angelmic - 01-06-2019, 08:23 PM
RE: How to unlock the Bootloader of an Android phone via Fastboot - by hovatek - 02-06-2019, 09:41 AM
RE: How to unlock the Bootloader of an Android phone via Fastboot - by awed730 - 16-09-2020, 12:26 AM
RE: How to unlock the Bootloader of an Android phone via Fastboot - by hovatek - 16-09-2020, 12:11 PM
RE: How to unlock the Bootloader of an Android phone via Fastboot - by stick420 - 18-11-2020, 05:12 PM
RE: How to unlock the Bootloader of an Android phone via Fastboot - by X3non - 19-11-2020, 12:52 PM
RE: How to unlock the Bootloader of an Android phone via Fastboot - by X3non - 21-03-2021, 02:32 AM
RE: How to unlock the Bootloader of an Android phone via Fastboot - by suji - 10-05-2021, 03:35 AM
RE: How to unlock the Bootloader of an Android phone via Fastboot - by maxpayne - 10-05-2021, 06:00 AM
RE: How to unlock the Bootloader of an Android phone via Fastboot - by suji - 10-05-2021, 06:54 AM
RE: How to unlock the Bootloader of an Android phone via Fastboot - by X3non - 10-05-2021, 12:46 PM
RE: How to unlock the Bootloader of an Android phone via Fastboot - by jijay - 15-05-2021, 11:48 PM
RE: How to unlock the Bootloader of an Android phone via Fastboot - by X3non - 17-05-2021, 12:55 PM
RE: How to unlock the Bootloader of an Android phone via Fastboot - by nyyra - 10-09-2021, 08:09 PM
RE: How to unlock the Bootloader of an Android phone via Fastboot - by X3non - 11-09-2021, 11:45 AM
RE: How to unlock the Bootloader of an Android phone via Fastboot - by Trunks614 - 29-09-2021, 09:56 AM
RE: How to unlock the Bootloader of an Android phone via Fastboot - by X3non - 30-09-2021, 10:12 AM
RE: How to unlock the Bootloader of an Android phone via Fastboot - by javelinv12 - 04-10-2021, 10:37 PM
RE: How to unlock the Bootloader of an Android phone via Fastboot - by suji - 15-10-2021, 06:18 AM
RE: How to unlock the Bootloader of an Android phone via Fastboot - by X3non - 05-10-2021, 11:28 AM
RE: How to unlock the Bootloader of an Android phone via Fastboot - by javelinv12 - 06-10-2021, 04:29 PM
RE: How to unlock the Bootloader of an Android phone via Fastboot - by maxpayne - 30-12-2021, 09:18 AM
RE: How to unlock the Bootloader of an Android phone via Fastboot - by bangier24 - 01-02-2022, 02:52 PM
RE: How to unlock the Bootloader of an Android phone via Fastboot - by hovatek - 05-02-2022, 06:52 AM
RE: How to unlock the Bootloader of an Android phone via Fastboot - by suartex - 18-05-2022, 04:53 PM
RE: How to unlock the Bootloader of an Android phone via Fastboot - by hovatek - 21-05-2022, 08:27 AM
RE: How to unlock the Bootloader of an Android phone via Fastboot - by thedanh - 26-05-2023, 07:09 AM
RE: How to unlock the Bootloader of an Android phone via Fastboot - by Gargoyle - 26-05-2023, 07:49 AM
RE: How to unlock the Bootloader of an Android phone via Fastboot - by thedanh - 26-05-2023, 11:06 AM
RE: How to unlock the Bootloader of an Android phone via Fastboot - by maxpayne - 30-05-2023, 08:16 AM
Nokia XR20 Qualcomm fastboot failed to decrypt - by alegatorul - 08-07-2023, 06:25 PM
RE: Nokia XR20 Qualcomm fastboot failed to decrypt - by hovatek - 13-07-2023, 12:10 PM
Users browsing this thread:
 2 Guest(s)
Users browsing this thread:
 2 Guest(s)
YtWhTl
live chat
whatsapp telegram instagram