24

I've had my phone for months, loading with several firmware, ROMs and OTAs, without ever running this command. What does it do?

What I know is that "fastboot oem unlock" displays the confirmation screen and obliges me to wipe my device data, and that "fastboot oem unlock" is the first step to flashing firmware unto my phone.

Am I okay not relocking my phone?

4 Answers 4

18

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.

3
  • 1
    A locked bootloader on many/most devices will not allow you to flash any partition on the device unless the partition image is properly signed with the manufacturer's signing keys. On some devices I think it also disables the fastboot boot command (I recall that from the Xoom, I think). Apr 6, 2012 at 17:18
  • I wanted to fastboot oem lock my Nexus 5X phone and a prompt appeared, that this would do a factory reset too. I knew that unlocking would do that, but I would have not expected that to happen during a lock procedure.
    – ckujau
    Feb 19, 2017 at 4:16
  • I used this command on my OnePlus 7T Pro. It is essentially a factory reset. Apps, data, everything. I did it because I wanted to use Google Pay and couldn't while unlocked. I had OEM ROM installed and everything backed up so it worked out. Make sure you back up. Especially 2FA like Google Authentication if you use it. If you are using a custom ROM I wouldn't advise doing this. Mar 31, 2021 at 12:04
6

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.

3
  • 4
    this doesn't really explain what fastboot oem lock does. it only explains one use case in which you would want to do it. "there is no reason to do to go back to stock" seems a bit extreme. There are plenty of reasons why someone would want to run a stock OS.
    – davidbb
    Apr 6, 2012 at 15:08
  • I agree with davidbb on both of his points. =)
    – William C
    Apr 6, 2012 at 15:47
  • I'm reading this as there being a present danger if fastboot oem lock is attempted on devices with OTA installed or with OS otherwise altered. @roxan please clarify
    – Codebling
    Jul 16, 2016 at 1:57
0

I had to use fastboot oem lock on my Galaxy Nexus. At my unlocked device I couldn't see the filesystem in explorer (MTP).

1
  • 1
    I strongly disagree. MTP and an unlocked bootloader don't correlate in any way. unlocking is for installing non-original firmware. relocking enhances your security (protects against evil maid attack)
    – ce4
    Nov 25, 2012 at 3:32
0

The command locks your bootloader. What the consequences are really depends on your device. Most devices enable signature-verification for the boot partition (kernel) which prevents you from booting any kernels not signed by device manufacturer (unless you exploit some security breaches like 2nd boot). They also disallow you to flash any partition via 'fastboot flash' command, but not on all devices.

So no, you are not okay with relocking your phone: If you use custom firmware, you typically use a custom kernel and in this case, re-locking your bootloader via 'fastboot oem lock' will put your device in a state where it will not boot anymore! Be careful with that.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .