How to block the bootloader on Xiaomi: return stock status

Owners of Xiaomi, Redmi and POCO smartphones often face the need to change the software part of the device. Unlocking the bootloader allows access to custom firmware installation, root rights and deep modification of the system. However, there comes a point when you need to return the device to its original state, this can be caused by the desire to sell the gadget, the need to pass bank security checks or the requirement of the warranty department.

The process of blocking the bootloader is reversible, but it carries certain risks that you need to know about before you start manipulating. Unlike unlocking, which requires waiting and binding an account, the reverse procedure is faster, but requires strict adherence to the sequence of actions. If you decide to block the bootloader, you need to be sure of the integrity of your smartphone system files.

In this article, we will go into all the preparation steps, tools and software needed, and not only the standard method through Fastboot, but also the nuances that arise when you have a modified partition system, and understanding these processes will help you avoid turning your device into a brick and save your data.

Why to block the bootloader and what are the risks

The main reason users want to close access to the bootloader is to restore the warranty. Xiaomi's official service centers often refuse free repairs if they see an unlocked Bootloader.

In addition, many high-security banking applications and services (such as Google Pay or enterprise customers) may not work properly on devices with open access to system files. Even if you delete root rights, the unlock flag in the bootloader remains active, and security systems see it.

⚠️ Note: If your smartphone has custom firmware installed (for example, LineageOS, PixelExperience or modified). MIUI), Attempting to block the bootloader will result in an infinite bootloop cycle, and the device will not be able to start because the digital signature of the stock bootloader will not match the modified system partition.

Also worth mentioning is resale: Aftermarket buyers are much more likely to buy closed-loader phones, as this ensures that there are no hidden modifications and viruses that could have been introduced by the previous owner.

πŸ“Š Why you want to block the bootloader?
Restoration of the guarantee
Phone sale
Problems with banking applications
Just for the sake of interest.

Critical check: whether you have stock firmware

Before you go into action, you need to conduct a thorough diagnosis of the current state of the operating system. Locking the bootloader is possible only on the original, stock firmware MIUI or HyperOS. Any changes in the system partitions received through TWRP or Magisk, must be completely eliminated.

Check if you have superuser rights. If you have a Magisk or SuperSU icon on the app menu, it's not enough to simply delete them. You need to completely remove the root rights through the corresponding menu in the app or reflash the original boot.img image. Having a modified boot image when you close the bootloader is a direct path to the phone's downtime.

Make sure you are using a global or Chinese official firmware, a region-specific device, or one that is designed for your region. If you have used custom Recovery, it should be replaced with stockware. Ideally, before blocking, it is recommended to do a full reset (Wipe Data) to eliminate file conflicts.

How to check firmware status through ADB
Connect your phone to your PC in debugging mode and type "adb shell getprop ro.build.type." If the answer is "user," it's probably stock firmware. If "eng" or "testkeys" is an engineering build, it's dangerous to lock the bootloader on it.

Necessary tools and device preparation

To do this successfully, you'll need a computer running Windows, and although there are methods for Linux and macOS, the official Mi Unlock Tool and drivers work best in Windows. USB-cable, preferably original, to avoid connection breaks at a critical moment.

You need to install Qualcomm or MediaTek drivers on your computer (depending on your smartphone’s processor), as well as ADB and Fastboot drivers. Without them, the computer will not be able to properly interact with the phone in bootloader mode. All the necessary software can be found on official resources or in trusted development communities.

β˜‘οΈ Preparation for lockdown

Done: 0 / 5

Backup is an important step. The locking process is often accompanied by a complete cleanup of the device's internal memory. Save photos, contacts and documents to the Xiaomi Cloud or Google Drive cloud storage, as well as to an external medium. Data loss in this case is a regular situation that you need to be prepared for.

Step-by-step: locking through Mi Unlock Tool

The safest and most recommended way to close the bootloader is to use the official utility from the manufacturer. This method minimizes risks and automatically checks the compatibility of the software. First, run the Mi Unlock Tool program on your computer and log in to the same Mi Account that is associated with the smartphone.

Put your smartphone in Fastboot mode. Turn the device off completely, then press the power and volume buttons at the same time. The screen will show an image of a hare repairing an android and the inscription will appear on the screen. FASTBOOT. Connect your phone to your computer through USB-cable.

The Mi Unlock Tool interface should display a device connection message. If the status is displayed as "Unlocked", click on the three-bar button in the upper right corner (menu) and select Lock bootloader.

The process is as follows:




1. Connecting the device...




2. Status checks...




3.Sending a lockdown command...




4.Reset and reset data.

Once confirmed, the lock process will begin, the phone will reboot, and the Mi or Redmi logo with a performance indicator may appear on the screen, at which point it is strictly forbidden to turn off the cable or interrupt power, the process can take from 5 to 15 minutes.

πŸ’‘

If the Mi Unlock Tool is in error or freezes during the locking stage, try using another one. USB-port (preferably) USB 2.0) or replace the cable. It also sometimes helps to run the program on behalf of the administrator.

Alternative method: Fastboot command line

For power users who don't have the Mi Unlock Tool GUI, there is a method of manual locking through console commands. This method requires the Platform-tools (ADB/Fastboot) platform installed. Open the command line or PowerShell in the tool folder.

Connect your phone in Fastboot mode and check the connection by entering the command:

fastboot devices

If you see the serial number of the device in response, the connection is set correctly.

fastboot oem lock

Or, for some new models, a command may be required:

fastboot flashing lock

A warning will appear on the smartphone screen that the device will be cleaned and the bootloader locked. To confirm, you usually need to press the volume button (up or down, the instruction will be on the screen) or the power button. After confirmation, the formatting and locking process will begin.

ParameterMi Unlock ToolFastboot Command
DifficultyLow (automatically)Medium (needs PC and console)
Risk of errorMinimumMedium (human factor)
RequirementsMi Account, InternetFastboot drivers only
Speed.Depends on the servers.Instantly.

Possible mistakes and ways to solve them

One of the most common errors is Remote: Device not allowed to lock bootloader, which means that the firmware installed on the phone is not the official stock, or its version does not correspond to the region for which the bootloader is intended, in which case you need to reflash the device through the Mi Flash Tool in Clean All mode.

Another common problem is the logo hanging after locking (Bootloop). If the phone is endlessly rebooted, it is a signal that the system partition has been changed. You will have to unlock the bootloader again (if possible), install stock Recovery and reflash the full firmware package. In some cases, only EDL (Emergency Download Mode) mode and paid authorization Mi Auth help.

⚠️ Note: Once the bootloader is blocked, re-unblocking may become impossible within 7 days (168 hours) of the account being linked if you have reset your settings. Plan your actions ahead of time so you don't have access to phone features.

If the fingerprint scanner or proximity sensor stopped working after blocking, the persist or modem partitions may have been damaged. Recovery of these partitions is possible only from a backup copy (which is rarely done in advance) or through a service center using programming boxes.

πŸ’‘

The key to success is to have a clean, original firmware before the procedure begins, and any modifications to the system must be eliminated before the lock command is given.

Frequently Asked Questions (FAQ)

Will my information be erased when the bootloader is blocked?
Yes, 99% of the time, the Lock Bootloader triggers a complete reset of the device to the factory settings (Wipe Data). All photos, contacts, apps and files will be deleted. Be sure to back up before the procedure begins.
Can I block the bootloader if there is a custom firmware on the phone?
No, you can't. If you try to lock the bootloader on custom firmware (LineageOS, Pixel Experience, etc.), the phone goes into a bootloop (infinite reboot), because the digital signature of the system won't match the signature of the stock bootloader. First you need to return the stock MIUI.
Does the locking of the loader affect the warranty?
Yes, the presence of an unlocked bootloader is an official reason for denial of warranty service in many service centers, and locking returns the device to a β€œfactory state”, which formally eliminates this reason for failure, although specialists can see traces of firmware in the logs.
What if the phone says Locked after locking and doesn’t turn on?
If the screen says "Locked" and the phone is not loading, try pressing the power and volume button to enter Recovery. If the stock Recovery does not start, you will have to unlock the bootloader again (if the account allows) and reflash the device via Fastboot with the "Clean All" flag.
Do I need the internet to block the bootloader?
When using the Mi Unlock Tool, the Internet is mandatory for authorization and checking the status of the device on Xiaomi servers. When using the console command fastboot oem lock, Internet on a PC may not be necessary, but the phone must be pre-linked to the account, which requires a network.