In order to keep the user protected Android devices have what they call a bootloader. In a locked state, it is responsible for making sure the software installed is authentically signed by the OEM. If your device is unlocked then this guide will show you how to lock (or relock) the bootloader of the Xiaomi Mi A2.
So last week I showed you how to unlock the bootloader of the Xiaomi Mi A2. I did this because a lot of people want to install software on their phone that isn’t signed by the OEM. Without doing that, we can’t install things such as TWRP, Magisk, custom ROMs and more. Some people don’t want to do any of that though.
In those cases, you will want to make sure the bootloader is locked. When you buy any Android phone brand new the bootloader is locked by default. But you may have purchased a used Xiaomi Mi A2 and noticed that the bootloader is unlocked thanks to the warning screen.
Or maybe you unlocked the bootloader yourself. Many people see these mods and want to experiment with a custom ROM or a custom kernel. That requires you to unlock the bootloader but maybe you’re done experimenting and would rather just go back to the way things were.
This is why I have created this tutorial. To show you how we can go back to the way things are.
Warning – Not only will relocking the bootloader of the Mi A2 erase all of the data from your smartphone (apps, games, pictures, videos, app settings, etc.), but it can also be dangerous to do if you have modded software on your phone. I personally recommend following an ‘unbrick’ or ‘return to stock’ guide before locking the bootloader of the Xiaomi Mi A2.
In order to complete the tutorial below, you're going to need some things set up ahead of time. Please follow the how to install ADB and Fastboot tools guide if you haven't done so already. Then you will need to follow the how to enable Developer Mode guide, as well as the tutorial that shows you how to enable USB Debugging Mode.
You will then need to open a command prompt within the within the same folder as your ADB and Fastboot tools and execute the "adb devices" command (without quotes) to start the ADB service. Then connect the device to the PC with a USB cable and you should see the prompt to grant USB Debugging Mode access from the PC the phone is connected to.
Once granted, you can then test this by running the command "adb devices" again (without quotes) in a command prompt or PowerShell to make sure the computer recognizes the device.
How to Relock the Bootloader the of the Mi A2
- Boot the Xiaomi Mi A2 into Fastboot Mode
- Connect the Mi A2 to the PC with a USB cable
- Open a Command Prompt or Windows PowerShell in the same folder as your ADB/Fastboot tools
- And then type in the following command. . .
fastboot flashing lock
- Then press the Volume Down button twice to highlight the Lock the Bootloader option
- Press the Power button to select this option
- Watch as the Xiaomi Mi A2 reboots on its own and wait
This first boot cycle will take a while since it performs a factory reset and then has to set everything back up again. So be patient and/or follow along with the video below.
So as I mentioned above, there will be two type of people who will find this guide useful. If you’re the one who did the bootloader unlock stuff on your own then this entire process should feel familiar. If that is the case then just be sure you follow through with the same steps.
The only difference here is that the process is actually much shorter. The unlock tutorial was 16 steps and this one is only 6. That’s because we don’t have to go through the OEM unlock toggle process. Speaking off, once you have relocked the bootloader of the Mi A2, you could go back into Developer Options and disable the OEM Unlocking option if you wanted to.
Just make sure you type in fastboot flashing lock instead of fastboot flashing unlock and you’ll be fine. You’ll see a similar warning screen appear on your Mi A2 and you will still need to use the Volume Up, Volume Down and power buttons to navigate through the menu.
How to Relock the Mi A2 Bootloader?
Now, if you purchased a Mi A2 from a friend or used from some online marketplace then things could be different. Firstly, you could be familiar with this process in general and just needed this guide to make sure you knew the relock command. However, this may be foreign to you and that can be worrisome.
The process is simple though (again, remember the actual tutorial is only 6 steps). However, you may not have ADB and Fastboot tools installed on your computer. You may not even have the proper USB drivers installed (although those should install automatically when you connect the phone to the PC).
If you’re in this segment then I recommend looking above the tutorial and installing the Minimal ADB and Fastboot tools that I have linked over on XDA. Not only will this get you the up to date tools that you need installed, but it also comes with a convenient icon shortcut that you can put on the desktop.
This way, when I say ‘open a command prompt in the same folder as your ADB and Fastboot tools’, you can just double click that shortcut that the program created for you. It will open up a Command Prompt in the same folder as your Fastboot.exe file and you can continue with the tutorial.
You could also navigate to where your ADB and Fastboot tools are located in via Windows Explorer though. Then hold the Shift key on the keyboard and right click on an empty spot of the folder. Doing this will make a new option appear in the context menu labeled Open PowerShell Window Here.
And this will effectively give you the same results (just with Windows PowerShell instead of the Command Prompt).
If this tutorial helped you in any way, please consider donating via PayPal, Patreon, Cryptocurrency, or GoFundMe. If you can't afford to donate then sharing this on social networks such as Facebook, Twitter, XDA, forums, etc. will also help a lot. I would also appreciate suggestions for Android tips and tutorials that you would like to see in the future.