How to Re-Lock Bootloader on Xiaomi, Redmi, Poco

Bhanu Pratap
By Bhanu Pratap 7 Min Read

Unlocking the bootloader on your Xiaomi device might be a necessity, but there are situations where relocking it becomes crucial. This tutorial is designed for those seeking to understand the process of locking the bootloader on Xiaomi devices after having unlocked it.

It’s common knowledge that services like Google Pay operate seamlessly on a locked bootloader without root access. While tools like Magisk can partially address this concern, there are scenarios where even Magisk falls short.

Before delving into the locking process, a quick check of your device’s active bootloader status is recommended. Navigate to the developer menu and locate the “Mi Unlock Status” line. Clicking on this will reveal a white page indicating whether the bootloader is unlocked.

Note

Never attempt to lock the bootloader on MIUI Global Stable firmware if your phone version is Chinese.

Why You Should Lock the Bootloader?

1. Enhanced Security

  • Unlocked phones are more vulnerable, making them susceptible to unauthorized access.
  • Security features like screen lock, fingerprint recognition, and facial recognition are disabled, posing a risk in case of theft.

2. Service Support

Certain services like Android Pay may refuse to function on unlocked bootloaders due to security concerns.

3. Reselling Devices

When selling a used device, relocking the bootloader prevents potential buyers from changing their minds post-purchase.

4. HyperOS Updates

The new changes have been made by Xiaomi for those who are willing to get the HyperOS Official OTA Updates. To receive the official HyperOS Updates on your Xiaomi, Redmi, or Poco smartphone, your bootloader must be locked.

Method 1: Lock Xiaomi Bootloader Using MiFlash (Data Deletion)

This method is straightforward but comes with a significant drawback – all data from the device’s internal memory will be deleted. Make sure to transfer important information to an SD card before proceeding.

Preparation:

  • Download Mi Flash Tool, extract and set it up on your PC.
  • Download the official fastboot firmware for your model and extract it.
  • Ensure USB drivers are installed and you have the USB Cable to connect your phone to the PC.
  • Back up all essential data.
  • Charge the phone to at least 60%.

Steps to Lock Bootloader

1. Turn off the phone and enter “fastboot” mode by long-pressing the “power” and “volume down” buttons together.

2. Connect the phone to the PC using the original USB cable.

3. Open the MiFlash program and run XiaoMiFlash.exe as administrator.

4. Click on “Select” or “Open” and specify the path to the fastboot ROM folder you extracted.

5. Press “Refresh” to display device data to ensure your smartphone is connected to the PC.

6. Now, at the bottom right of the Mi Flash Tool window, checkmark the option “Clean all and Lock” is active.

7. Finally, click “Flash” and wait for Mi Flash Tool to complete the flashing process.

Once the flashing is done, boot your device, or it will boot automatically and the bootloader of your device will be locked.

Method 2: Lock Xiaomi Bootloader via ADB (Without Data Deletion)

This method is preferable as it doesn’t delete data, but it may not work for all models all the time.

Pay careful attention to the following four warnings:

  • This method may not function on all models, particularly those released before 2017. Newer models, based on our observations, tend to be more compatible.
  • There’s a 50/50 chance that data from the phone might be intermittently deleted until a specific pattern is identified. It’s crucial to create a backup of essential files and application data.
  • The bootloader lock is only effective with the official stable firmware. Localized versions of MIUI, let alone custom firmware, will not be compatible.
  • Attempting to lock the bootloader via ADB (using this method) on any firmware, including the official one, carries a risk of encountering a boot loop or eternal boot.

Requirements:

  • Make sure USB Debugging is enabled on your phone. If not, then go to Settings > Additional Settings > Developer Options > USB Debugging and toggle on its switch.
  • Ensure you have ADB and Fastboot drivers installed on your computer.

Steps to Lock Bootloader

1. Put the phone into fastboot mode. For this, power off your phone and then long-press “Power” and “Volume Down” together.

2. Once your phone is in fastboot mode, connect the phone to the PC.

3. Open the folder with ADB and Fastboot drivers. While pressing the SHIFT key, right-click in the folder, and choose “Open via Power Shell.”

4. Inside the Powershell window, enter the following command to check if your device is properly connected to your PC:

fastboot devices

If you see the device ID after executing the command, then your are good to go.

5. Now, execute the following command to check the current status of your phone’s bootloader:

fastboot oem device-info

You’ll see a number of entried there. Check for the “device unlocked” entry if its value is is “true” then your device bootloader is unlocked.

6. To lock the bootloader, execute the following command:

fastboot oem lock

You should get the “OKAY” in response after executing the above command. That means the bootloader is locked now.

7. To verify it, execute the following command again:

fastboot oem device-info

You should get “false” for the “device unlocked” entry. That means your bootloader is successfully locked.

8. Finally, execute the following command to reboot your device:

fastboot reboot

Frequently Asked Questions (FAQ)

Why did data get deleted using the MiFlash method?

No pattern was found, and data deletion is inconsistent.

Is a backup necessary?

Yes, it is obligatory.

My computer won’t install third-party drivers, what should I do?

Try disabling antivirus software, update existing drivers, and check compatibility.


Even for beginners, locking the bootloader on Xiaomi devices is achievable. Follow the steps precisely, and for any additional questions, feel free to ask in the comments.

Share This Article
Leave a comment

Leave a Reply

Your email address will not be published. Required fields are marked *