How to unlock the Android Bootloader

Unlocking the bootloader of the Android phone is the first step in obtaining root permissions and installing custom ROMs.
The bootloader is the component that manages the correct startup of the device and, once the security data has been verified, starts the actual operating system.
In the case of an Android smartphone, the bootloader is often blocked by the manufacturer of the phone, so that only the Android system certified by the manufacturer is started and that there is no possibility to start components other than the official ones (Recovery and ROM).
We find out in this guide how to unlock the Android bootloader on most devices so that we can unlock root permissions, install a different recovery and a custom ROM on our Android device.
READ ALSO -> ROOT Android to have your cell phone free and unlocked (programs and guide)
1) Advantages of unlocking the bootloader
The advantage of unlocking the bootloader lies in the possibility of installing a more advanced recovery mode than that currently present, of being able to easily obtain root permissions and of being able to install one of the best Android custom ROMs such as LineageOS.
The unlocking of the bootloader can be done on many smartphones using an official procedure with the tools that the same production company makes available to Android users and which we are going to explain here.
For other models of other brands, however, the bootloader cannot be unlocked with the official procedure and it is necessary to use a special tool that exploits a system vulnerability.
For these it is necessary to read the XDA Developer forum guides, the most complete site ever for Android.
2) Disadvantages of unlocking the bootloader
The first disadvantage to expose you on unlocking the bootloader of an Android smartphone is that the internal memory is reset so all the photos and all the files saved in it will be deleted.
Before unlocking the Android bootloader then you need to backup all important phone data.
Ideally, unlocking the bootloader should always be done immediately after purchasing the phone, so as not to lose any data and any changed settings.
Another thing not to be underestimated is the loss of the warranty : even if we can "lock" the bootloader at any time, a trace will remain in the memories and chips of the device, invalidating the warranty and therefore making it impossible to use repairs during the first two years from purchase of the product.
If we make errors while unlocking the booloader (low battery, sudden shutdowns etc.), recovering the correct functioning of the device could be almost impossible, so better to be decided immediately on what we want to do.
3) Procedure to unlock the bootloader on Android
The official procedure to unlock the bootloader of an Android smartphone or tablet is as follows:
- Install ADB on the computer
What is needed is the ADB or Android Debug Bridge tool, which allows you to interface the PC with the phone, and the USB drivers of the smartphone.
To do it first we can download ADB and all the necessary files from this link.
Just download the file offered and click Y on the keyboard with each question to immediately get all the useful tools to unlock the bootloader on any device.
- Activate USB debugging and unlock OEM
At this stage you need to open the Android settings on the phone, go down to Info on the phone, scroll to the bottom and touch the "Build Number" item seven times quickly in order to activate the developer mode.
On the main Settings page, touch the new Developer Options item and then activate the USB Debugging option and, if present, the OEM Unlock .
If you own a Samsung smartphone, you don't have to do anything else: the bootloader is automatically unlocked.
If, on the other hand, you have any other Android phone, you must connect the latter to the computer via USB cable and allow computer access from the phone screen.
- Open the command prompt
We open the Windows Start menu at the bottom left and search for Command Prompt ; let's right click on it and make sure to select Run as administrator .
In the prompt that will open we type :
adb devices
then press Enter.
If it shows a serial number, the device is recognized and you can continue with the process. Otherwise something of the procedure described so far has not gone well so try again and make sure you have followed it correctly.
Now type the command in the prompt:
adb reboot bootloader
Then we press enter to automatically restart the Android phone in Fastboot mode.
To immediately unlock the bootloader (on Pixel devices for example), we can try the command:
fastboot oem unlock
If we get OKAY in response, the booloader is unlocked; if the result is negative, we will have to unlock the bootloader via the unlock key provided by the manufacturer.
- Get the unlock key
To unlock the bootloader, we must first of all recover the unlock code from the phone; from the command prompt still open we type:
fastboot oem get_unlock_data
We will get a code divided over several lines; we copy all the text, we open the notepad and we clean up the code, so as to obtain a string similar to the one below.
# 123456 # 789123456789123456789 ABC123456
To end the procedure we will now have to contact the manufacturer of the smartphone, in order to provide the code obtained on the unlock request page.
The sites of the main manufacturers in which to make the unlock request are the following:
  • Motorola
  • LG
  • Xiaomi
If your manufacturer is not on this list, try doing a search on Google with the name of the manufacturer and the strings "unlock bootloader" or "bootloader unlock".
At the time of writing Huawei and Honor have removed the possibility of providing unlock codes : if we own one of these devices we will not be able to unlock the bootloader in any way.
- Unlock the phone bootloader
We wait for it to be provided by email (we will have to take care to create a real account at the manufacturer's website contacted for unlocking) the unlock code (it can also take days, especially with Xiaomi), then reconnect the device to the PC via USB and run the following commands:
adb devices
adb reboot bootloader
We will return to the fastboot mode; now to unlock the bootloader we run the following command:
fastboot oem unlock XXXXXXXXXXXXXX
Obviously instead of the X that we have entered, we insert the code provided by the operator, then we press enter on the keyboard.
If we have done everything correctly, the OKAY confirmation will appear, a sign that the operation was successful.
READ ALSO: How to use ADB Sideload to install ROM, updates, recovery
4) Conclusions
What we have shown you is the official procedure to unlock any Android bootloader; as seen in the Android root guide there are some automatic programs to unlock bootloaders and toolkits to root and unlock almost any Samsung, Nexus or LG smartphone.
In case of problems or doubts, I can only refer to the XDA Developers official forum looking for the guides for the smartphone model in our possession -> XDA Developers.

Leave Your Comment

Please enter your comment!
Please enter your name here