How to return the bootloader lock to Xiaomi: all ways of 2026

Unlocking the bootloader on Xiaomi devices opens up a wide range of customization options: custom firmware, root rights, or modified cores. However, sometimes users need to return the factory lock β€” whether for sale, warranty repair, or security restoration. Backlocking is much more difficult to unlock and is not officially documented by the company. In this article, we will discuss all current methods, their features and potential risks.

It is important to understand that Xiaomi does not provide a direct tool to re-lock the bootloader through the Mi Unlock Tool. All existing methods are based on the use of utility firmware functions or the use of engineering modes. Some methods require deep technical knowledge, others require special equipment. We will look at the options from the simplest to the most radical so that you can choose the right one.

Before you start, make sure you understand the consequences: wrong actions can lead to a device blink (complete failure) or data loss.

Why you may need to block the loader back

There are several good reasons to return the device to factory status:

  • πŸ“¦ Selling or transferring a smartphone: The new owner may not need an unlocked bootloader, and an open bootloader increases the risks of installing malware.
  • πŸ”§ Warranty repairs: Xiaomi service centers often refuse warranty repairs if they detect an unlocked bootloader.
  • πŸ›‘οΈ Security: A locked bootloader protects against unauthorized access to system partitions, even if the device is stolen.
  • πŸ”„ Back to stock firmware. Some features (e.g. Mi Pay or Widevine) L1) They may not work properly on custom firmware.

But there’s a downside: once you lock, you’ll lose the ability to install unofficial firmware or modifications without re-unlocking, and some locking methods can reset the device to factory settings.

πŸ“Š Why do you want to block the bootloader?
For sale of the device
For warranty repairs
Because of security issues
To return to stock firmware
Other

Official method: Mi Flash Tool (for some models)

The most reliable, but also the most limited way is to use the proprietary utility Mi Flash Tool, which works only on some models (mainly until 2020 release) and requires:

  • πŸ’» Windows computer 7/10/11 (64-bit)
  • πŸ”Œ Original. USB-cable (preferably from the set)
  • πŸ“₯ Fastboot Firmware for Your Model
  • πŸ”‘ Mi Account Linked to the Device

The process looks like this:

  1. Download the official firmware for your model in.tgz format (choose the Stable version, not the Developer version).
  2. Unpack the archive and place the firmware folder in the root of the C:\ drive (the path should not contain Cyrillic!).
  3. Install the Mi Flash Tool and Xiaomi drivers.
  4. Turn off the phone and press Volume Down + Power to enter Fastboot mode.
  5. Connect the device to your PC and in the Mi Flash Tool, select the folder with the firmware.
  6. At the bottom of the window, select the clean all and lock option (this is key!).
  7. Press Flash and wait until it is completed (the process will take 5-15 minutes).

Note that the clean all and lock option is not available for all models, and if it's not on the drop-down menu, it won't work.

Download the correct firmware version |Install Xiaomi |Check the availability of the option clean all and lock |Do backup data | Charge the phone at least 50%

-->

Alternative method: through the Engineering Menu (EDL)

If the official method doesn’t work, you can try blocking the bootloader through Emergency Download Mode (EDL) mode, which is more risky and requires:

  • πŸ”§ Knowledge of working with ADB and Fastboot
  • πŸ’Ύ Special firehose file for your model
  • πŸ”Œ Contact or test point solders (for new models)

Instructions:

  1. Download the QFil or Mi Flash Pro utility (to work with EDL).
  2. Transfer the device to EDL mode: For older models: adb reboot edl For new: you will need to close test contacts on the board (see instructions for a specific model).

QFil

prog_emmc_firehose.mbn

Lock Bootloader

Run the firmware. If everything goes well, the bootloader will be locked.

⚠️ Attention: Incorrect work with EDL This can lead to a complete blink of the device, which can not always be restored even in the service center.

On newer models (Xiaomi 12/13/14 series, Redmi Note 11/12), EDL entry is often blocked at the hardware level, and specialized hardware (such as UFi Box or EasyJTAG) may be required.

Method for advanced: modification of the aboot section

This method involves manually editing the aboot (or bootloader) partition, where the lock status is stored, and requires:

  • πŸ”“ The unblocked bootloader (paradox, but the fact)
  • πŸ“± Root rights (Magisk or SuperSU)
  • πŸ’Ύ Backup copy of the aboot section
  • πŸ–₯️ Knowledge of working with a hex editor (for example, HxD)

Algorithm of action:

  1. Make a backup of the aboot section through ADB: adb shell su dd if=/dev/block/bootdevice/by-name/aboot of=/sdcard/aboot_backup.img
  2. Download. aboot_backup.img on PC and open in HxD.
  3. Find the bytes that are responsible for the lock status (usually offset 0x104 or 0x1FC, but depending on the model).
  4. Change the value from 01 (unlocked) to 00 (locked).
  5. Save the file and backshoot back: adb push aboot_modded.img /sdcard/ adb shell su dd if=/sdcard/aboot_modded.img of=/dev/block/bootdevice/by-name/aboot
  6. Reset the device.

Warning: Incorrect editing of the aboot partition will make it impossible to boot the system, and without a backup, it will be extremely difficult to restore the device.

Where to find offset for your model?
For each model, Xiaomi offset is unique in the status of the bootloader: 1. Thematic forums (4PDA, XDA-Developers in topics about your model. 2. In firmware dumps (look for lines of type "bootloader_lock_state"). 3. Through analysis of stock and modified firmware in Hex, for example, for the Redmi Note. 9 Pro (joyeuse) is offset 0x1FC, and X3 (surya) β€” 0x104.

What to do if nothing works: JTAG and service centers

If all of these methods fail, there are two options:

  1. Official Xiaomi Service Center: πŸ“ Find the nearest authorized SC on the official website. πŸ’° The cost of the service varies from 1,500 to 5,000 rubles (depending on the model). ⏳ Term of implementation: 3 to 10 days.

⚠️ Note: Service centers may be refused if the device was purchased informally (e.g., imported from China) and may require proof of purchase (check or box).

  • πŸ”§ Use devices such as UFi Box, EasyJTAG or Medusa Pro.
  • πŸ’° Price: from 3 000 to 10 000 rubles (depending on the complexity).
  • ⚑ Time: 1-3 hour (usually on the day of the application).
MethodDifficultyCostRisk of a brickSuitable for new models
Mi Flash Tool (clean all and lock)Low.Free of charge.Medium.❌ No.
Engineering Menu (EDL)Tall.Free of charge.High-pitched⚠️ Partially.
Editing by abootVery high.Free of charge.criticalβœ… Yes.
Xiaomi Service CenterLow.1 500–5 000 β‚½Low.βœ… Yes.
JTAG (specialized workshop)Medium3 000–10 000 β‚½Low.βœ… Yes.

Frequent Mistakes and How to Avoid Them

When trying to block a bootloader, users often face typical problems:

  • πŸ”Œ "Device Not Found" in Mi Flash Tool: Solution: Install Xiaomi drivers manually via Android SDK Use Mi Flash Pro instead of the standard utility.

πŸ’‘

If the Mi Flash Tool doesn’t see the device in Fastboot mode, try running the utility on behalf of the administrator and temporarily disabling the antivirus, and reinstalling drivers via Zadig will also help (choose the libusb-win32 driver).

Checking the status of the loader after blocking

To ensure that the bootloader is successfully locked, follow the following steps:

  1. Turn off the device and go to Fastboot mode (Loudness down + Power).
  2. Connect your phone to your PC and type in the command: fastboot oem device-info
  3. Find the Device unlocked: false string. If you have one, the bootloader is locked.

You can also check through the phone menu:

  1. Go to Settings β†’ About Phone β†’ MIUI version.
  2. Tap 7 times on the MIUI version line to activate Developer Mode.
  3. Back to Settings β†’ Additionally. β†’ For developers.
  4. Find the bootloader status, and if it's gray and inactive, the bootloader is locked.

On some models (such as the Xiaomi 13 Pro), the status of the bootloader may not appear in the settings, in which case it is more reliable to check through fastboot.

πŸ’‘

Even if the bootloader is locked, some modifications (such as the modified boot.img) may remain in the system. For complete "purity", it is recommended to flash the stock firmware through Fastboot after blocking.

Can I block the bootloader without losing data?
No, all locking methods involve a complete reset of the device.Be sure to back up important data (photos, contacts, messages) through Mi Cloud or manually on your PC before the procedure.
Will Google Pay work after the bootloader is blocked?
Yes, if you go back to the stock firmware and remove all traces of root rights, some models (like the Poco F3) may require additional Widevine setup to make contactless payments work properly.
Can I unlock the bootloader again after blocking?
Yes, but you will have to go through the standard procedure through the Mi Unlock Tool with a wait of 7-30 days (depending on Xiaomi policy), and you may need to re-assign your Mi Account.
What if the phone doesn’t turn on after locking?
First try going to Fastboot (Loudness Down). + Power) and flash the stock firmware through the Mi Flash Tool. If this does not help, contact the service center with the help of the device. JTAG-equipment.
Does the lock work on devices with a Snapdragon 8 Gen 2/3 processor?
On new flagships (Xiaomi 13 Ultra, 14 Pro), standard locking methods often don’t work because of hardware protection, and only a service center or JTAG will help in such cases.