What’s the bootloader on Android device and how to unlock it

Cifer
Programming Notes
Published in
2 min readJun 9, 2020

Android device has 3 important partitions — boot loader, recovery and anroid rom.

Bootloader?

Bootloader is a small piece of program burnt into the bootloader partition of the internal storage of your phone. It loads first and decides the next partition to be loaded which is usually the Android ROM.

Bootloader provides us the ability to communicate with it through the fastboot[1] protocol and a USB cable to our PC.

Bootloader can be used to install system images to different partitions including recovery(and Android ROM in theory, but we usually install new Android ROM in recovery mode).

Recovery

Recovery is the mode that is used by device to install updates to Android ROM partition. It is also used while factory resetting the phone. The recovery that comes by default usually has fewer options and that is why custom recovery modules are available.

For security reasons(who knows..), the factory’s default bootloader verifies every rom people attempt to burn into the phone and refuses it when it finds the rom is not made by the same manufacturer. The verification performed by factory bootloader is usually mandatory and there’s no way to turn off it, so to get rid of this limitation we need to substitute the default recovery with a custom recovery.

To substitute the default recovery, we need to first enter the bootloader and unlock the bootloader.

Unlock bootloader

Why do we need to unlock the bootloader?

Similar to the reason why manufacturers won’t allow us to install custom Android ROMs from in their recovery, they are certainly don’t want us to substitute their default recovery. But as said above the bootloader has more power than recovery and can even be used to substitute the recovery. Substituting recovery in bootloader is not always true but many kind manufacturers do open this option to us — by unlocking the bootloader.

How to unlock bootloader?

Firstly we need to boot into the bootloader, usually this can be done by pressing Volume Up + Volume Down + Power, when in bootloader we also enter the fore-mentioned fastboot mode. Then can enter either

fastboot oem unlock

or

fastboot flashing unlock

to unlock the bootloader.

(original post:https://cifer76.github.io/posts/android-device-flashing-custom-roms/)

References

  1. https://www.androidcentral.com/android-z-what-fastboot
  2. https://wiki.lineageos.org/devices/fajita/install
  3. https://stackoverflow.com/questions/31158021/difference-between-fastboot-and-recoverymode-in-android

--

--