If you’re done experimenting with mods, you can follow this tutorial for instructions on how to lock the bootloader of the Pixel 2 and Pixel 2 XL.
Yesterday I showed you how to unlock the bootloader of the Pixel 2 and the Pixel 2 XL. This is required if you ever want to install any modifications like a custom recovery, custom kernel, custom ROM or even to just gain root access to the device. However, this process trips a security check from Google called SafetyNet and that means that some applications could stop working including Android Pay, Netflix your banking applications and others.
Granted, there are generally ways around that (I like using Magisk), but it is a cat and mouse game that could leave you waiting for an update at any time.
So, for those who are tired of using or experimenting with modifications, you can flash the factory stock images and then relock the bootloader of the Pixel 2 and the Pixel 2 XL to put things back to normal. I recommend flashing the stock images before doing this but as long as you’re 100% sure that everything is stock then it isn’t required.
Note – Just like with unlocking the bootloader, this process will perform a factory reset on your Pixel 2 and Pixel 2 XL. Also, do not lock the bootloader if you have a custom recovery, custom ROM, custom kernel or any other system/system modifications installed.
Pixel 2 Lock Bootloader
- Boot the Pixel 2 into Fastboot Mode
- Type the following command into the Command Prompt. . .
- fastboot flashing lock
- . . .then press Enter on the keyboard
- Press the Volume Down button on the Pixel 2 to highlight the lock option
- And press the Power button to confirm you want to relock the bootloader
- Wait for the Pixel 2 to reboot and activate Android
- Enable Developer Mode on the Pixel 2 (optional)
- Disable OEM Unlock on the Pixel 2 (optional)
This guide above will need to be done on both the Pixel 2 (along with step 6 of the guide below) and the Pixel 2 XL to unlock the bootloader. If you did the unlock_critical command when unlocking the bootloader of the Pixel 2 XL, then you’ll need to continue with the guide below.
Pixel 2 XL lock Bootloader
- Boot the Pixel 2 into Fastboot Mode
- Type the following command into the Command Prompt. . .
- fastboot flashing lock_critical
- . . .then press Enter on the keyboard
- Press the Volume Down button on the Pixel 2 XL
- And press the Power button to confirm you want to relock the Pixel 2 bootloader
- Wait for the Pixel 2 to reboot and activate Android again
- Enable Developer Mode on the Pixel 2 (optional)
- Disable OEM Unlock on the Pixel 2 (optional)
Explanation
If you followed my Pixel 2 bootloader unlock tutorial then most of this will feel right at home. The process is nearly identical with only a couple of subtle changes. Before you could execute both unlock commands (on the Pixel 2 XL) and be sent back to Fastboot Mode to manually boot back into Android. This time around, each time you confirm you want to lock the bootloader (which will only happen once for the Pixel 2, but may be twice for the Pixel 2 XL), you are instantly forced into a factory reset process.
Since you likely already have ADB and Fastboot tools setup from unlocking the device, you can skip the introductory part of this guide. However, you will definitely need to follow it if you are locking the bootloader on a different computer than before (or if you uninstalled/deleted the stuff from last time). When you’re ready though, you can boot the Pixel 2 or Pixel 2 XL into Fastboot Mode and then turn your attention to the Command Prompt after the USB cable is plugged in.
You’ll first want to execute the fastboot flashing lock command and then wait for the Pixel 2 to do its factory reset. This will instantly through you into a restart boot cycle which can take a couple of minutes to complete. Once that is done, activate Android again and if you would like, you can go in and disable the OEM Unlock option within the Developer Options menu (this is optional though). If you are running the Pixel 2 XL and you previously did the unlock_critical command, then you’ll more to do.
If that is the case, go ahead and power off the Pixel 2 XL again so that you can boot it up into Fastboot Mode. Once there, turn your attention back to the Command Prompt and execute the fastboot flashing lock_critical command as shown in the guide above. This will once again force you into a factory reset process and then reboot you back into the Android activation screen after a few minutes. You can follow along with me in the video if you’d like.
Just like before, once you’re back into Android you can choose to disable the OEM Unlock option if you would like (but again, it’s not required).
Hi bro, I have a Pixel 2 XL, in order to get a real immersive mode (hide navbar completely via Magisk module). I’ve followed your post about “How to Gain Systemless Root Access to the Pixel 2 and Pixel 2 XL”. Now my question is, after root systemlessly, should I or do I need to re-lock my bootloader again? If so, will I lost such kind of systemless root? That would be a great appreciate if you could help to answer, thanks in advance!
No, you should not relock the bootloader. The only time you ever want to relock the bootloader is after you flash everything back to stock Android (using Google’s flash-all.bat file).
Got it! Thank you very much!!
after i flashed the original kernel back on using boot_a and boot_b command i followed this tutorial the relock my bootloader. it says locked but underneath has a yellow error saying image auth failure. so i unlocked it again and shows no error. im on the pixel 2. any suggestions as to what would cause the error?
I would follow this guide to completely flash the original stock images onto the device
– https://www.androidexplained.com/pixel-2-return-stock-android/
Then you can relock the bootloader. I suggest this because there’s no telling what other files have been modified from a custom kernel, or anything else you’ve done while rooted
Does is still work on Google Pixel 2 xl, running Android 10?
Yes, just make sure that you’re running 100% stock Google Android images and you’re able to install OTA updates properly before you lock the bootloader.