Locking a bootloader on Xiaomi smartphones after unlocking it is not as trivial as it might seem. In 2022, the company tightened its security policy, and the standard methods used in the 2018-2020 models have ceased to work. If you unlocked the bootloader to install custom firmware, but now want to return factory protection β for example, before selling the phone or to improve security β this guide will help you do this without the risk of βbrickingβ the device.
Unlike unlocking, which requires waiting 7-30 days and binding a Mi Account account, bootloader locking is often done manually via Fastboot or a Fastboot. ADB. However, there are pitfalls here: the wrong command can lead to data loss or even the inability to turn on the phone.We will look at three proven methods (official through Mi Unlock Tool, manual through fastboot oem lock and alternative using the same method). EDL-The mode is also explained why locking doesnβt always go away the first time on 2022 models like the Redmi Note 11 Pro.+ Xiaomi 12T.
Important: locking the bootloader will result in the phone being completely reset to factory settings (including internal memory).If the device has important data, back up in advance via Mi Cloud or locally on the PC. Also make sure the battery is at least 60% charged - interrupting the process can make the phone inoperable.
Why you might need to block the bootloader on Xiaomi
At first glance, the unlocked bootloader gives you more freedom: the ability to install custom firmware (LineageOS, Pixel Experience), get root rights or restore the phone through TWRP. However, there are good reasons to return the factory lock:
- π Data security: On a device with an unlocked bootloader, an attacker can access the file system even without a password by connecting the phone to a PC.
- π° Warranty service: Xiaomi service centers refuse to repair under warranty if the bootloader is unlocked (even if the breakdown is not related to the firmware).
- π± Stability: Custom firmware often contains bugs, especially on newer 2022 models (Snapdragon 8 Gen 1, Dimensity 9000), where drivers can conflict with the core.
- π Updates by air (OTA): Unlocked bootloader official updates MIUI They may not be installed or cause errors.
In addition, some banking applications (such as SberBank Online or Tinkoff) block work on devices with an unlocked bootloader, citing security risks. Even if you did not install root, the mere presence of an open bootloader can cause a refusal of authorization.
β οΈ Note: On Xiaomi 2022 models with MediaTek processors (e.g. Redmi Note 11 on Helio) G96) Locking the bootloader via fastboot oem lock can lead to an error FAILED (remote: 'Not allowed in Lock State'. EDL-mode (emergency firmware).
Preparing the phone for the loader lock
Before you start locking, you need to follow a few critical steps, and neglecting them can lead to a "brick" (inoperable state) of the phone.
First, check the current status of the bootloader.
- Turn off the phone.
- Press the Power + Volume buttons down to log into the Fastboot.
- Connect your phone to your PC and type in the command line: fastboot oem device-info
- Find the Device unlocked: true string. If it's present, the bootloader is unlocked.
Second, make sure that the phone has official MIUI firmware installed (not custom) and locking on unofficial builds will cause an error to return the stock firmware:
- π₯ Download the latest version of Fastboot-ROM for your model from en.miui.com.
- π₯οΈ Use the Mi Flash Tool to Firmware in Clean All Mode (this will delete all data!).
- π After the firmware, reset through Settings β Additionally. β Recovery and discharge.
Third, prepare the PC:
- π» Install the latest versions ADB Fastboot (you can download from the Android website).
- π Make sure Xiaomi drivers are installed (when connecting to Fastboot, the phone should be defined as Android Bootloader Interface).
- π Disable the antivirus, it can block the Mi Unlock Tool.
Install official firmware MIUI|Download ADB/Fastboot and Mi Flash Tool|Check the status of the bootloader through fastboot oem device-info|Make a backup copy of the data|Charge the phone before 60% more-->
Method 1: Official locking with Mi Unlock Tool
The most reliable way is to use the official Mi Unlock Tool, which is also used for unlocking, but in 2022 Xiaomi limited the ability to block through this tool for certain regions, if your Mi Account is tied to Russia, Ukraine or Belarus, the method may not work.
Instructions:
- Download Mi Unlock Tool from the official website (version no lower than 5.5.224.24).
- Sign in to the tool under the same Mi Account that was used to unlock.
- Connect your phone in Fastboot mode (Power buttons + Volume down).
- In the tool, click Unlock β despite the name, it can offer a lock option if the device is already unlocked.
- If you see a message that says "Couldn't unlock. Your device isn't supported," try alternative methods.
If the Mi Unlock Tool doesnβt offer a lock option, try the following trick:
- π Manually change the config.ini file in the tool folder by adding a line: [unlock] allow_lock=1
- π Re-launch Mi Unlock Tool on behalf of the Administrator.
β οΈ Attention: On models POCO F4 GT and Xiaomi 12 Pro with Snapdragon 8 Gen 1 processor official tool can block the bootloader, but after that the phone will stop booting into the system. EDL.
Method 2: Blocking through Fastboot commands
If the official tool didnβt work, you can try locking the bootloader manually through Fastboot, a method that works on most 2022 models, but requires caution.
Step-by-step:
- Open the command line (Win) + R β cmd) in the folder ADB/Fastboot.
- Connect the phone in Fastboot mode and check its detection by the command: fastboot devices (should display the serial number of the device).
- Enter the lock command: fastboot flashing lock or (for older models): fastboot oem lock
- Confirm the action on your phone using volume buttons (select Yes and press Power).
- Wait for the reboot. It can take up to 10 minutes to start.
If the fastboot flashing lock command returns the FAILED error (remote: 'Flashing is not allowed in Lock State'), try:
- π§ Use the command fastboot flashing lock_critical (Blocks only critical sections).
- π Pre-swipe the official firmware through the Mi Flash Tool in clean all and lock mode.
| Model Xiaomi (2022) | Supported team | Possible errors |
|---|---|---|
| Redmi Note 11 Pro/Pro+ | fastboot flashing lock | Not allowed in Lock State (EDL required) |
| POCO X4 Pro 5G | fastboot oem lock | FAILED (remote: 'Command not allowed') |
| Xiaomi 12/12 Pro | fastboot flashing lock_critical | Success, but possible bugs with OTA-update |
| Redmi K50 | fastboot flashing lock | Requires prior firmware for stock recovery |
π‘
If you stop turning on after fastboot flashing lock, don't panic. Connect it to your PC, launch the Mi Flash Tool, and run the official firmware in clean all mode.
Method 3: EDL-Blocking (for MediaTek and problem cases)
EDL-Emergency Download Mode is a firmware emergency mode that allows you to restore the phone even if it doesn't turn on. It is required for models on MediaTek (for example, Redmi Note 11), where the standard fastboot commands do not work. EDL It will help if after blocking the bootloader the phone stopped loading.
For EDL entry:
- Turn off the phone.
- Press the Volume Up + Volume Down buttons and connect the USB cable to the PC (hold the buttons for 10-15 seconds).
- Install the Qualcomm HS-USB QDLoader 9008 driver (you can download it on XDA).
- In Device Manager, check that the phone is identified as a Qualcomm HS-USB QDLoader 9008 (COMX).
To lock the bootloader through EDL:
- π₯ Download the Mi Flash Tool and the official firmware in.tgz format for your model.
- π₯οΈ In Mi Flash Tool, select Clean All and Lock mode.
- π Put the phone in. EDL-mode and press Flash.
- β³ Wait until the process is completed (the process can take up to 10 minutes).
β οΈ Attention: Use EDL Without official permission, Xiaomi may be blocked. IMEI on certain models, for example, POCO F4 GT). If you are not sure, it is better to contact the service center.
What if the Mi Flash Tool doesnβt see the phone in EDL?
Checking the results and possible problems
After locking the bootloader, you need to make sure that the procedure was successful.
- Enter Fastboot (Food + Volume Down).
- Command: fastboot oem device-info
- Check the Device unlocked: false string. If it's present, the bootloader is locked.
Common problems and their solutions:
- π΄ Phone does not turn on after locking: run the official firmware through the Mi Flash Tool in clean all mode.
- π΄ Invalid partition error: So the stock firmware was not installed before the lock.
- π΄ It's not working. OTA-Update: Reset through Settings β Recovery and discharge.
- π΄ Mi Unlock Tool shows "Device is locked," but fastboot oem device-info says the opposite: restart your phone and check again.
If you notice that your phone is slowing down or warming up after locking, that's OK -- MIUI can optimize the system within 24 to 48 hours. If problems persist, reset to factory settings.
π‘
Locking the bootloader on Xiaomi 2022 models often requires pre-running official software through the Mi Flash Tool. Without this, fastboot commands will not work or lead to errors.