yashsingh1/xdaforums huggingface dataset:
[Upgrading, Modifying and Unlocking] sd_shadow:
Moved post to

Un/Locking Moto Bootloader

https://xdaforums.com/general/rooting-roms/guide-locking-motorola-bootloader-t4079111

Old Post

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

Carrier exclusive models (ex. Verizon, AT&T, Tracfone) are almost never unlockable.

Bootloader unlock codes are not available for Amazon Branded devices​

Read the warnings on the Offical Unlocking site.

Official Motorola Bootloader Unlocker Site

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.

Motorola will email you a key.

Use that key like this.

fastboot oem unlock UNIQUE_KEY

You can check if the devices CID is eligible for unlocking here

https://forums.lenovo.com/t5/MOTOROLA-Android-Developer/Bootloader-Unlock-Problems/m-p/3222809.

OEM unlocking greyed out

https://www.theandroidsoul.com/how-to-fix-oem-unlock-greyed-out-or-oem-unlock-disabled-problem/

A possible workaround for device not eligible for unlocking. This is really a Alt method, for people who get a false not eligible message.

https://xdaforums.com/z2-force/how-to/trouble-unlocking-bootloader-try-t4045641

Older

There is an Unofficial method using an app called Sunshine.

XDA thread: https://xdaforums.com/showthread.php?t=2792487

Official Site: http://theroot.ninja/
[Upgrading, Modifying and Unlocking] sd_shadow:
Moved to Un/Locking Moto Bootloaders

Old Post

Relocking Motorola Bootloaders can be difficult.

Official Motorola Instructions Page

https://motorola-global-portal.custhelp.com/app/standalone/bootloader/recovery-images

Don't relock 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.

If the bootloader doesn't lock after following the Offical instructions.

You may need to try something like.

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

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://xdaforums.com/showpost.php?p=79305396&postcount=12

- https://xdaforums.com/showpost.php?p=79300655&postcount=2

also see

How to re-lock Bootloader of all Potter version by aSaro12

Solution to flash stock rom(factory image) via fastboot and locking the bootloader.. by rishivg

[NOOB GUIDE] Unroot/Relock Bootloader - VZW Developer Edition Moto X by tonyf7

[GUIDE] [XT1575] Return to stock and relock bootloader by acejavelin

Re-Lock Bootloader Of Moto G5 Plus (Indian Variant) by Nirbhay2

https://xdaforums.com/g5-plus/help/problem-locking-t3801320
[Upgrading, Modifying and Unlocking] sd_shadow:
[Fixing] Baseband <not found> / IMEI=0 / No Network After Flash / Issues

Lots of Moto threads lately with

Baseband not found

No Baseband

IMEI=0

No Network

No Data after Flash

no wifi

One solution that seems to work is

Reflashing last known Firmware that worked.

If still not working try.

fastboot flash modem NON-HLOS.bin
fastboot erase modemst1
fastboot erase modemst2
fastboot flash fsg fsg.mbn

also see these threads, for possible solutions.

[guide] workaround - no network / imei = 0 after flashing custom rom by gebcruz06

[Guide] [XT16XX] [Solve] Moto G4/Plus IMEI=0 issue by Heeth21

[dev][info] imei 0 by rachitrawat

[Guide] [XT16XX] [Solve] Moto G4/Plus IMEI=0 issue by Heeth21

Fix Persist, resolve IMEI=0, Volte, 4G, Explanation, Requirements by NZedPred

xt1955-5 Null imei by zaxcast
[Upgrading, Modifying and Unlocking] imtinan95:
A bit help - unbricking

I can't understand your post, could you give instructions on how to unbrick device?
[Upgrading, Modifying and Unlocking] sd_shadow:
First, do a search for your device and the term Blank Flash, to see if anyone has already posted a solution.

If no one has posted a Blank Flash file for your device the following steps should work.

You will need someone with a device that has the same chipset and rooted

so that they can pull a copy of the mmcblk0.img from their device using

Terminal Emulator

https://play.google.com/store/apps/details?id=jackpal.androidterm&hl=en

using these commands

su

GRANT Terminal emulator a Root Access

dd if=/dev/block/mmcblk0 of=/sdcard/Loader.img bs=1024 count=168960

How to Unbrick (Debrick) Qualcomm Android Devices Using your SD Card

https://www.aryk.store/2019/09/unbrick-qualcomm-android-using-sd-card.html

That mmcblk0.img can be used to boot the non-working device into Fastboot mode, as described in the links below

and then you just need to reflash the firmware.

[Guide] [Unbrick] How to revive a hard bricked Moto G5 by TheFixItMan

https://xdaforums.com/moto-g5s/how-to/blank-flash-montana-t3765150.

https://android.stackexchange.com/questions/125135/how-to-pull-mmcblk0-to-a-windows-pc

[Solved] Unbrick (Hard Bricked/Dead) Motorola G 4 plus or any Qualcomm mobile Device by vijayjadhav_143

[TOOL][LINUX] mmcblk0 Extractor (v1.0.1 - 3/16/16) by SuperR.

Finding Block sizes

running ADB shell

To find Total size of mmcblk0

blockdev --getsize64 /dev/block/mmcblk0

31268536320 (= 32GB)

To Find block size needed to flash bricked device.

blockdev --getbsz /dev/block/mmcblk0

4096 (= 4m)

1048576 x 29820 = 31268536320

Pulling in TWRP, code may defer for you device.

dd if=/dev/block/mmcblk0 of=/external_sd/mmcblk0.img bs=1048576 count=29820

https://unix.stackexchange.com/questions/52215/determine-the-size-of-a-block-device

Can someone with a rooted stock rom pull mmcblk0 via adb by TheFixItMan

.
[Upgrading, Modifying and Unlocking] NM99:
Hello! I wonder if you could help me out...

I'm currently trying to relock the bootloader of my motorola one P30 Play (XT1941-3 deen RETBR).

First, I flashed the latest stock rom available (PPKS29.68-16-21-14 with the October security patch) and ran the fastboot oem lock commands just as below:

fastboot getvar max-sparse-size

fastboot oem fb_mode_set

fastboot flash partition gpt.bin

fastboot flash bootloader bootloader.img

fastboot flash modem_a NON-HLOS.bin

fastboot flash fsg_a fsg.mbn

fastboot erase modemst1

fastboot erase modemst2

fastboot flash dsp_a adspso.bin

fastboot flash logo_a logo.bin

fastboot flash boot_a boot.img

fastboot flash system_a system.img_sparsechunk.0

fastboot flash system_a system.img_sparsechunk.1

fastboot flash system_a system.img_sparsechunk.2

fastboot flash system_a system.img_sparsechunk.3

fastboot flash system_a system.img_sparsechunk.4

fastboot flash system_a system.img_sparsechunk.5

fastboot flash system_a system.img_sparsechunk.6

fastboot flash system_a system.img_sparsechunk.7

fastboot flash system_a system.img_sparsechunk.8

fastboot flash system_b system_b.img_sparsechunk.0

fastboot flash system_b system_b.img_sparsechunk.1

fastboot flash vendor_a vendor.img_sparsechunk.0

fastboot flash vendor_a vendor.img_sparsechunk.1

fastboot flash oem_a oem.img

fastboot flash oem_b oem_other.img

fastboot erase cache

fastboot erase userdata

fastboot erase DDR

fastboot oem fb_mode_clear

fastboot oem lock

fastboot oem lock

fastboot flash oem oem.img

fastboot flash oem_b oem_other.img

fastboot flash system_a system.img_sparsechunk.0

fastboot flash system_a system.img_sparsechunk.1

fastboot flash system_a system.img_sparsechunk.2

fastboot flash system_a system.img_sparsechunk.3

fastboot flash system_a system.img_sparsechunk.4

fastboot flash system_a system.img_sparsechunk.5

fastboot flash system_a system.img_sparsechunk.6

fastboot flash system_a system.img_sparsechunk.7

fastboot flash system_a system.img_sparsechunk.8

fastboot flash system_b system_b.img_sparsechunk.0

fastboot flash system_b system_b.img_sparsechunk.1

fastboot flash boot_a boot.img

fastboot oem lock

fastboot reboot

Then I had this error:

(Still require signed boot.img)

View attachment 4858941

I rebooted the phone, went to unlock the developer options and check the oem settings and saw this:

(OEM Unlock is greyed out and on unlocked position)

Rebooted back into the bootloader so I could then lock it, but now I keep getting this error:

('Check OEM Unlock' in Android Setting > Developer Options)

View attachment 4858943

Could anyone help me?
[Upgrading, Modifying and Unlocking] sd_shadow:
Try reflashing firmware again
[Upgrading, Modifying and Unlocking] sd_shadow:
Motorola devices are notoriously bad about relocking the bootloader.

If you unlock the bootloader, you may not be able to relock.
[Upgrading, Modifying and Unlocking] NM99:
Do you think it's worth the risk relocking it?

My main concern is not being able to update to Android 10 in a few months time, hence why I wanted to relock it.
[Upgrading, Modifying and Unlocking] sd_shadow:
As long a it full stock firmware, that hasn't been downgraded, nor rooted, you can allow updates or just flash the full firmware when it's leaked..

Really the biggest issues have been when the firmware has been downgraded, then the update may brick it.
[Upgrading, Modifying and Unlocking] NM99:
I did a downgrade once when my phone couldn't get out of the bootloader screen. Then it updated via OTA, then I had to manually install one security update and the next one went via OTA, so I dont know what happened.

Also, my commands for flashing and locking bootloader are correct?

EDIT: I forgot to say that another reason of wanting to lock the bootloader is because I can't use Google Pay nor Netflix anymore.
[Upgrading, Modifying and Unlocking] sd_shadow:
Use the flash all.bat then retry the relocking commands again
[Upgrading, Modifying and Unlocking] sd_shadow:
Also

repeatedly enter

fastboot oem lock

It may take 3 or more times.

Until i says something to the effect of....

Flash

fastboot flash boot boot.img

This will should flash fine without saying the image is not signed

Again

fastboot oem lock
[Upgrading, Modifying and Unlocking] NM99:
[MENTION=4267571]sd_shadow[/MENTION]

I just reflashed the firmware and ran the "fastboot oem lock" but all I got was the same thing from yesterday:

('Check OEM Unlock' in Android Setting > Developer Options)

View attachment 4858943

Decided to try "fastboot oem unlock" and this is what I'm getting right now:

View attachment 4860017

Did the whole reconfiguration of my cellphone and the OEM Unlock on the Developers menu is still greyed out and it says that it's unlocked, but meanwhile, I ran this command: "adb shell getprop sys.oem_unlock_allowed" and I got this:

View attachment 4860031

0 means it's locked (if it was unlocked, it should give me 1), so right now I'm wondering what the :eek: I can do. I don't remember having such a hard time in relocking the bootloader on the lenovo Vibe K5 and the Moto G5 but I might be wrong.

EDIT: Also, I just took a look at the OEM Unlock switch and it is positioned to the left, in the locked position, but it says it's unlocked. ADB command above returns 0 as answer...
[Upgrading, Modifying and Unlocking] sd_shadow:
If you still haven't relocked

Look at this

https://xdaforums.com/g5-plus/help/problem-locking-t3801320
[Upgrading, Modifying and Unlocking] sabotage154:
hi [MENTION=4267571]sd_shadow[/MENTION]

can the latest bootloader on the razr m XT907 be unlocked? which versions of android on this phone can have the bootloader unlocked? thank you
[Upgrading, Modifying and Unlocking] sd_shadow:
XT907 with kernel date July 2014 or after

can be unlocked with sunshine app

http://theroot.ninja/download.html

xda thread: http://xdaforums.com/showthread.php?t=2792487

free to test compatibility, $25 to unlock

I would root with hydrogen peroxide, even though kingroot or temporary root should work too

If the kernel is older than July 2014 there is a free method.

[GUIDE][FAQ][KK] How to Root, Boot Unlock & More
[Upgrading, Modifying and Unlocking] sabotage154:
hi sd_shadow, thank you for this. i was on 98.30.1. searched your post and found out i could not use motopocalypse while on 98.30.1. i upgrade to KK DA20.62-10.1 and successfully rooter using towel root, installed su, and unlocked BL with motopocalypse. YES!! however from my understanding the KK BL doesnt play well with the nougot custom roms i want to install. I saw on your thread you had told a previous user to downgrade using rsdlite. i found a JB firmware VZW_XT907_4.1.2-9.8.1Q-66_1FF.xml and flashed that using rsdlite but bricked the device. some security error: update gpt_main version failed. i thought with unlocked BL i could just flash any firmware as is but i have noticed some users say the XML file has to be modified. i found a user that downgraded from KK to JB here but i cant find the firmware he says to use, its the one i was actually on before i upgraded to unlock BL. 98.30.1. his post has a zip attached to it with an XML file that has been modified. can i just replace the XML file on the VZW_XT907_4.1.2-9.8.1Q-66_1FF.xml firmware and flash it that way? whats the best way to get back to JB? thank you
[Upgrading, Modifying and Unlocking] sd_shadow:
Usually RSD Lite just works, but if you get errors

You need to use Fastboot.exe

Just skip the gpt.bin command

See [GUIDE][FAQ][KK] How to Root, Boot Unlock & More

Firmware links

https://mirrors.lolinet.com/firmware/moto/_obsoleted_/2012/scorpion-mini/official/VZW/
[Upgrading, Modifying and Unlocking] sd_shadow:
https://xdaforums.com/showpost.php?p=82115205&postcount=553
[Upgrading, Modifying and Unlocking] sd_shadow:
No command screen, how to enter stock recovery

Android 5.x Lollipop Steps

1. Ensure the device is powered off, and unplugged

2. Press and hold the Volume Down button and Power button (located on the right edge of the device) for approximately 3 seconds then release.

3. From the "Boot Mode Selection Menu" screen, select Recovery.

Note: Use the Volume Down button to scroll through the menu options and the Volume Up button to select.

4. From the "No Command" screen (Android figure lying on his back), press and hold the Power button then press and release the Volume Up button to display the menu options

https://motorola-global-portal.custhelp.com/app/answers/indevice_detail/a_id/98998/p/30,6720,9146
[Upgrading, Modifying and Unlocking] sd_shadow:
Will my device receive the next android version?

Motorola official update list.

https://support.motorola.com/in/en/softwareupgrade.
[Upgrading, Modifying and Unlocking] Pained:
Hi, where i find last firmware? My moto g7 plus have June update of android 10, could i downgrade firmware for other or i need to update this firmware for solve "baseband not found"? The phone is with wifi and SIM card of the carrier not working.
[Upgrading, Modifying and Unlocking] sd_shadow:
https://xdaforums.com/showpost.php?p=83778347&postcount=68
[Upgrading, Modifying and Unlocking] sd_shadow:
Error: Cannot Revoke USB Debugging Authorizations

Fix: https://xdaforums.com/g5-plus/help/revoke-usb-debugging-authorizations-t3635712
[Upgrading, Modifying and Unlocking] sd_shadow:
Boot to emergency download mode from TWRP

adb reboot edl
[Upgrading, Modifying and Unlocking] egoss84:
E/Root> STD-ERR >> /system/bin/sh: <stdin>[8]: usb: not found
[Upgrading, Modifying and Unlocking] sd_shadow:
SD limits announced by manufacturers and

How big of card can my phone use.

https://xdaforums.com/showpost.php?p=72494565&postcount=5
[Upgrading, Modifying and Unlocking] w4rh4ck3r:
https://xdaforums.com/t/moto-g8-plus-xt2019-2-retbr-cant-start-only-fastboot-mode.4208715/

My "G8 Plus XT2019-2 retbr" can't start (only fastboot mode), does not boot/recovery mode.

I don't know what else to try... could you help me, please ?

https://xdaforums.com/t/moto-g8-plus-xt2019-2-retbr-cant-start-only-fastboot-mode.4208715/
[Upgrading, Modifying and Unlocking] janvantonder:
Good Evening!

I messed up the baseband on my Motorola x4 (XT1900-7) while attempting to install a custom ROM. The phone was on Android 7.1.1 and I cannot find the firmware for this model.

Can anyone point me to this firmware?

Here is a bootloader Pic from before I made any changes.
[Upgrading, Modifying and Unlocking] sd_shadow:
Is my device in EDL Mode?

EDL Mode:

E

mergency

D

own

l

oad Mode

In Windows Device Manager it will look like these screenshots

This one the Qualcomm drivers need to be updated.

In this one the USB drivers are correct, and it is listed under Ports

For more see

Fixing your Moto stuck in Qualcomm QHSUSB_Bulk or qloader mode

Blankflash, Loader.img and mmcblk0.img info

Qualcomm USB Drivers

How to boot into EDL Mode

Does a blankflash wipe user data?
[Upgrading, Modifying and Unlocking] janvantonder:
Good Evening!

I messed up the baseband on my Motorola x4 (XT1900-7) while attempting to install a custom ROM. The phone was on Android 7.1.1 and I cannot find the firmware for this model.

Can anyone point me to this firmware?

Here is a bootloader Pic from before I made any changes.

View attachment 5193877
[Upgrading, Modifying and Unlocking] rahimali:
lolinet mirrors - firmware, software, iso etc.

lolinet mirrors - powered by h5ai

mirrors.lolinet.com

flash at your own risk!
[Upgrading, Modifying and Unlocking] janvantonder:
Hello again

I flashed quite a few stock firmwares and the only one showing results is the latest one:

PAYTON_RETAIL_9.0_PPWS29.69-40-3-1_subsidy-DEFAULT_regulatory-DEFAULT_CFC.xml

My phone now shows a baseband version, the SIM is recognized and WLAN works -

However my IMEI is 0

fastboot getvar imei shows the correct IMEI.

Does anyone have suggestions here?

Thanks!
[Upgrading, Modifying and Unlocking] sd_shadow:
Motorola Options for booting into EDL Mode and using a Blankflash

A blankflash can be used to repair a Motorola device

If the bootloader will no longer allow the firmware to be flashed.

To use a Blankflash the device must be in Emergency Download Mode.

Normally, Motos cannot be forced in to EDL Mode if the bootloader is OEM_Locked

However if the bootloader was unlocked, and now says

securestate: oem_locked

But the command to relock the bootloader was not made, and is

a result of a failed flashing of a custom rom, rooting or similar action

One of the methods below may allow the device to be recovered.

A blankflash file will also be needed,

which one will depend on the device model, and current firmware version

There are some posted on

lolinet mirrors - firmware, software, iso etc.

lolinet mirrors - powered by h5ai

mirrors.lolinet.com

Option 1

fastboot oem blankflash

If that works phone screen will go black, with no text. (if it didn't see Twrp Method)

If it does see

Is my device in EDL Mode?

If the drivers are good,

download the blankflash, unzip it and

run the blank-flash.bat

If the blankflash works, the device will reboot, you may need to reflash firmware with fastboot.

Option 2

if it didn't enter EDL Mode see if you can boot Twrp

fastboot boot twrp-3.5.2_9-0-potter.img

Download TWRP for potter

Download TWRP Open Recovery for potter

dl.twrp.me

If twrp boots use

adb reboot edl

If that works, and the device is now in EDL Mode use the blankflash .bat
[Upgrading, Modifying and Unlocking] Erbid:
I can't vouch for the source but I went through a similar search for my stock images before I started to flash my phone.

you might try motostockrom.com/motorola-moto-x4-xt1900-7 which had two links for RETEU version.

Be sure to look for RETEU if that is what you need (other versions are also listed).

Erbid
[Upgrading, Modifying and Unlocking] sd_shadow:
Qualcomm EDL Mode USB Drivers

MotorolaDeviceManager_2.5.4.exe

QDLoader HS-USB Driver_32bit_Setup.exe

QDLoader HS-USB Driver_64bit_Setup.exe

In one zip as Drivers.zip
[Upgrading, Modifying and Unlocking] syndicate3333:
Hello,

does anybody know how to edit/change the software channel?
[Upgrading, Modifying and Unlocking] sd_shadow:
Almost every Motorola device has it's own blankflash file, they only has (initially) the goal to provide the commands to boot to EDL (Qualcomm) and to Download mode (MediaTek), so the device can be flashed through a tool like QPST/QFIL or SP Flash tool.

Some of them also provide a temporary/provisional bootloader OEM signed to can boot to this mode.

Some developers add the option to erase data because this is one of the most important obstacles to can boot to system after to get out of a bricked status.

As you can see, the blankflash file won't erase your data by itself BUT it depends on which files the developer put on it, taking a look at them, you can realize and find out if there’s something like you mentioned.

-Post

More

Is my device in EDL Mode?

How to boot into EDL Mode
[Upgrading, Modifying and Unlocking] sd_shadow:
General GSI info​

A/B Partitions and Seamless Updates

Project Treble

GSI: Generic System Images (source.android.com)

How to Flash GSI

GSI on Motorola Devices

Home

Notes about tinkering with Android Project Treble. Contribute to phhusson/treble_experimentations development by creating an account on GitHub.

github.com

Generic System Image (GSI) list

Notes about tinkering with Android Project Treble. Contribute to phhusson/treble_experimentations development by creating an account on GitHub.

github.com

Threads

https://xdaforums.com/t/guide-installing-project-treble-rom.4359911/

https://xdaforums.com/t/tutorial-how-to-install-any-gsi-on-doha-g8-plus.4290237/

https://xdaforums.com/t/dsu-not-working.4297291/

https://xdaforums.com/t/flashing-gsi-on-edge-s-20-pro-magisk-enabled.4341749/

Posts

https://xdaforums.com/t/did-anyone-apply-gsi-on-moto-g8-plus.4066961/post-84321035
[Upgrading, Modifying and Unlocking] syndicate3333:
I did it again via fastboot (step by step) and software channel hasn't changed. Could you successfully change the software channel? Btw I own the Motorola Edge. Thx again.
[Upgrading, Modifying and Unlocking] nabofox:
Help needed! (newbie here)

I have a moto g5 plus (potter) and it is locked on this screen. I already tried to use the motorola recovery program but he doesn't recognize it because imei appears 0000000. I need help to bring it back to life (my computer is linux) and if possible to install the factory rom on it.
[Upgrading, Modifying and Unlocking] nabofox:
hello, i'm trying to recover the imei of my Moto G5+, it shows 0 but in the first step you posted, it shows up

< waiting for device >

and stays like this forever
[Upgrading, Modifying and Unlocking] sd_shadow:
Qualcomm Flash Image loader (QFIL)​

https://xdaforums.com/t/successful-blankflash-on-xt1952-4.4002643/post-81097317

https://xdaforums.com/note-4/help/unbricking-qpst-snapdragon-qualcomm-t3451815
[Upgrading, Modifying and Unlocking] luridphantom:
sd_shadow, do you know how to recover this moto e6s xt-2053-2 from a boot loop? here's what happened when i messed up trying to blank flash + patched magisk boot without unlocking the bootloader (got cocky thinking a blank flash was enough to sneak past dm-verity)

tried sp flash tool/lolinet images + lmsa but no dice. my suspicion is that i need to readback the modem partitions and format all + download to reset the preloader state and fix this
[Upgrading, Modifying and Unlocking] sd_shadow:
I don't know much about MediaTek devices.

What does getvar all say?

getvar all
[Upgrading, Modifying and Unlocking] Killuminati91:
How would I create a blankflash for a device that doesnt have mmcblk0? XT2241-1
[Upgrading, Modifying and Unlocking] Sojat:
9