How to Close a Xiaomi bootloader: A Complete Guide to Risks and Solutions

The bootloader on Xiaomi, Redmi and POCO smartphones is a low-level program that runs to the operating system and determines which software will be downloaded. It is blocked by the manufacturer by default to protect against unauthorized changes, but many users will unlock it to install custom firmware or root rights. However, an open bootloader creates security risks and can lead to problems with the warranty or stability of the device.

In this article, we will discuss how to close a bootloader on Xiaomi, both for devices with an officially unlocked Bootloader (via the Mi Unlock Tool) and for those where the lock was removed by informal methods. It is important to understand that the process is not always reversible: some models (especially older ones) can lose functionality after re-locking, we will also look at alternative ways to protect the device without closing the Bootloader and answer frequent questions about the consequences.

Warning: manipulation of the bootloader is a high-risk operation. On Xiaomi 12T, Redmi Note 11 Pro+ and the newer Bootloader re-lock can lead to the hardware block of the eMMS drive if the firmware has been changed. If you are not sure about your actions, contact the service center.

Why you might need to close the bootloader on Xiaomi

The main reasons why users want to return the factory lock Bootloader:

  • πŸ”’ Security: An open bootloader allows you to install uncertified software, which increases the risk of malware infection or data leakage.
  • πŸ“± Warranty service: Xiaomi service centers refuse to repair under warranty if they detect an unlocked Bootloader (even if the problem is not related to the firmware).
  • πŸ”„ Stability: Castom firmware or incorrect modifications can cause lags, overheating, or spontaneous reboots. Shutting down the bootloader often solves these problems.
  • πŸ’° Device Sale: Aftermarket buyers prefer smartphones with original firmware and locked Bootloader.

However, there is a downside: after blocking, you will lose access to:

  • βš™οΈ Castom firmware (LineageOS, Pixel Experience, etc.)
  • πŸ› οΈ Rooting through Magisk or SuperSU.
  • πŸ”§ Modified cores and patches (e.g., to improve autonomy).

⚠️ Warning: On Qualcomm Snapdragon 8 Gen 1/2 processors (e.g., Xiaomi 13 Pro, Redmi K60 Pro) re-locking the Bootloader may result in a loss of IMEI or a failed camera if you have previously installed unofficial firmware.

Preparation of the device before closing the loader

Before you start blocking Bootloader, you need to follow a few critical steps, skipping any of them can lead to a "brick" (inoperability) of the device.

Make a backup copy of all data (photos, contacts, messages)

Check the device model and firmware version in Settings β†’ About the phone

Make sure that the device is official firmware MIUI (not custom)

Charge the battery at least 60%

Prepare the original USB- cable (preferably from the kit)

Download the latest version of the Mi Unlock Tool from Xiaomi’s official website

Turn off all anti-colours and firewalls on PC-->

Pay special attention to the firmware version. If you have installed custom software (such as Xiaomi.eu or LineageOS), be sure to return to stock MIUI via Fastboot.

  1. Download the official firmware for your model from the MIUI Downloads website.
  2. Unpack the archive in a folder with fastboot files.
  3. Connect your phone to your PC in Fastboot mode (clip Volume Down + Power when the device is off).
  4. Run the command: fastboot flash all [name file firmware].tgz

If you are not sure about your model, check it out through the ADB team:

adb shell getprop ro.product.model

Or find a sticker under the lid of the case (on models with a removable battery).

Official. MIUI Global|Official. MIUI China|Custom (Xiaomi.eu, LineageOS, etc.)|I don't know.|other-->

Method 1: Close the bootloader via Mi Unlock Tool (official method)

This is the safest way, but it only works if Bootloader is officially unlocked through your Mi Account. If you’ve used workarounds (like exploits or paid services), this method won’t work.

Requirements:

  • πŸ“± Device with official firmware MIUI (not custom!).
  • πŸ”‘ The Mi Account that was used to unlock.
  • πŸ’» Windows computer (7/10/11) and installed Xiaomi drivers.
  • πŸ”Œ Original. USB-cable (important for stable connection).

Step-by-step:

  1. Download the Mi Unlock Tool (the latest version) and install it on PC.
  2. Sign in to the program under the same Mi Account that was used to unlock.
  3. Turn off the phone and put it in Fastboot mode (clip Volume Down + Power).
  4. Connect the device to a PC. The Mi Unlock Tool should show a message Phone connected.
  5. Press Lock (in some versions, Lock Bootloader).
  6. Confirm the action on the phone screen (if you receive a request).
  7. Wait until the process is complete (usually takes 1-3 minutes).

If you see a message instead of a Lock button, please try again later.

  • πŸ”΄ The device has an unofficial firmware installed.
  • πŸ”΄ The Mi Account is not the same as the one used to unlock.
  • πŸ”΄ The device is blacklisted by Xiaomi (for example, after attempting to bypass protection).

⚠️ Warning: On the POCO F3/F4 and Redmi K40/K50 models, after blocking the Bootloader, support for 5G- modems may be lost if modified firmware has been installed before.

πŸ’‘

The official Mi Unlock Tool method only works for devices that are legally unlocked. If you've used workarounds, read the next section.

Method 2: Close the bootloader via Fastboot (for unofficially unlocked devices)

If Bootloader was unlocked through exploits (e.g. EDL or Deep Flash Cable), or you don't remember Mi Account, the official Mi Unlock Tool won't help. In this case, you can try to block the bootloader through Fastboot commands, but this is risky.

Warnings:

  • 🚨 High risk of blink: 30% of devices after this procedure have an Anti Rollback error that requires flashing through EDL.
  • πŸ”§ Experience with ADB/Fastboot is required.
  • πŸ“± The method does not work on devices with MediaTek processors (e.g., Redmi Note 10, POCO M4 Pro).

Instructions:

  1. Install Platform Tools (includes fastboot).
  2. Turn your phone into Fastboot mode (Loudness down + Power).
  3. Connect the device to your PC and check the connection with the command: fastboot devices should appear serial number of the phone.
  4. Run the lock command: fastboot oem lock or for new devices: fastboot flashing lock
  5. Confirm the action on the phone screen (if you receive a request).

If the phone doesn’t turn on after restarting or if this device is locked, try:

  1. Swipe the official firmware through Fastboot (fastboot flash all command.tgz).
  2. If it does not help, use EDL- mode (requires an authorized Xiaomi account or paid service).
What if the phone doesn’t turn on after locking?
If the device does not respond to the power button, but the PC detects it in Fastboot, try: 1. Switch only the boot: fastboot flash boot.img section (the boot.img file is taken from the official firmware). 2. If it does not help - flash the full firmware through the Mi Flash Tool in Clean All. 3 mode. On models with MediaTek, you may need firmware through the SP Flash Tool with authorization.

Method 3: Closing the bootloader via EDL (for power users)

EDL (Emergency Download Mode) is an emergency firmware mode that allows you to restore the device even when the Bootloader is damaged.

  • πŸ”‘ An authorized Xiaomi account (or paid credit on sites like miuirom.org).
  • πŸ’» A Deep Flash Cable or adapter for forced translation to EDL.
  • πŸ“₯ Official firmware in.tgz or.mbn format.

Step-by-step:

  1. Download the Mi Flash Tool and unpack the firmware for your model.
  2. Put your phone in EDL mode: For Qualcomm: Press Volume Up + Volume Down + Power (on the device turned off) and plug in the cable. For MediaTek: you need to short-circuit the contacts on the board (you better trust a specialist).

Mi Flash Tool

Refresh

COM-port

Clean All

Flash

After the firmware is completed (5-10 minutes), the phone will automatically restart with the Bootloader locked.

Risks of the method:

  • πŸ”΄ Data loss (including internal memory)
  • πŸ”΄ Possible loss of IMEI or serial number (solved by firmware NVRAM).
  • πŸ”΄ Newer devices (Xiaomi 14, Redmi Note 13) may be able to work with anti-rollback protection.
Model of the deviceSupport for EDLRisk of losing IMEIAuthorization required
Xiaomi 11/12/13Yes.Medium.Yes.
Redmi Note 10/11/12Yes.Low.No (for old firmware)
POCO F3/F4/F5Yes.High-pitchedYes.
Redmi K50/K60Yes.Medium.Yes.
Devices on MediaTekLimitedly.High-pitchedYes.

⚠️ Warning: On devices with Snapdragon 888/8 Gen 1/2 processors (e.g., Xiaomi 12 Pro, Black Shark 5) firmware via EDL can result in hardware locking eMMS if the firmware version is lower than the current one. Always use the latest official firmware!

Method 4: Alternative methods of protection without closing the Bootloader

If shutting down the bootloader seems too risky but you want to improve the security of the device, consider these alternatives:

  • πŸ” Enable boot check: In the developer settings (Settings β†’ About Phone β†’ Version MIUI – press 7 times) activate Verify Boot. This will block the launch of uncertified cores.
  • πŸ›‘οΈ Install official software: Go back to stockware MIUI and drop custom firmware. This will reduce the risk of vulnerabilities.
  • πŸ”‘ Use Secure Boot: On some models (e.g. Xiaomi 13 Ultra), the command is available in Fastboot: fastboot oem enable-secure-boot It includes verification of the signature of boot files.
  • πŸ“± Activate Mi Cloud: Link your device to your Mi Account and enable Find Device and Remote Lock. This won't replace Bootloader locking, but will add a layer of protection.

Advantages of alternative methods:

  • βœ… No risk of device blinking.
  • βœ… Updates OTA are still available.
  • βœ… No data reset is required.

Disadvantages:

  • ❌ Not all methods work on custom firmware.
  • ❌ Secure Boot can conflict with Magisk or Xposed.

πŸ’‘

If you plan to sell the phone but don’t want to risk locking Bootloader – complete a full factory reset (Settings β†’ Additional β†’ Restore and Reset) and untie your Mi Account. This will delete all data and make the device β€œclean” for the new owner.

Frequent mistakes and their solutions

When you close the bootloader, users often face problems, and let's look at the most common errors and how to fix them.

Mistake.Reason.Decision
Couldn't lock. Please try again laterUnofficial firmware or mismatch of Mi AccountReturn to stock MIUI and use the original account
This device is locked after restartingThe firmware is incompatible with the current version of BootloaderSweep the full official firmware through Fastboot
Anti-Rollback errorReversed to an older version of MIUISweep the latest version of the firmware for your model
The phone does not turn on after fastboot oem lockBoot or system partition damagedSwitch boot.img and system.img manually through Fastboot
Network loss (no IMEI)Modem or NVRAM partition is damagedSwitch NVRAM via SP Flash Tool (for MediaTek) or QFil (for Qualcomm)

If none of the methods worked and the device didn’t turn on, contact Xiaomi’s service center with the problem: β€œDevice stuck after bootloader relock.” In some cases, recovery is possible only through EDL with authorization.

FAQ: Answers to Frequent Questions

Can I close the bootloader on Xiaomi without losing data?
No, 90 percent of the time, the procedure results in a complete reset of the device, and even if the data is saved, the integrity is not guaranteed. Always back up before you manipulate the Bootloader.
Will Magisk work after the bootloader closes?
No, Magisk requires an unlocked Bootloader to install, and once locked, the root rights will be lost, and trying to restore them will lead to a looped restart (bootloop).
Can I close the bootloader on devices with MediaTek?
Technically, yes, but the process is more complicated than Qualcomm. Requires: Firmware via SP Flash Tool with authorization. Using MTK Auth Bypass utility (paid). Manual editing of the preloader file (brick risk ~50%). For most users, it is easier to contact the service.
What if after closing the bootloader, the phone asks for a password from the Mi Account?
This is Xiaomi's standard post-reset protection. Enter the account that was linked to the device. If you don't remember the password: Try to restore access via account.xiaomi.com. If the account is deleted, contact Xiaomi with proof of purchase. Bypassing this protection is illegal and may result in the device being blocked.
How to check if Bootloader is blocked after the procedure?
Turn off the phone and turn it on in Fastboot mode (Loudness down). + At the bottom of the screen should be the inscription: Device is locked - Bootloader is locked. Device is unlocked - Bootloader is unlocked. You can also check the command: fastboot oem device-info Search for Device unlocked: false.