• Introducing XDA Computing: Discussion zones for Hardware, Software, and more!    Check it out!

[Guide]Un/locking Motorola Bootloader

Search This thread

sd_shadow

Recognized Contributor
Sep 21, 2011
18,119
2
8,681
South Dakota
goo.gl
Motorola Droid X
Moto X4
UnLocking and ReLocking Motorola Bootloader



Note:
Moto Site is finicky, and instead of it saying I'm sorry there's an error, it just says​
"Your device does not qualify for bootloader unlocking."​
So if you get this notice but you have a qualifying Cid (see post #3)​
try again later.​

Carrier exclusive models (ex. Verizon, AT&T, Tracfone) are almost never unlockable.​
Bootloader unlock codes are not available for Amazon Branded devices​


Warnings
My warning: If you unlock the bootloader.​
Don't expect that it can be relocked.​
There are many people that have Unlocked the bootloader.​
Only to find out that it will not relock.​
Or if it Locks it has a warning​

or​



Read the warnings on the Offical Unlocking site.​
 
Last edited:

sd_shadow

Recognized Contributor
Sep 21, 2011
18,119
2
8,681
South Dakota
goo.gl
Motorola Droid X
Moto X4
UnLocking the Bootloader

There is an Offical list of Devices that can be Unlocked, but it has never been kept up to date.​
If you want to know if your device can be Unlock, you need to go through the process to find out.​

You need to setup ADB/Fastboot on another device (Win/Linux/Mac/Chromebook)
[Index] Setting up and Using ADB/Fastboot

Follow the directions on the Official Motorola Bootloader Unlocker Site

Be careful not to remove part of the unlock key, when removing the junk, spaces and extra lines.
Paste it into data scrub tool: https://support.motorola.com/us/en/dataScrubTool

Motorola will email you a key.
Use that key like this.
Code:
fastboot oem unlock UNIQUE_KEY
 
Last edited:

sd_shadow

Recognized Contributor
Sep 21, 2011
18,119
2
8,681
South Dakota
goo.gl
Motorola Droid X
Moto X4
Can My Bootloader Be UnLocked?

Carrier exclusive models (ex. Verizon, AT&T, Tracfone) are almost never unlockable.​
Bootloader unlock codes are not available for Amazon Branded devices​



Older: Sunshine method

There is an Unofficial method using an app called Sunshine.
 
Last edited:
  • Like
Reactions: gonzo1963

sd_shadow

Recognized Contributor
Sep 21, 2011
18,119
2
8,681
South Dakota
goo.gl
Motorola Droid X
Moto X4
Locking Motorola Bootloader
  • Relocking Motorola Bootloaders can be difficult.
  • Don't relock the bootloader if it was unlocked by any other method than Offical.
  • ReFlash Stock Firmware, Factory Reset, Reboot. and make sure everything is working correctly before relocking.

Current locking instructions - 27 April 2021

If the device was rooted, reflash stock firmware.
Your device likely uses fastbootd
[Guide] Flashing Motorola Firmware
After flashing Firmware, power up the phone to make sure it will boot.
If it starts up ok
return to bootloader and run
Code:
fastboot oem lock
Follow the instructions in your terminal's output.
You should see something like "signed system image required" which means you have to
Flash all system.img_sparsechunk.X parts a second time.
When finished run the lock command again and follow the instructions in your output line.
Continue until your bootloader is locked.



Other methods that have worked in the past


Run
Code:
fastboot devices
fastboot oem lock
fastboot oem lock
fastboot reboot bootloader
Check if bootloader says
Code:
flashing_locked
If the bootloader doesn't lock

You may need to try something like.
Code:
fastboot oem lock begin
fastboot oem lock begin
fastboot oem lock
fastboot oem lock
fastboot oem lock
fastboot flash boot boot.img
fastboot oem lock

or

Code:
fastboot oem lock
fastboot oem lock
fastboot flash oem oem.img
fastboot flash system system.img_sparsechunk.0
fastboot flash system system.img_sparsechunk.1
fastboot flash system system.img_sparsechunk.2
fastboot flash system system.img_sparsechunk.3
fastboot flash system system.img_sparsechunk.4
fastboot flash boot boot.img
fastboot oem lock

I saw the same thing on my end at first. Found this to work repeatedly....
fastboot oem lock (enter this a few times until i says something to the effect of...."you still need to flash a signed boot.img")
fastboot flash boot boot.img (this will now flash fine without saying the image is not signed)
fastboot oem lock (if you prefer to re-lock. You'll need the unlock key again if you plan to unlock).
- https://forum.xda-developers.com/showpost.php?p=79305396&postcount=12


Head on over to https://support.lenovo.com/us/en/downloads/ds101291 and download the tool, after installed put your phone in bootloader/fastboot mode and go through the rescue steps up until the firmware is downloaded, do not click rescue after the firmware is fully downloaded just head on over to C:\ProgramData\LMSA\Download\RomFiles and open the downloaded firmware and take the boot image from there and copy it to your fastboot tools folder and flash that boot.img check that the firmware matches the version installed on your phone before flashing the boot.img.
- https://forum.xda-developers.com/showpost.php?p=79300655&postcount=2


also see



https://forum.xda-developers.com/g5-plus/help/problem-locking-t3801320
flash either stock or a stock-based rom along with Magisk and enable OEM unlock in the dev options and the you should be able to re-lock.
Magisk Hide must be enabled. Only this option hides the unlocked bootloader which results in an active toggle for the OEM Unlock option.

Old
Official Motorola Instructions Page
https://motorola-global-portal.custhelp.com/app/standalone/bootloader/recovery-images
 
Last edited:

sd_shadow

Recognized Contributor
Sep 21, 2011
18,119
2
8,681
South Dakota
goo.gl
Motorola Droid X
Moto X4
Alt UnLocking Method
or
Bypass Email method

You have to remove the hashtags "#" from the code you get from the phone.
Remove the quotes "Part1" from the link below.
Code:
https://support.motorola.com/us/en/api/mse/bootLoaderVerifyPhone?serialNo="Part1"&secSerialNo=&processorUid="part4"&bootloaderHash="Part3"&infoOnly=N

There is a chance this could change with newer devices.
The 1st part should be 16 characters long.
The 4th part should be 32 characters long.
The 3rd part should be 40 characters long.

So, a good unlock code will look like this. Mine is 19 characters long.
Code:
{"status_code":"0000","status_description":"Successful!","Boot_loader_unlock_code":"7*****************B"}

If it cannot be unlocked. It maybe something like.
Code:
{"status_code":"0020","status_description":"Either there are errors in input data or this device does not have bootloader lock code available yet.","Boot_loader_unlock_code":null}

if you see
Code:
{"status_code":"0003","status_description":"Processor UID cannot be empty!","Boot_loader_unlock_code":null}
the link is not correct, try creating the link again.



Credits
 
Last edited:
  • Like
Reactions: gonzo1963

sd_shadow

Recognized Contributor
Sep 21, 2011
18,119
2
8,681
South Dakota
goo.gl
Motorola Droid X
Moto X4
Just copied from link below

Setting lock/unlock properties​

The ro.oem_unlock_supported property should be set at build time based on whether the device supports flashing unlock.

  • If the device suppports flashing unlock, set ro.oem_unlock_supported to 1.
  • If the device doesn't support flashing unlock, set ro.oem_unlock_supported to 0.
If the device supports flashing unlock, then the bootloader should indicate the lock status by setting the kernel command line variable androidboot.flash.locked to 1 if locked or 0 if unlocked.

For devices that support dm-verity, use ro.boot.verifiedbootstate to set the value of ro.boot.flash.locked to 0; this unlocks the bootloader if the verified boot state is orange.

 
Last edited:
  • Like
Reactions: gonzo1963

sd_shadow

Recognized Contributor
Sep 21, 2011
18,119
2
8,681
South Dakota
goo.gl
Motorola Droid X
Moto X4
Why is OEM unlocking greyed out/ unavailable?

It's not unusual for OEM unlocking on Moto devices, to be greyed out.
You need to connect to wifi/LTE and it should be available in 3 or so days after that.

1-szare.png


Troubleshooting
If 3 days after connection to the internet and still is greyed out
see
 
Last edited:
  • Like
Reactions: gonzo1963

sd_shadow

Recognized Contributor
Sep 21, 2011
18,119
2
8,681
South Dakota
goo.gl
Motorola Droid X
Moto X4
List of CIDs

Run getvar cid to see which CID your device has.
Code:
fastboot getvar cid

The table below will indicate whether your device is eligible for the bootloader unlock program:




Your device is unlockable if the CID
value returned is:

Your device is NOT eligible for bootloader unlock
if the CID value returned is one of these:

0x0000
0x0003
0x0007
0x0009
0x000B
0x000C
0x000D
0x000E
0x0014
0x0015
0x00DE
0x0032
0x0001
0x0002
0x0004
0x0005
0x0006
0x0008
0x000A
0x000F
0x0010
0x0011
as well as any other not listed on the left


Source
 
  • Like
Reactions: gonzo1963

rotorline

Member
Feb 3, 2021
11
0
ATL
Nvidia Shield
Moto G6
Thanks for the very helpful writeup.
One question tho. I've gotten the email with the unlock code but how do I apply it? I'm assumng ADB?

NM, I reread your first post
fastboot oem unlock UNIQUE_KEY
Thanks again for the info
 
Last edited:

smartasiankid

Senior Member
May 26, 2019
77
0
Locking Motorola Bootloader
  • Relocking Motorola Bootloaders can be difficult.
  • Don't relock the bootloader if it was unlocked by any other method than Offical.
  • ReFlash Stock Firmware, Factory Reset, Reboot. and make sure everything is working correctly before relocking.

Current locking instructions - 27 April 2021

If the device was rooted, reflash stock firmware.
Your device likely uses fastbootd
[Guide] Flashing Motorola Firmware
After flashing Firmware, power up the phone to make sure it will boot.
If it starts up ok
return to bootloader and run
Code:
fastboot oem lock
Follow the instructions in your terminal's output.
You should see something like "signed system image required" which means you have to
Flash all system.img_sparsechunk.X parts a second time.
When finished run the lock command again and follow the instructions in your output line.
Continue until your bootloader is locked.



Other methods that have worked in the past


Run
Code:
fastboot devices
fastboot oem lock
fastboot oem lock
fastboot reboot bootloader
Check if bootloader says
Code:
flashing_locked
If the bootloader doesn't lock

You may need to try something like.
Code:
fastboot oem lock begin
fastboot oem lock begin
fastboot oem lock
fastboot oem lock
fastboot oem lock
fastboot flash boot boot.img
fastboot oem lock

or

Code:
fastboot oem lock
fastboot oem lock
fastboot flash oem oem.img
fastboot flash system system.img_sparsechunk.0
fastboot flash system system.img_sparsechunk.1
fastboot flash system system.img_sparsechunk.2
fastboot flash system system.img_sparsechunk.3
fastboot flash system system.img_sparsechunk.4
fastboot flash boot boot.img
fastboot oem lock


- https://forum.xda-developers.com/showpost.php?p=79305396&postcount=12



- https://forum.xda-developers.com/showpost.php?p=79300655&postcount=2


also see



https://forum.xda-developers.com/g5-plus/help/problem-locking-t3801320



Old
Official Motorola Instructions Page
https://motorola-global-portal.custhelp.com/app/standalone/bootloader/recovery-images
i have a motorola one(xt1941-3) and i really need help locking the bootloader :(. whenever i type 'fastboot oem lock' it says it still requires signed boot.img even though im on the latest august security patch(qpks30.54-22-24).
 

sd_shadow

Recognized Contributor
Sep 21, 2011
18,119
2
8,681
South Dakota
goo.gl
Motorola Droid X
Moto X4
i have a motorola one(xt1941-3) and i really need help locking the bootloader :(. whenever i type 'fastboot oem lock' it says it still requires signed boot.img even though im on the latest august security patch(qpks30.54-22-24).
Yes, Locking Moto Bootloaders is a mess.
Locking is actually more likely to cause a bricked device than unlocking.

The only advice I can give is the following

Follow the instructions in your terminal's output.
You should see something like "signed system image required" which means you have to
Flash all system.img_sparsechunk.X parts a second time.
When finished run the lock command again and follow the instructions in your output line.
Continue until your bootloader is locked.
 
  • Like
Reactions: rotorline

Top Liked Posts