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.
Dozens of premium Android apps go on sale every single day. Check out the latest over at PlayStoreSales.com.
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.
Before you can complete the tutorial below, you first need to install and enable a few things ahead of time.
- You need ADB & Fastboot tools installed on your PC. I recommend Minimal ADB & Fastboot, but you could just use Android's SDK Platform Tools which are provided by Google.
- Next, you will need to enable Android's Developer Mode on your smartphone.
- Then, you'll want to go ahead and enable USB Debugging Mode on the device as well.
- Don't forget to make sure your PC can detect the smartphone using the
ADB devices command.
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).