Android - What does "fastboot oem lock" do?

Simply put, fastboot oem lock puts your bootloader into a mode that prevents you from overwriting your recovery image, without a subsequent fastboot oem unlock. This serves as a security precaution, primarily where the default recovery and firmware is installed.

Because:

  • The default recovery will only allow manufacturer/Google signed firmware to be installed and doesn't allow you to do much of anything else.
  • Unlocking the bootloader will erase all data.

....you can rest assured that, under this configuration, no one can take your phone and, say, bypass a screen lock by installing a custom firmware where the security considerations are different.

Note that as this merely locks in your recovery, and then again only from bootloader-overwrites, this is most useful where the recovery is stock, and the installed ROM is an official one that has no security vulnerabilities. This is important because in most recoveries, and in some ROMs, there are ways to clandestinely access data via USB, bypass security settings with fixed button presses or unpatched backdoors, or install custom recoveries.


From this xda thread by albundy2010

I have seen quite of few people screw up their devices by not knowing what they are doing. So I am making this thread to simply tell people not familiar with fastboot what they should and should not do.

  • Fastboot oem unlock will unlock your bootloader and do a complete wipe of your device. As far as I know the only way for something to go wrong here is if you're device is low on battery and shuts off during the process. Either plug it in or have a "good" amount of juice left in your battery. To be 100 percent sure plug it in.

  • Before I get into oem lock IMHO you should only use this command for one thing only. Getting the device ready to send into motorola for the LGT upgrade or a another warranty repair or some sort. When done properly it is completely safe but there is no reason to do to go back to "stock".

  • Fastboot oem lock. Do not issue this command unless you are absolutely sure you have the correct software on your device. The correct software is what you get from the motodev site for your device. You need the official sofware images for your specific device AND REGION. If it is not released then DO NOT re-lock the device. If you have a OTA installed you will need to flash back to the motodev images first.