How to unlock android bootloader. How to block the bootloader on Android? (step-by-step instruction). Unlocking the bootloader directly

This instruction will help you restore the boot partition status to factory state.

Unlocking the bootloader is needed to access the modification system files and root on most Huawei devices.

Therefore, if you have ever tried to perform any manipulations with the system root, then most likely you have already performed the bootloader unlocking procedure.

Everything would be fine, however this procedure may affect access to free service. In other words, in order to return the warranty, it is necessary not only to remove the root-rights, but also to return the bootloader to the factory state. This can be done in two stages.

Stage one - get the service lock code

The bootloader lock code is the same code that was used to unlock. To obtain it, you need to use an automatic service (for each model it may differ), or use universal way with sending a letter to the address [email protected]specifying the following data:

  1. Topic - Unlocking Bootloader (specifying the device model is required - this is necessary to move the application in the support department);
  2. Serial Number - XXXXXXXXXXXX ( serial number indicated on the device case under or next to the battery, as well as on the box next to the barcode);
  3. IMEI - XXXXXXXXXXXX (look in the same place as the serial number, or by the combination * # 06 # in the dialer);
  4. Product ID: XXXXXXXXXXXX (the product code can be found in the dialer by the command * # * # 1357946 # * # *);
  5. Model: HUAWEI XXXXXXXXXXXX (your device model including modifications, for example - Huawei Mediapad 7 Vogue S7-601u).

Boot partition locking procedure

This procedure is not much different from unlocking. To block you need:

  1. download from our forum and install the automatic ADB and Fastboot installer;
  2. hover the cursor over the ADB folder (will be located at the root of the disk with installed system after installing ADB and Fastboot), hold down the Shift key and RMB, select in context menu "Open a command window";
  3. connect the device to a computer in "MTP" mode;
  4. in command line prescribe adb command devices (the device name will be displayed);
  5. then type the adb reboot bootloader command (the smartphone will automatically boot into fastboot mode);
  6. check the bootloader status with the fastboot oem get-bootinfo command;
  7. if you received "locked" in response, then go to the last paragraph of the instruction;
  8. if "unlocked" is highlighted, then go to the next item;
  9. register fastboot oem lock ################ ("hash" marks your lock-unlock code);
  10. type fastboot reboot (the device will boot into the system).

Before you start hacking Android, you need to understand how it works in general, and only then you can start unlocking the system bootloader. So, let's try to figure it out.

What happens when you turn on and start Android?

What happens when Android starts

Before us is a switched off smartphone under android... Let's see what happens if you turn it on.

BIOS will start first mobile phone... ВIOS (Basic Input / Output System) in English means "Basic Input / Output System". It is constantly autosave and keeps the inputs and outputs working. In particular, this system also starts the Bootloader.

As the name suggests, the bootloader loads other parts operating systemfor example the kernel. The operating system kernel is the main part of the operating system. Basically, this is the lowest level of the Android system, which is responsible for the main processes and data organization.

Then the main operating system called "ROM / ROM" starts up. ROM stands for "Read Only Memory", or "Read Only Memory", used to store the entire array of unchangeable data. As a regular user, you cannot change anything in it.

In parallel, the bootloader launches not only the kernel, but also Recovery, or the recovery system.
If android system Suddenly it turns out to be damaged, you can download Recovery and from it restore the OS from scratch or from the moment of saving. Also in the Recovery system you can (and should) create backups.

In turn, the bootloader can be in three different states: "Locked", "Open" or "Encrypted". If the bootloader is open, deep changes can be made to the system, for example, you can install your own operating system, also called "custom ROM", instead of the standard, that is, "stock ROM". But other moments, such as changing Recovery or getting root rights to a smartphone, can only be done using an open bootloader.

If the bootloader is encrypted, only the most urgent system updates from the manufacturer can be installed. The same applies to a locked bootloader, but unlike an encrypted one, it can be unlocked.

How to unlock the bootloader


ADB & Fastboot Installer

Most android smartphones have the so-called fastboot mode. This is a kind of "advanced bootloader". Using this mode, the regular bootloader can be unlocked. The basic tool for this is the Android Debug Bridge, or ADB. It is primarily aimed at developers of applications for Android, but it also provides many opportunities for ordinary users.

First you need a driver for your smartphone. They can be easily installed automatically from Windows 7 by simply connecting your smartphone to your PC.
It also needs ADB and Fastboot drivers. To do this, download the installer from the Internet and run the downloaded file in administrator mode. Be sure to install drivers for the entire system. The installer will ask you if you really want to do this.

After you have completed these steps, you need to connect your device to your PC in fastboot mode. Many smartphones have a dedicated key combination for this. Alternatively, however, you can also connect your powered smartphone to your PC and enter the "adb reboot bootloader" command at the command prompt. However, you must first enable USB Debugging in your smartphone settings. If necessary, you must also enable the Allow OEM Unlock feature.

Now you can easily unlock the bootloader with the "fastboot flashing unlock" command. Then reboot into fastboot mode and type “fastboot flashing unlock_critical” to permanently unlock the bootloader. Thus, you can minimize the risk that your smartphone will turn into a "brick" when installing a new firmware.

Alternatively, on some smartphones, unlocking can be performed using the "fastboot oem unlock" command.

However, there are exceptions. For example, samsung smartphones don't have real fastboot mode. Instead, there is a download mode. To unlock the bootloader, you need to use odin programwhich can install files that can do this. To root or install a custom ROM or Recovery on samsung devices it's not obligatory.

Another exception is Sony smartphones. Before jailbreaking a smartphone, you first have to register the device on the developer page by entering the IMEI and your e-mail in order to receive a special unlock code.

A bootloader (Hboot) is a program that controls the kernel of your device's operating system so that it boots in normal mode. And this applies not only to Android, but also to other devices with an OS, such as a PC, laptop and even an old one. push-button telephone... In addition, it is the bootloader that gives permission to install any programs and firmware. For this reason, users are interested in factory unlock bootloader on android phone.

Hboot is activated when the device is turned on, and is analogous to Bios in a computer. It prepares all the data for the kernel, loads it into memory, after which the system starts up directly. If its integrity is violated or something interferes, thanks to the bootloader, you can get into recovery mode in order to clear the data, or reset to factory settings. To do this, before turning on the device, hold down the power and volume down keys, and do not release them until the moment of loading (in some cases the button combination may differ).

Why is the bootloader blocked

Manufacturers implement blocking for two reasons:

1. To oblige the owner to use the operating system that was developed for his device.

2. Ensuring security. Many smartphones and tablets are sold online or retail. In either case, the seller or reseller can, at their discretion, add software of an advertising or malicious nature, which should not be. For the same reason, Xiaomi began to block the bootloader of devices released after 2016, due to numerous complaints about the presence of viruses in their firmware (which were not originally there).

Benefits of an unlocked bootloader

An unlocked bootloader opens up exactly the same possibilities for the user as on a PC, namely:

  1. Flash any operating system (available for your device).
  2. Installation of individual modules, OS kernels, applications, patches.
  3. Freely migrate between stock firmwares, especially if they are based on different versions Android.
  4. Easily create backups of the current OS and / or applications, as well as restore them without using a PC.
  5. Use Dual-Boot and install two or more operating systems as in internal memoryor to an external SD card.
  6. Wider recovery options in case of unsuccessful firmware.

And this is not the whole list of possibilities after factory unlocking an android.

How to unlock

Each device has its own version of the bootloader, which means that the unlocking method will differ depending on the model and manufacturer. When submitting an application, the company itself can remove the lock (especially if you are an Android developer), but most often, this happens by hacking previously found vulnerabilities in the system.

Risks and consequences

Unauthorized unlocking of the bootloader, deprives you of warranty service. In addition, your device becomes less secure and vulnerable to hacker attacks... Open bootloader lets you bypass set passwords, get access to personal information or erase everything and install another firmware.


Conclusion

Don't worry too much about problems with the bootloader, especially when it comes to personal information. In found or stolen devices, data is most often erased, and rarely will anyone restore something. An open bootloader is more needed by advanced users who know what to do with it, regularly flash something and experiment.

Leave your questions in the comments to the article below - we will try to answer.

Was this article helpful?

Rate it - support the project!

Until 2015, Xiaomi company released smartphones with an initially unlocked bootloader on the market, which allowed users to independently perform various operations with their mobile deviceincluding deleting system files.

Now the manufacturer's policy has changed, and all devices are sold with a locked Bootloader. However, often users independently decide to unlock the bootloader, since they need to perform more fine tuning device or change the global firmware to custom.

In the article, we will consider how to block the Xiaomi bootloader back, otherwise the risk of accidental installation of potentially dangerous software on the product significantly increases. In addition, without the Bootloader lock, the phone does not have any security measures, so, for example, one command is enough to remove the screen protection. Also, with a blocked bootloader, it is impossible to find a lost smartphone.

How to block the bootloader on Xiaomi via the command line

Usually the procedure is performed on stock firmware, otherwise there is a possibility that the smartphone will be turned around. Before starting the operation, it is advisable to save personal data, since in some cases it leads to a rollback to the factory settings.

Locking the Xiaomi bootloader by flashing

The method consists in completely flashing the device, which involves deleting all data.

You must first download new firmware... It is advisable to use a stable global version, as well as install the MiFlash application on your computer.

After that it is necessary:


Unlocking the bootloader on your smartphone is the first step to speed up and install it custom firmware... And, contrary to popular belief, this feature is supported on most devices. Below is the official way to unlock the operating system bootloader.

Not every phone will allow you to do this

There are two types of phones in this world: Those that allow you to unlock the bootloader of the operating system and those that, accordingly, do not.

The ability to unlock the bootloader depends on your smartphone manufacturer, model, and even your operator. All Nexus smartphones allow you to unlock the bootloader, and many phones from Motorola and HTC will allow you to unlock the bootloader in the same way as on the Nexus.

Other smartphones, as well as operators, do not provide the ability to unlock the bootloader in an official way. In this case, you have to wait until the developers find vulnerabilities with which you can get root rights and upload custom firmware to your phone. If you have such a smartphone, then, alas, this article will not help you.

The best way to find out which category your smartphone belongs to is to look at a dedicated website. If you have hTC smartphone or Motorola, then you can also check the unlock feature on the HTC and Motorola websites. If the bootloader of your smartphone cannot be unlocked in an official way, then only an unofficial unlocking or root method will help you, which can usually be found on the XDA Developers forum.

Step 0: back up everything you want to keep

Before you start, it should be noted that this process will erase all your data. Therefore, if you have any Important files, be it photos, music, videos, or something else, then now is the time to save everything to your computer. Also, if you have any application settings that you want to save, then use the function reserve copyto create a backup of the settings, and also save it on your computer.

Here's another tip: since I know I want to root my smartphone, I always unlock the bootloader whenever I buy a new device. This way, I don't waste time customizing the phone for myself, so that in a couple of days all the data can be deleted.

When you save everything important filesthen you can start.

Step 1: android installation SDK and drivers for your phone

You will need two things for this process: the Android Debug Bridge, which is a command line for your PC that you can use to communicate with your phone, and a USB driver for your device. If you installed them before, then you need to update them to the latest version.

Let us give short instruction for installation:

  • 1. Go to the Android SDK download page and scroll down to “SDK Tools Only”. Download ZIP file for your OS and extract the archive.
  • 2. Run SDK Manager and uncheck all items except “Android SDK Platform-tools”. If you are using a Nexus phone, you can also select “Google USB Driver” to download the Google drivers.
  • 3. After the installation is complete, you can close the SDK manager.
  • 4. Install USB drivers for your phone. You can find them on the website of the smartphone manufacturer (eg Motorola or HTC)
  • 5. Reboot your computer if required.

Turn on your phone and connect it to your computer with via USB cable. Open the tools folder in the folder with the Android SDK installed and press Shift + right click on an empty area. Select “Open a Command Prompt Here” and run the following command:
adb devices
If a serial number appears, then your phone was found and you can continue further. If not, make sure you followed all the steps listed correctly.

Step 2: enable USB Debugging

Next, you need to enable several options on your phone. Go to phone settings and select "About phone". Scroll down to the "Build number" item and click on this item 7 times. A message should appear that you have entered developer mode.

Come back on home page settings, you should have a new item "For developers". Enable "OEM Unlocking" if this option exists (if not, don't worry - only some phones have this option).

Then enable “USB Debugging”. Enter a password or PIN, if required.

Once you've done that, pair your phone with your computer. You will see a window on your phone with the question "Enable USB debugging?" Check the box "Always allow for this computer" and click OK.

Step 3: Obtain the unlock key (not for Nexus phones)

If you have a Nexus smartphone, then proceed to the next step.

Go to the smartphone manufacturer's website to get an unlock key (for example, for Motorola, open this page or this one for HTC), select your device (if required) and drive or create a new account.

Further in this step there may be differences for different phones, but the manufacturer's website should have instructions for the steps. It will be as follows: first, turn off your phone and boot into fastboot mode. There are different ways on different phones, but most often you need to press and hold the power button and the volume down key for 10 seconds. Release the buttons and you should get into fastboot mode ( hTC users will have to use the volume down key to get to the Fastboot item and the power key to select this item).

Connect your phone and PC with a USB cable. Your phone should somehow notify you about the connection. Open the tools folder in the folder with the Android SDK installed and press Shift + right click on an empty area. Select “Open a Command Prompt Here” and enter the unlock command provided by the manufacturer (for Motorola it's fastboot oem get_unlock_data command, for HTC fastboot oem get_identifier_token).

The command line will show long lines characters. Copy these characters and make one line of them without spaces and on the site, paste the resulting text into the appropriate field. If your smartphone can be unlocked, then you will receive an email with a key or a file that we will use in the next step. If your device cannot be unlocked, you will also be notified of this. If you still want to go all the way and use an unofficial method, then you need a developer site.

Step 4: unlock

You are now ready to unlock. If your phone is still in fastboot mode, run the command which is written below. If not, turn off your phone and boot into fastboot mode. There are different ways on different phones, but most often you need to press and hold the power button and the volume down key for 10 seconds. Release the buttons and you should get into fastboot mode (HTC users will have to get to the Fastboot item with the volume down key and select this item with the power key). Connect your phone and PC with a USB cable.

Open the tools folder in the folder with the Android SDK installed and press Shift + right click on an empty area. Select “Open a Command Prompt Here”.

To unlock your device, you need to complete one simple command... For most Nexus devices, this command:
fastboot oem unlock
If you have a new version Nexus, for example, Nexus 5X or 6P, then the command will be slightly different:
fastboot flashing unlock
If you do not have a Nexus smartphone, then the manufacturer's website will indicate the command you need. For Motorola devices, this is the fastboot oem unlock UNIQUE_KEY command, where UNIQUE_KEY is the code sent to you by email. For HTC, this is the fastboot oem unlocktoken Unlock_code.bin command, where Unlock_code.bin is the file received from the HTC manufacturer.

After running the command, the phone may ask if you really want to unlock. use the volume key to confirm.

When the unlocking is complete using the OSD, reboot your phone (or execute the fastboot reboot command on your computer). If everything is done correctly, then when you boot the phone you will see a message stating that the bootloader is unlocked, and then the Android OS will boot. It is important to download Android first before performing any action, such as installing a custom recovery.

Congratulations on unlocking! For now, you won't notice any difference, but now you can install custom recovery, root or install custom firmware.