[GUIDE] Relock bootloader (Should work in all versions)

Search This thread

WoKoschekk

Senior Member
Feb 25, 2019
828
1
232
Cologne
Moto G6
Moto G9 Plus
Yes, that's right. That's what I wrote above. Follow the output messages on your PC.
The output is: still requires signed boot.img
You do: Flash only the boot.img and run the lock command again.
When you see the output "Still require signed system.img and/or oem.img" you have to flash vendor.img AND oem.img!
 
  • Like
Reactions: sd_shadow

smartasiankid

Senior Member
May 26, 2019
79
0
all the files on the latest firmware for moto one p30 play:
Screenshot (5).png
 

smartasiankid

Senior Member
May 26, 2019
79
0
Yes, that's right. That's what I wrote above. Follow the output messages on your PC.
The output is: still requires signed boot.img
You do: Flash only the boot.img and run the lock command again.
When you see the output "Still require signed system.img and/or oem.img" you have to flash vendor.img AND oem.img!
ive flashed the boot, but it still says it requires signed boot.img after flashing boot.img command and rerunning fastboot oem lock command.
 

smartasiankid

Senior Member
May 26, 2019
79
0
the bootloader says this:

C:\Users\Lakshmi\Downloads\DEEN_QPKS30.54_22_24_cid50_subsidy_DEFAULT_regulatory_DEFAULT_CFC.xml>fastboot flash boot boot.img
(bootloader) is-logical:boot_a: not found
Sending 'boot_a' (65536 KB) OKAY [ 2.060s]
Writing 'boot_a' OKAY [ 0.933s]
Finished. Total time: 3.514s

C:\Users\Lakshmi\Downloads\DEEN_QPKS30.54_22_24_cid50_subsidy_DEFAULT_regulatory_DEFAULT_CFC.xml>fastboot oem lock
(bootloader) Still require signed boot.img
OKAY [ 0.007s]
Finished. Total time: 0.008s
 

Skorpyun812

Senior Member
Jul 29, 2012
87
29
So I tried relocking my moto edge XT2063-2 and when using the lock script (Lock Q 10, i believe. I was on Android 10 stock. Don't recall the version but, I didn't unlock my bootloader until like ... August of this year. That's when the auto updates stopped). The lock script found in the provided link, successfully relocked my bootloader, rebooted back to bootloader then I got that red triangle. I tried rebooting into recovery, the bootloader rebooted again and now all the graphics are gone, replaced with just words, "Start, Restart Bootloader, Recovery Mode, Power Off, Bootloader Logs" and that's it. No Recovery, No ROM. At the bottom it says I'm in "AP Fastboot Flash Mode (Secure)" and "No Bootable A/B slot", "Failed to boot Linux, falling back to fastboot", Fastboot reason: Fall-through from charger boot mode". Powershell and Command prompt give daemon errors but, still report successfully when entering command "adb devices" but, lists no devices. Blankflash is "waiting for device".

Should I just launch this thing? I'm ready to launch this thing. I've never had a phone brick on me like this. I just can't figure out how to talk to it at this point.
 

Skorpyun812

Senior Member
Jul 29, 2012
87
29
So I tried relocking my moto edge XT2063-2 and when using the lock script (Lock Q 10, i believe. I was on Android 10 stock. Don't recall the version but, I didn't unlock my bootloader until like ... August of this year. That's when the auto updates stopped). The lock script found in the provided link, successfully relocked my bootloader, rebooted back to bootloader then I got that red triangle. I tried rebooting into recovery, the bootloader rebooted again and now all the graphics are gone, replaced with just words, "Start, Restart Bootloader, Recovery Mode, Power Off, Bootloader Logs" and that's it. No Recovery, No ROM. At the bottom it says I'm in "AP Fastboot Flash Mode (Secure)" and "No Bootable A/B slot", "Failed to boot Linux, falling back to fastboot", Fastboot reason: Fall-through from charger boot mode". Powershell and Command prompt give daemon errors but, still report successfully when entering command "adb devices" but, lists no devices. Blankflash is "waiting for device".

Should I just launch this thing? I'm ready to launch this thing. I've never had a phone brick on me like this. I just can't figure out how to talk to it at this point.
So, I tried fixing the issue by addressing "No Bootable A/B slot". This is what happened with the commands I entered:

C:\Users\Murica\Desktop\platform-tools_r31.0.3-windows\platform-tools> fastboot devices
Z********F fastboot

C:\Users\Murica\Desktop\platform-tools_r31.0.3-windows\platform-tools>fastboot set_active other
Setting current slot to 'a' FAILED (remote: '')
fastboot: error: Command failed

C:\Users\Murica\Desktop\platform-tools_r31.0.3-windows\platform-tools> fastboot set_active other
Setting current slot to 'a' FAILED (remote: '')
fastboot: error: Command failed

C:\Users\Murica\Desktop\platform-tools_r31.0.3-windows\platform-tools> fastboot set_active b
Setting current slot to 'b' FAILED (remote: '')
fastboot: error: Command failed

C:\Users\Murica\Desktop\platform-tools_r31.0.3-windows\platform-tools> fastboot flash boot_b boot.img
Sending 'boot_b' (98304 KB) OKAY [ 2.225s]
Writing 'boot_b' (bootloader) flash permission denied
FAILED (remote: '')
fastboot: error: Command failed

C:\Users\Murica\Desktop\platform-tools_r31.0.3-windows\platform-tools> fastboot set_active a
Setting current slot to 'a' FAILED (remote: '')
fastboot: error: Command failed

C:\Users\Murica\Desktop\platform-tools_r31.0.3-windows\platform-tools>fastboot flash boot_a boot.img
Sending 'boot_a' (98304 KB) OKAY [ 2.237s]
Writing 'boot_a' (bootloader) flash permission denied
FAILED (remote: '')
fastboot: error: Command failed

C:\Users\Murica\Desktop\platform-tools_r31.0.3-windows\platform-tools>fastboot flash boot boot.img
fastboot: error: Failed to identify current slot

C:\Users\Murica\Desktop\platform-tools_r31.0.3-windows\platform-tools>fastboot boot_a boot.img
fastboot: usage: unknown command boot_a

C:\Users\Murica\Desktop\platform-tools_r31.0.3-windows\platform-tools>fastboot boot_b boot.img
fastboot: usage: unknown command boot_b


Thoughts anyone?
 

Skorpyun812

Senior Member
Jul 29, 2012
87
29
So, I tried fixing the issue by addressing "No Bootable A/B slot". This is what happened with the commands I entered:

C:\Users\Murica\Desktop\platform-tools_r31.0.3-windows\platform-tools> fastboot devices
Z********F fastboot

C:\Users\Murica\Desktop\platform-tools_r31.0.3-windows\platform-tools>fastboot set_active other
Setting current slot to 'a' FAILED (remote: '')
fastboot: error: Command failed

C:\Users\Murica\Desktop\platform-tools_r31.0.3-windows\platform-tools> fastboot set_active other
Setting current slot to 'a' FAILED (remote: '')
fastboot: error: Command failed

C:\Users\Murica\Desktop\platform-tools_r31.0.3-windows\platform-tools> fastboot set_active b
Setting current slot to 'b' FAILED (remote: '')
fastboot: error: Command failed

C:\Users\Murica\Desktop\platform-tools_r31.0.3-windows\platform-tools> fastboot flash boot_b boot.img
Sending 'boot_b' (98304 KB) OKAY [ 2.225s]
Writing 'boot_b' (bootloader) flash permission denied
FAILED (remote: '')
fastboot: error: Command failed

C:\Users\Murica\Desktop\platform-tools_r31.0.3-windows\platform-tools> fastboot set_active a
Setting current slot to 'a' FAILED (remote: '')
fastboot: error: Command failed

C:\Users\Murica\Desktop\platform-tools_r31.0.3-windows\platform-tools>fastboot flash boot_a boot.img
Sending 'boot_a' (98304 KB) OKAY [ 2.237s]
Writing 'boot_a' (bootloader) flash permission denied
FAILED (remote: '')
fastboot: error: Command failed

C:\Users\Murica\Desktop\platform-tools_r31.0.3-windows\platform-tools>fastboot flash boot boot.img
fastboot: error: Failed to identify current slot

C:\Users\Murica\Desktop\platform-tools_r31.0.3-windows\platform-tools>fastboot boot_a boot.img
fastboot: usage: unknown command boot_a

C:\Users\Murica\Desktop\platform-tools_r31.0.3-windows\platform-tools>fastboot boot_b boot.img
fastboot: usage: unknown command boot_b


Thoughts anyone?
Being the stubborn novice I am, I took the "Lock script" and created a new .bat via copy n paste then, edited the script from "lock" to "unlock" everywhere in the coding or whatever the proper term is (3 places towards the bottom of the text). Now I am able to talk to the partitions successfully (Slot A/B). Here's the first few lines of command for comparison to my previous reply:

C:\Users\Murica\Desktop\platform-tools_r31.0.3-windows\platform-tools> fastboot devices
Z********F fastboot

C:\Users\Murica\Desktop\platform-tools_r31.0.3-windows\platform-tools>fastboot set_active other
Setting current slot to 'a' OKAY [ 0.172s]
Finished. Total time: 0.172s
 

Skorpyun812

Senior Member
Jul 29, 2012
87
29
Being the stubborn novice I am, I took the "Lock script" and created a new .bat via copy n paste then, edited the script from "lock" to "unlock" everywhere in the coding or whatever the proper term is (3 places towards the bottom of the text). Now I am able to talk to the partitions successfully (Slot A/B). Here's the first few lines of command for comparison to my previous reply:

C:\Users\Murica\Desktop\platform-tools_r31.0.3-windows\platform-tools> fastboot devices
Z********F fastboot

C:\Users\Murica\Desktop\platform-tools_r31.0.3-windows\platform-tools>fastboot set_active other
Setting current slot to 'a' OKAY [ 0.172s]
Finished. Total time: 0.172s
I successfully flashed slot A and got my recovery back (TWRP). Still won't boot but, it's pretty much child's play from here. I hope someone finds this useful if the lock script "soft brick's" their device. I will note that the script DID WORK! It did in fact lock my bootloader, causing this loop of dead ends. WOOOOO! The novice did a thing! :)
 

toddk63

Member
Mar 4, 2018
10
0
I have followed the instructions and re-ran the .bat script. When I get to the point of OEM lock, I get the reply of "(bootloader) check 'allow oem unlock' in developer options"
When I check the bootloader status in developer options, it says "Bootloader is already unlocked" and I can't change the position of the button. Do I need to make sure I can change the position of the "Enable OEM Unlock" switch, even if it says it's already unlocked?

I will be happy to install magisk again if needed, if in fact I need to change the position of the switch.
In fact you do need to enable "Allow OEM Unlock". That was my hangup. I thought I was rooted, but re-rooted then could change that switch.
 

analla

Member
Dec 2, 2020
23
1
46
Hi! I have a Motorola G60, I opened the bootloader, but couldn't find any modified ROMs for it. I didn't change anything, I didn't root.
How to lock the bootloader?
Fastboot oem lock?
 

plakkat

Member
Jul 23, 2014
14
1
Guide updated!!!!!

If you wanna get back to stock ROM and relock bootloader + get OTAs working again, this is the right place!
DISCLAIMER: Relocking bootloader erases all your data/internal storage and (off course) remove TWRP/modules/root, so do a backup of all your data first. Also, I'm not responsible for any bricked devices (phones, SD Cards, etc). I tested it in my XT1955-1 and it worked fine, but we all know that errors might occur.
Finally, let's go to the steps.

Step 1 - Downloading necessary files
Download Android Platform Tools here and then extract it.

Install Motorola Drivers on your PC (download here).

Download the lastest firmware according to your variant/software channel here and extract it in the same folder you had extracted Android Platform Tools.

Download the "Lock Script" here, according to your android version and PC's OS.
For example: if your PC uses Windows as OS, and your phone is in android 10, download the "Lock-10q_windows.bat" file.
Or if you have a Linux distro on your PC and android 9 on your phone, download "Lock-9pie_linux.sh" file.
Place the file inside the platform-tools folder, where the ROM was extracted too.

Step 2 - Preparing your phone
Remove all your google account in device's settings and then go to Developer Options. Enable Android debugging and OEM unlocking (if you can't enable OEM unlocking, you may need to root your device first to get it avaible again (see Rooting thread)).
Power off your phone and put it fastboot mode. Connect it on PC using USB cable.

Step 3 - Installing Stock ROM and re-locking bootloader
Just double click on the Lock.bat/.sh file and it will reflash stock ROM and lock bootloader. Now all you have to do is wait till it finishes. This should take a few minutes to be done.
The phone will boot automatically after the last command is executed.


It seems to be a little hard, but it's easy. If you have any questions, let me know, I'll try to answer ASAP.
Hello! How can make this work con android 12¿?
 

Top Liked Posts

  • There are no posts matching your filters.
  • 10
    Guide updated!!!!!

    If you wanna get back to stock ROM and relock bootloader + get OTAs working again, this is the right place!
    DISCLAIMER: Relocking bootloader erases all your data/internal storage and (off course) remove TWRP/modules/root, so do a backup of all your data first. Also, I'm not responsible for any bricked devices (phones, SD Cards, etc). I tested it in my XT1955-1 and it worked fine, but we all know that errors might occur.
    Finally, let's go to the steps.

    Step 1 - Downloading necessary files
    Download Android Platform Tools here and then extract it.

    Install Motorola Drivers on your PC (download here).

    Download the lastest firmware according to your variant/software channel here and extract it in the same folder you had extracted Android Platform Tools.

    Download the "Lock Script" here, according to your android version and PC's OS.
    For example: if your PC uses Windows as OS, and your phone is in android 10, download the "Lock-10q_windows.bat" file.
    Or if you have a Linux distro on your PC and android 9 on your phone, download "Lock-9pie_linux.sh" file.
    Place the file inside the platform-tools folder, where the ROM was extracted too.

    Step 2 - Preparing your phone
    Remove all your google account in device's settings and then go to Developer Options. Enable Android debugging and OEM unlocking (if you can't enable OEM unlocking, you may need to root your device first to get it avaible again (see Rooting thread)).
    Power off your phone and put it fastboot mode. Connect it on PC using USB cable.

    Step 3 - Installing Stock ROM and re-locking bootloader
    Just double click on the Lock.bat/.sh file and it will reflash stock ROM and lock bootloader. Now all you have to do is wait till it finishes. This should take a few minutes to be done.
    The phone will boot automatically after the last command is executed.


    It seems to be a little hard, but it's easy. If you have any questions, let me know, I'll try to answer ASAP.
    2
    Very nice, it's really working! Thanks! :)
    2
    My Moto G7 Power is running Android 11. Is there a "Lock-11q_windows.bat" file available. Or could I just flash "Lock-10q_windows.bat" file?
    You only need to flash the latest firmware for your device. After that (still in fastboot mode) you run the command
    Code:
    fastboot oem lock
    and follow the instructions in your terminal's output.
    You should read sth. like "still 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. Go ahead until your bootloader is locked.

    But it's highly recommended to flash the latest firmware and boot up once before locking the bootloader!! If sth. should fail you are still able to access all partitions. Complete the setup wizard, test your mobile data and Wifi (and whatever you want) and if your device runs without any issues, you should start with the beginning of this post.
    2
    " Download the lastest firmware according to your variant/software channel" Could someone explain that part for me? I clicked the link and i dont know what to download in that "ocean" folder
    Safest way to get firmware is LMSA
    or run getvar all to find
    Codename, model #, software channel. and software version
    Code:
    fastboot getvar all
    1
    ...and of course also the system.img ;-)