If you ever find the need and want to relock the bootloader of the OnePlus 5 or OnePlus 5T, then you can follow these quick and easy steps outlined below.
As mentioned yesterday, you’ll want to unlock the bootloader of the OnePlus 5 if you ever want to install any type of modification on your device. This includes everything from a Custom Recovery (TWRP) to a Custom Kernel, a Custom ROM and even just simple UI modifications that have been developed by the community. However, there can be a major downside to unlocking the bootloader thanks to Google’s new SafetyNet checks.
SafeyNet checks are put into place so that the developers of applications such as Android Pay, Pokemon Go, and some banking applications feel their users are not tampering with the operating system. Before, we could have the bootloader unlocked and still use these applications because they didn’t trigger those checks. However, a new update now detects if you have an unlocked bootloader so unless you bypass them (with Magisk, a Custom Kernel, etc.), then you can’t use them with an unlocked bootloader.
If you’re not willing to use one of those bypass solutions (or maybe Google has updated SafetyNet to detect the current bypasses), then you can follow these steps below to lock the bootloader of the OnePlus 5 again. Be aware that this will perform a factory reset on your phone, and you should only do this after you have completely removed any and all root modifications from your device.
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 this guide: How to Enable Developer Mode, as well as this one which shows you How to Enable USB Debugging Mode.
You will then need to open a command prompt within the same folder as your ADB and Fastboot tools and execute the "adb devices" command (without quotes) to start the ADB service. From here, you can connect the device to the PC with a USB cable. If everything has been done properly then you'll be asked if you want 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, Terminal, or Windows PowerShell to make sure the computer recognizes the device.
OnePlus 5 Lock Bootloader
- Boot the OnePlus 5 into Fastboot Mode
- Connect the PC to your OnePlus 5 via a USB cable
- Type the following command into the Command Prompt. . .
- fastboot flashing lock
- . . and press Enter on the keyboard
- Press the Volume Down or Volume Up button until the Yes option is highlighted
- Press the Power button to confirm and select this option
- Wait for the OnePlus 5 to reboot and perform the factory reset
- Then wait for the OnePlus 5 to reboot back into the Android OS
- Disable the OEM Unlock feature (optional)
Since you most likely have already gone through most of these steps to unlock the bootloader, it should all be very familiar to you. I say most likely because sometimes you can buy the OnePlus 5 used from someone, or even from a reseller, and they could have previously unlocked the bootloader. These rare cases are the reason why I have included the ADB/USB Debugging instructions above the guide too, just so everyone is on the same page here.
Once you have all of the initial setup stuff done, you can then boot the OnePlus 5 into Fastboot Mode. Follow the steps in the guide linked for Step 1 if you’re not familiar with how to do this. This is required because to relock the OnePlus 5 or OnePlus 5T bootloader, we need to execute a Fastboot command. Once the OnePlus 5 is in Fastboot Mode (also known as Bootloader Mode), turn your attention to the Command Prompt on the PC and execute the fastboot flashing lock command.
This should make the screen of the OnePlus 5 change and it will ask you if you’re sure you want to lock the bootloader. Proceeding here will wipe all of the data you have on your smartphone so be aware of that before you decide. If you are sure this is what you want, press the Volume Up or Volume Down button until the Yes option is highlighted, and then press the Power button to select that option. The OnePlus 5 will reboot so it can do a factory reset, and then it will reboot again to take you back into the Android OS.
This first boot cycle will take longer than normal so be patient while the OS sets some things back up. You’ll then see the typical Android activation screen and setting up the phone shouldn’t take very long. Once you’re to the Home Screen of the OnePlus 5 or OnePlus 5T, can then proceed to install your applications and games and any backup data you have. You also have the ability to disable the OEM Unlock feature from within the Developer Options menu if you would like.
This last part isn’t required, but it can help keep your device secure from someone else unlocking the bootloader if they got their hands on your phone.
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.