The gateway to entering the custom development involves unlocking the bootloader on your Android device. Once you’ve done that, you’ll be in a perfect position to welcome abode a wide range of mods and tweaks onto your device. However, it has a few issues as well.
For starters, you might struggle to install official OTA updates or the SafetyNet might get tripped. But don’t worry as there are ways to overcome such issues. If you want to relock the bootloader of your phone, then this guide is perfect for you. In this guide, you will get to know how to relock the bootloader on any Android smartphone.
How to relock the bootloader on any Android smartphone
Step 1: Remove the root and mods
- First, uninstall the rooted mod apps by heading over to their App Info page and then choosing Uninstall -> OK
- After that, launch Magisk
- Go to the Modules section and then disable the modules
- Once it is done, you should tap on Remove next to each module
- After that, tap on Uninstall Magisk and Complete Uninstall
- Your device will now undergo a reset and be unrooted
Step 2: Verify Root removal
- Install Ruru by going to GitHub to re-verify that the mods have been removed
- After that, launch it and ensure that there are no “Suspicious” or “Found” files present
- In case there are any, remove all of them from your device before re-checking the results
Step 3: Flash the stock firmware
Before relocking the bootloader on your Android smartphone, you’ll also get to revert to the stock ecosystem, going from a custom ROM back to stock. The process to do that will depend on the device your own. For instance, in the case of OnePlus smartphones, you can use the Fastboot Enhance Tool or the MSM Download Tool.
For Pixel devices, you can use the Android Flash Tool or the Fastboot script. Likewise, Mi Flash Tool can come in handy for Xiaomi devices. You should carry out this process and then go back to the stock firmware right away.
Step 4: Install Android SDK
To start off, install the Android SDK Platform Tools on your PC or computer. It’s the official ADB and Fastboot binary provided by Google. You should download it and extract it to a convenient location on your PC. Doing this will give you the necessary platform-tools folder.
Step 5: Enable USB Debugging and OEM Unlocking
Then, you will need to enable USB Debugging and OEM Unlocking on your smartphone. The former makes your smartphone recognizable by the PC in ADB mode. Meanwhile, it’ll allow you to easily boot your smartphone to Fastboot Mode.
OEM Unlocking will be needed to carry out the bootloader unlocking process. You’ll need to go to Settings -> About Phone -> Tap on Build Number 7 times -> Return to Settings -> System -> Advanced -> Developer Options -> Enable USB Debugging and OEM Unlocking.
Step 6: Boot your device to Fastboot mode
- Connect your smartphone to the PC using a USB cable while ensuring that USB debugging is enabled
- After that, go to the platform-tools folder and type in CMD in the address bar before hitting Enter to launch the Command Prompt
- Then, type in the following command in the CMD window for booting your smartphone to Fastboot Mode
adb reboot bootloader
- For verifying the Fastboot connection, you should type the following command and you’ll get back the device ID –
Step 7: Relock Bootloader on your Android device
- Execute the following command for relocking the bootloader –
fastboot flashing lock
- You should get a prompt on your device
- If you don’t get it either in CMD or on your device, you should use the fastboot oem lock command and you’ll get the prompt
- Now, you’ll use the Volume keys for selecting Relock the Bootloader and then press the Power key to confirm
- Your smartphone will undergo a reset and the bootloader will get locked
- It will either boot to the OS or Fastboot Mode
- If it boots to the Fastboot Mode, you should execute the below command for booting to the OS –
- Your device will boot to the OS with a locked bootloader non-rooted device with the stock firmware.