Relocking the bootloader:
- Skip through the setup process on the device (it doesn't have to be online)
- Put the phone back into developer mode
- Make sure USB debugging is activated
- Agree to the pop-up notification on device screen to allow USB debugging
Run this command to see if adb can see your device:
sudo adb devices
- * You should see your device.
Run this command to reboot into fastboot mode:
adb reboot bootloader
- * You may get a request to authorize USB debugging on the device, if so, accept it.
Run this command to see if fastboot can see your device:
sudo fastboot devices
- * You should see your device.
Once the device is in bootloader mode, run this command to lock the bootloader (must use sudo):
sudo fastboot flashing lock
Once finished, use the volume buttons on your device to select "Lock the bootloader," then press the power button to accept
Once the bootloader is locked, your device may reboot into bootloader mode, either reboot the device, or issue this command:
fastboot reboot
- * This step is not necessary if your phone reboots into system after relocking the bootloader.
Reenable Developer Options and turn off OEM unlocking:
- Reenable Developer Options (tap Build number 7 times in settings > About Phone
- Go into System > Developer options and turn off OEM unlocking.
- Restart device for changes to be applied.
Perform a factory reset:
- Go to Settings > System > Reset options and choose Erase all data (factory reset). Check the box that says Erase eSIMs.
- * This will remove any eSIM information from the device, and it will also disable Developer mode.
Your phone will reboot, and now it is ready for resale.