This tutorial will be useful for those who want to know how to lock the bootloader Xiaomi after unlocking it. Everyone knows that Google Pay works only on a locked bootloader without root rights. Magisk can partially solve this problem, but even it is powerless in some situations.
A quick check of the active bootloader can be done in the menu for developers, where you need to find the line“Mi Unlock Status“. Clicking on this item will open a white page with the words “The bootloader is unlocked”.
Possible reasons for locking
- Low security. Such a phone becomes very vulnerable, and intruders can hack it with a couple of clicks. The password that locks the screen is removed instantly, and the fingerprint and facial recognition are also removed. In the case of theft of the smartphone will have to try hard to find the loss because Google Lock is also disabled.
- Lack of support for some services. For example, Android Pay, which helps to pay in stores with a smartphone, often refuses to work, citing insufficient security and, consequently, the unlocked downloader. All attempts to make the application work again, even with root rights, end in failure.
- Reselling the device. When selling a used smartphone or tablet, you often need to lock the bootloader, so the buyer does not change his mind about buying it. From personal experience, I can say that this happened in 3 out of 10 cases, and then I had to either lock the bootloader or wait for a new buyer.
- Other reasons.
Locking Xiaomi bootloader through MiFlash (deleting all the data)
We strongly recommend that you transfer important information to the SD card and be sure to remove it.
This is the easiest way, which can be done even by a novice, but there is a significant disadvantage – all data from the device’s internal memory will be deleted. Even a backup before the operation sometimes does not save the situation. Locking the bootloader through MiFlash will return the smartphone to its full factory state from purchase.
The procedure is quick and easy enough, but it is still worth preparing for. MiFlash.zip (version of 2018.11.15).
- Download the official firmware for your model(for flashing in Fastboot mode). Move the folder with the files to the root of drive C.
- Prepare the USB cable and download the drivers for your PC. Read more in the article about connecting Xiaomi to the computer.
- Download and unpack the archive with the Mi Flash program from the link above.
- Back up all important data and transfer the necessary files to an external storage device.
- Charge the phone to at least 60%.
Sequence of actions
- Turn the phone off, and put it into “fastboot” mode by pressing the “power” and “volume” buttons.
- Connect the phone to the PC using the original USB cable.
- Open the folder with the MiFlash program and run the XiaoMiFlash.exe file.
- Click on the“Select” or“Open” button (depending on the software version). Using the system explorer specify the path to the folder where the firmware files are located.
- Press the “Refresh” button, and data about the device should appear.
- Pay attention to the option “Clean all and Lock“. It must be active. It is this step. It is responsible for locking the bootloader.
- Now press the last button, “Flash” and wait for the flashing to finish.
- That’s all. All the necessary steps are done. After turning on the phone, you can do the initial setup and restore backup files.
Locking Xiaomi bootloader via ADB (without deleting data)
This is the best option where the files you need don’t disappear, but not always. Now take a close look at the 4 warnings:
- This method does not work on all models. This is especially true for phones released before 2017. On newer models, according to our observations, everything works.
- Data from the phone is deleted every once in a while, about 50/50, until a specific dependence is found. So do not forget to make a backup copy of important files and application data.
- The lock will only work with the official stable firmware. Even localized versions of MIUI will not work, let alone custom firmware.
- If you try to lock the bootloader via ADB (this method) on any firmware(even the official one), there is a chance of a boot loop or eternal boot.
The first thing to do is to check if the ADB and Fastboot drivers are installed on the computer. They are default located on the system drive C in the folder “adb”. If there is no such folder, download it from this link.
And finally, let’s get down to blocking:
- First, put the phone into fastboot mode, just like the previous option, by holding power and volume buttons down. Hold it up to vibration.
- Let’s connect the phone to the computer. You should also check if “USB debugging” is enabled in the Xiaomi settings menu.
- On the PC, go to the folder where the adb and fastboot drivers are installed. Right-click on the free area of the folder with Shift-click on your keyboard. Choose the command“Open via Power Shell“.
- In the window that appears, type the command “fastboot devices“, then the device ID is shown.
- Once again, check if the bootloader is unlocked. Enter the command “fastboot oem device-info“. Some entries will appear in English, and if against the inscription“device unlocked” you will see“true, ” meaning that the bootloader is unlocked.
- The most important step is to write the command directly to lock “fastboot oem lock“.
- The word”OKAY” should appear if you have entered it correctly.
- Check the bootloader status again with the command “fastboot oem device-info“. It must be “false”. Alright, the operation is completed, and the bootloader is locked.
- Now reboot the phone with “fastboot reboot“.
Why use the 2nd way the data was deleted from the phone?
As stated – no pattern was found in this process.
Is it necessary to make a backup?
Yes, a backup is obligatory.
My computer says I can’t install third-party drivers, what should I do?
Try to disable anti-viruses and other blocker software. Update your existing drivers and check the compatibility of those installed with your PC.
As you can see, even a novice can lock the previously unlocked bootloader on his Xiaomi. The main thing is to do all the steps according to the described instructions. If you have any additional questions – write in the comments.