Owners of Xiaomi, Redmi and POCO smartphones often face the need to manipulate the bootloader, especially after buying a used device or when there are problems with access to the system. If the previous user did not untidy the Mi Account, or you forgot your login details, standard methods may not work. In such situations, locking the bootloader becomes the only way to return the device to a factory state and protect personal data.
Procedure for closing the loader through the console ADB (Android Debug Bridge is a technically complex but effective measure that allows you to forcibly close access to the system partition, which automatically returns the phone to a βout of the boxβ state from a security point of view. However, it is important to understand that this process completely erases all user data, so preparation is mandatory.
In this article, we will discuss all the steps from tool preparation to final commands. We will also discuss the nuances of working with the Mi Unlock utility and possible errors that may occur in the process.
Why to block the bootloader and when it is necessary
Bootloader is a program that runs to the operating system and initiates Android. In Xiaomi devices, an unlocked bootloader gives superuser rights, allowing custom firmware and modifying system files. However, if you bought a phone from hand and the bootloader is open, this creates a potential vulnerability.
Blocking is necessary in the following cases:
- π You have purchased a device with an unlocked bootloader and want to return the warranty or improve security.
- π Previous ownersβ accounts are still on the phone, and a complete reset of bindings is required.
- π The system is unstable after experimenting with root rights or custom Recovery.
It is worth noting that the unlocked Bootloader disrupts some of Google Pay (Wallet) banking applications and services, as it reduces the security level of the device. Shutting down the bootloader restores the integrity of the system, but makes it impossible to re-unblock without an official procedure through Xiaomi servers.
β οΈ Note: The process of blocking the loader through ADB Delete all data from the internal storage, make sure you have a backup of important information if you have access to the system.
Tools and drivers preparation
Before you start typing commands, you need to prepare your work environment. You need a Windows computer, because Mi Unlock drivers and utility work best in this environment. Virtual machines are possible, but can lead to USB connection errors.
To start, install the following components:
- π» ADB Fastboot Drivers: a basic set of tools for communication between PC and smartphone.
- π» USB Drivers for Xiaomi: specific drivers that provide device recognition in bootloader mode.
- π» Mi Unlock Tool: official utility for managing the status of the bootloader.
After installing the drivers, connect your smartphone to your computer. In the About Phone section, click 7 times on the build number to activate the developer mode. Then go to Settings β Advanced Settings β For developers and turn on USB Debugging and Factory Unlock.
βοΈ Checking the readiness for blocking
It is important to use an original or quality USB cable. Cheap cables can only charge, but not transmit data, which will lead to a connection error in the console. Check the USB port, it is advisable to use the USB 2.0 connector on the motherboard, not on the front panel of the case.
Checking the current status of the loader
Before you do any of these things, you need to check the current state of the device, run the command line (CMD) or PowerShell in the folder with the ADB installed. Enter the command adb devices. If you see the serial number of the device, then the connection is established correctly.
Then, put the phone in Fastboot mode. This can be done programmatically through the command.
adb reboot bootloaderOr hardware: turn off your phone, then press the Volume Down button and connect the USB cable to your computer, and the screen will show a picture of a rabbit repairing an android, or the words FASTBOOT. Now enter a command to check the status:
fastboot getvar unlockedIf you get unlocked: yes, the bootloader is unlocked and can be locked, but if the answer is unlocked: no, there is nothing to lock, and the device is in a standard safe state, and the fastboot device command must display the serial number, confirming readiness to work.
| Team team. | Description of action | Expected output |
|---|---|---|
| adb devices | Checking connection in debugging mode | Serial number + "device" |
| adb reboot bootloader | Going to Fastboot Mode | Screen with a hare or the inscription FASTBOOT |
| fastboot devices | Checking the link in loader mode | Serial number + "fastboot" |
| fastboot getvar unlocked | Requesting blocking status | "unlocked: yes" or "no" |
What to do if your computer canβt see your phone?
Use the Mi Unlock utility to block
The most reliable and official way to block a bootloader is to use Mi Unlock, which is preferred because it ensures that partitions are closed correctly and that firmware is authenticated. Launch the utility and log in to your Mi Account, which is linked to the device.
Once you log in, connect your phone to Fastboot mode. The program must identify the device. If the status indicates that the bootloader is unlocked, a lock option may be available in the program menu (usually in the upper right corner through three dots or a gear), however, most often Mi Unlock is used to re-assign.
The process is as follows:
- Sign in to your Mi Account on your phone and in the program on your PC.
- Press the "Unlock" button in the program.
- If the bootloader is already open, the program will prompt it to be locked before re-unblocking (if required) or simply close access if you use the reset feature.
β οΈ Note: Mi Unlock may require waiting 168 hours (7 days) or 360 hours (15 days) before performing transactions, if the account was not tied in advance.
If the standard Unlock button does not block the bootloader directly, but only unlocks, then closing often requires resetting the phone to factory settings via Recovery with the bootloader locked, or using Fastboot commands, which we will discuss later. In some versions of the firmware, the button in Mi Unlock changes to "Lock" if the device was unlocked by the same account.
Forced blocking via Fastboot commands
If the software methods don't work, you can use the direct command Fastboot. This method is more risky and requires caution. Make sure that the phone has an official stock firmware (Global or China) installed, corresponding to the region of the device. Attempting to block the bootloader on custom firmware (LineageOS, Pixel Experience) will lead to bootloop (endless restart).
To perform the operation, connect the phone in Fastboot mode and enter the command:
fastboot oem lockOr, for some models, a command is used:
fastboot flashing lockA warning will appear on your smartphone screen that all data will be deleted. Confirm the action using volume buttons (usually Volume Up for confirmation, but read the text on the screen carefully, as navigation may differ).
Once confirmed, the process of erasing and locking will begin. The phone will reboot. The first launch can take up to 10-15 minutes, as the system will re-encrypt the data sections. If after the Xiaomi logo, the phone goes into reboot, then the firmware is incompatible with the locked bootloader, and you will need to flash it in EDL mode.
Possible mistakes and ways to solve them
Users often experience a variety of errors during the lock process, one of the most common being the message "Failed to lock" or no response to a command, which could mean that the device has activated OEM Lock in the developer's settings, which prohibits re-locking without resetting.
Other frequent problems:
- π« Antivirus Error: Antivirus can block the work ADB/Fastboot. Try to turn it off during the procedure.
- π« Firmware mismatch: As mentioned, custom software will not allow you to block the bootloader.
- π« Battery discharge: If the charge drops below 30% during the process, the phone may go into deep sleep.
It is also possible that a command is executed successfully, but the status of unlocked remains equal to yes. This is a rare bug that is solved by a complete reset via Recovery (Wipe Data) after the lock command is executed, but before the first boot to the system.
π‘
If the phone doesn't turn on after locking, try pressing the Volume Up + Power button to log in to Recovery. If Recovery doesn't open, you may need EDL mode and paid authorization to flash back.
Security and restoration of access
After successfully locking the bootloader, your device returns to a high security state. The data stored on the phone is now protected by encryption keys tied to hardware and bootloader status. No third-party programs can access the file system without a screen unlock password.
However, keep in mind the risks:
β οΈ Note: If you forget your Mi or Google account password after you block the bootloader, it will be impossible to restore access to the data (FRP Lock).
To restore access in case of problems, use only official Xiaomi service centers or authorized service points. They have access to authorization tools that allow you to reflash the device even when the bootloader is blocked, but this will require proof of ownership (check, box).
π‘
Locking the bootloader is a point of no return for custom firmware enthusiasts. Before you do it, make sure you donβt need root rights in the future, as re-unblocking will require waiting and a new procedure.