Unlocking Bootloaders

On many devices the bootloader is locked and you must unlock it before you can flash a custom ROM or recovery.
Unlocking is therefore also required for installing postmarketOS.
If you have forgotten whether your device is unlocked or not, check to see if it displays "device unlocked" or something similar at the bottom in flash mode or during the boot.
== Unlocking the bootloader ==
=== Generic Methods ===
Usually those method below use some kind of vulnerability to unlock the bootloader.
==== Generic fastboot method ==== 
Those command at below usually work on Oneplus and Pixel,Nexus and Nothing phone but it may not for others.
$ fastboot oem unlock
$ fastboot oem unlock-go
$ fastboot flashing unlock
Also some device may required code from vendor.Once you have the code you might able to unlock the bootloader by running those command at below.
$ fastboot oem unlock your-code-here
==== BootUnlocker ====
BootUnlocker 
This tool require you to root your Android device.Then it will use root access for modify the lock status of the bootloader.
This tool seem to only work on old devices due to it hasn't been update.Also Rooting Android device without unlocking bootloader is probably require vulnerability in Android userland or Linux Kernel.
==== Brute Force ====
If your phone uses a bootloader unlock key to unlock bootloader, then you can try to brute force the key via https://gist.github.com/alex-spataru/b187bdc3d987a0fcb1cae4e9b17c0e9e .
== Per manufacturer/series ==
=== HMD Global ===
There are several unofficial ways to unlock these devices. Some devices can be unlocked for free, while some are not.
See Unlocking Bootloaders/HMD Global
=== HTC ===
htcdev unlock site
=== Huawei ===
Huawei no longer provides unlock codes.
Tutorials that tell you to go to some Huawei website, log in with your Huawei ID and sign the unlock agreement to get a code are NO LONGER working. Even contacting their support has no effect.
Some services claim to be able to unlock these devices, but they charge money for it (e.g. DC-Unlocker charges 4€). Be careful, do your research and make sure that you're not on some fishy website before giving any of these services your money!
If you do try, please run wireshark usb capture, so there's a chance to understand how it works. Try to replicate it if possible.
Another option is to try #Brute Force the code. This takes time and might not work.
There is also this Open Source Solution for devices on Kirin SoC called PotatoNV which can be used to unlock the bootloader of Kirin-based devices, but has the disadvantage that you have to open the device and short a "test point" (unique to each device) to ground. This will also change your bootloader unlock code to a new one instead of printing out the original code.
* WIP Experimental work around which involves replace the entire bootloader & 
* A bootrom exploit of Huawei Hisilicon Smartphones that could be used to unlock Huawei bootloaders
=== Lenovo ===
For devices runining Android ZUI, see :Category:Bootloaders/Unlocking/Lenovo ZUI
=== Motorola ===
Motorola unlock site
An exploit does exist, see here.
=== Sony ===
Sony Unlock Page.
=== Wiko ===
Just enable OEM unlocking in the Developer options and then use fastboot oem unlock in fastboot mode.
=== Windows Phones ===
Use WPInternals. The tool contains the instructions for unlocking.
=== Xiaomi ===
Xiaomi Unlock Page.
=== Samsung ===
1. Turn on OEM unlocking in the developer settings
2. Turn off the device
3. Press Volume down + Power button + home key (if the device has a physical home button )
4. You should see blue screen on your phone. In that screen you should see this line of text : Volume up and long press: Device unlock mode. If you see it, then long press volume up.
5. Press volume up and wait for the bootloader unlock to reset the device.
==== Crom Service ====
If you see this line of text: CROM SERVICE: LOCK in odin mode then you need a app named Crom Service to unlock the bootloader (can be found in Galaxy Store or Internet Archive).
== See Also ==
Bootloader Unlock Wall Of Shame (It contain some unlock bootloader guides's link)
Category:Guide
Category:Software
Category:Bootloaders