Re-lock bootloader without OEM unlocking

Search This thread

Hyoretsu

Senior Member
Jan 12, 2016
248
18
It's been 7 days since I came back to stock already and OEM unlocking is still greyed out. Is there any way to force it true so I can relock bootloader? That happened when I first tried to unlock bootloader, but I could allow it in like 4 days
If you wanna know reasons I tried installing Custom ROMs, and on the one successful installation (AOSP Extended) it's bugged so I returned to stock and kept on trying to install CrDroid, but one day it just stopped recognizing SIMs. (After some time on stock being able to)
・It can't be a number block, since it still works on another Custom ROM+Magisk Phone
・And I'm not sure if an IMEI block would mess with a SIM from another carrier that's never touched a rooted phone. (I tested both SIMs on both slots)
・That same SIM (my original one) stopped working on an unrooted G7 Play too
・Also I can't check any of my 2 IMEIs on settings, though I could retrieve IMEI1 through "fastboot getvar all"
 
Last edited:

sd_shadow

Recognized Contributor / XDA Welcome Team
Sep 21, 2011
18,722
2
9,492
South Dakota
goo.gl
Motorola Droid X
Amazon Fire
It's been 7 days since I came back to stock already and OEM unlocking is still greyed out. Is there any way to force it true so I can relock bootloader? That happened when I first tried to unlock bootloader, but I could allow it in like 4 days
If you wanna know reasons I tried installing Custom ROMs, and on the one successful installation (AOSP Extended) it's bugged so I returned to stock and kept on trying to install CrDroid, but one day it just stopped recognizing SIMs. (After some time on stock being able to)
・It can't be a number block, since it still works on another Custom ROM+Magisk Phone
・And I'm not sure if an IMEI block would mess with a SIM from another carrier that's never touched a rooted phone. (I tested both SIMs on both slots)
・That same SIM (my original one) stopped working on an unrooted G7 Play too
・Also I can't check any of my 2 IMEIs on settings, though I could retrieve IMEI1 through "fastboot getvar all"
What does getvar all say are the codename and software channel?

Sent from my perry_f using XDA Labs
 

Hyoretsu

Senior Member
Jan 12, 2016
248
18
What does getvar all say are the codename and software channel?

Sent from my perry_f using XDA Labs
I didn't find those specifically, but it's ocean XT1955-1 and RETBR (product/board and sku, and ro.carrier) Tried reflashing NHLOS.bin, erasing modem and flashing FSG today, didn't work and I never ran "fastboot erase all" too (by not working I mean the phone doesn't recognize a SIM is in the tray, I don't even have the emergency calls only message)
Re-flashed stock around 4 times a week ago or so, the only thing I didn't do was relock bootloader since I'm unable to

Here's the full output of getvar all if needed. (that's not the actual IMEI that's output'd) Also between those tries I sometimes could get device ID to show up instead of bad key, no idea why though

Brazil also has a site from ANATEL, the organization that manages product quality, authenticity, restrictions, user things and such, (All devices need to pass through a check from them) that allows us to see if IMEI has any restrictions (It shows if the IMEI is blocked, at least "Informed IMEI is banned by loss or theft" on a video I saw), mine has "Until now, the IMEI has no restrictions on use"
 
Last edited:

sd_shadow

Recognized Contributor / XDA Welcome Team
Sep 21, 2011
18,722
2
9,492
South Dakota
goo.gl
Motorola Droid X
Amazon Fire
I didn't find those specifically, but it's ocean XT1955-1 and RETBR (product/board and sku, and ro.carrier) Tried reflashing NHLOS.bin, erasing modem and flashing FSG today, didn't work and I never ran "fastboot erase all" too (by not working I mean the phone doesn't recognize a SIM is in the tray, I don't even have the emergency calls only message)
Re-flashed stock around 4 times a week ago or so, the only thing I didn't do was relock bootloader since I'm unable to

Here's the full output of getvar all if needed. (that's not the actual IMEI that's output'd) Also between those tries I sometimes could get device ID to show up instead of bad key, no idea why though

Brazil also has a site from ANATEL, the organization that manages product quality, authenticity, restrictions, user things and such, (All devices need to pass through a check from them) that allows us to see if IMEI has any restrictions (It shows if the IMEI is blocked, at least "Informed IMEI is banned by loss or theft" on a video I saw), mine has "Until now, the IMEI has no restrictions on use"
Did you check the flashfile.xml
For the official flash commands?

Sent from my Moto E (4) using Tapatalk
 

Hyoretsu

Senior Member
Jan 12, 2016
248
18
Last edited:

WoKoschekk

Senior Member
Feb 25, 2019
1,041
1
329
Cologne
Moto G6
Moto G6 Plus
OEM unlocking is still greyed out.

OEM unlock toggle is greyed out as long as your bootloader is unlocked, Magisk is not installed and you run the stock rom. That's quite normal. You must relock the bootloader to activate it. On my Moto g6 plus you find an info text there that this option is deactivated because the bootloader is already unlocked.
 

Hyoretsu

Senior Member
Jan 12, 2016
248
18
OEM unlock toggle is greyed out as long as your bootloader is unlocked, Magisk is not installed and you run the stock rom. That's quite normal. You must relock the bootloader to activate it. On my Moto g6 plus you find an info text there that this option is deactivated because the bootloader is already unlocked.
Though all my attempts at installing only Magisk lead to a bootloop and Custom ROMs either didn't work or I spent multiple days trying to install, only being successful once. I tried relocking the bootloader, but it says I gotta check that option to do it (mine says it's already unlocked too)
 

sd_shadow

Recognized Contributor / XDA Welcome Team
Sep 21, 2011
18,722
2
9,492
South Dakota
goo.gl
Motorola Droid X
Amazon Fire
Though all my attempts at installing only Magisk lead to a bootloop and Custom ROMs either didn't work or I spent multiple days trying to install, only being successful once. I tried relocking the bootloader, but it says I gotta check that option to do it (mine says it's already unlocked too)
Usually that error is caused from using the wrong relocking commands
Are you using
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
 

sd_shadow

Recognized Contributor / XDA Welcome Team
Sep 21, 2011
18,722
2
9,492
South Dakota
goo.gl
Motorola Droid X
Amazon Fire
And mine is greyed out too
 

Attachments

  • Screenshot_20200217-231249.png
    Screenshot_20200217-231249.png
    111 KB · Views: 271

WoKoschekk

Senior Member
Feb 25, 2019
1,041
1
329
Cologne
Moto G6
Moto G6 Plus
Though all my attempts at installing only Magisk lead to a bootloop and Custom ROMs either didn't work or I spent multiple days trying to install, only being successful once. I tried relocking the bootloader, but it says I gotta check that option to do it (mine says it's already unlocked too)

Did you try to install Magisk via TWRP? Maybe older versions will work like v19.3... On my Moto g6 v20.3 leads to a bootloop, too. But v19.3 runs without any problems. Maybe it's worth a try. ;)

I red that it's necessary to run the oem lock command a few times to make it work.
 
Last edited:

Hyoretsu

Senior Member
Jan 12, 2016
248
18
Usually that error is caused from using the wrong relocking commands
Are you using
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
I actually thought this was it, but no, I was using this thread, which has the same commands, and still got the error (2x, then 3x, reflash boot.img and oem lock)
Did you try to install Magisk via TWRP? Maybe older versions will work like v19.3... On my Moto g6 v20.3 leads to a bootloop, too. But v19.3 runs without any problems. Maybe it's worth a try. ;)
Installing Magisk on TWRP bootable, since installing TWRP would bootloop too. Didn't try older versions though, but I might try re-writing my IMEI first, who knows if that'll work. Being able to successfully relock bootloader without a working SIM wouldn't do much good, since I'd have to format the phone to try anything afterwards.
 

WoKoschekk

Senior Member
Feb 25, 2019
1,041
1
329
Cologne
Moto G6
Moto G6 Plus
I actually thought this was it, but no, I was using this thread, which has the same commands, and still got the error (2x, then 3x, reflash boot.img and oem lock)

Installing Magisk on TWRP bootable, since installing TWRP would bootloop too. Didn't try older versions though, but I might try re-writing my IMEI first, who knows if that'll work. Being able to successfully relock bootloader without a working SIM wouldn't do much good, since I'd have to format the phone to try anything afterwards.

Did you try to install TWRP with the .zip provided by twrp.me? This .zip flashes the ramdisk inside the boot.img as Magisk does. So first you must install TWRP and after that you must install Magisk. Ignoring this order causes a bootloop because the twrp.zip overwrites Magisk! The twrp.zip flashes a complete new ramdisk while Magisk patches only some parts of it.

I loose my IMEI on my Moto g6 plus, too. You won't be able to overwrite it because it is linked with your device and encrypted by Motorola. The location of these files is /persist/rfs.
If your IMEI is broken or corrupt you won't be able to restore it. Except you have a backup of your persist partition.

---------- Post added at 09:31 PM ---------- Previous post was at 09:25 PM ----------

Try to relock your bootloader with the command provided in the screenshot (source: https://source.android.com/setup/build/running)

Screenshot
https://ibb.co/f2LzMzS
 
Last edited:

Hyoretsu

Senior Member
Jan 12, 2016
248
18
Did you try to install TWRP with the .zip provided by twrp.me? This .zip flashes the ramdisk inside the boot.img as Magisk does. So first you must install TWRP and after that you must install Magisk. Ignoring this order causes a bootloop because the twrp.zip overwrites Magisk! The twrp.zip flashes a complete new ramdisk while Magisk patches only some parts of it.
I get a bootloop when I install TWRP alone and when I install Magisk from bootable TWRP, been using the official one from twrp.me this whole time since the screen is bugged on unofficial one. I only ever installed both (in that order) when I was still trying to install Custom ROMs, but I kept getting bootloops for other reasons.
 

MrCamby

Senior Member
Apr 4, 2012
76
28
Do t even use twrp. Just install Magisk Manager and then patch a copy of the boot image from the firmware you installed.

So install Magisk Manager

Copy the boot image from the firmware that you installed to your phone.

Run Magisk Manager, click update Magisk and Select patch boot.img

Navigate to the folder on you phone that you copied the boot image to

Wait until Magisk Manager patches it

Copy Patched_boot.img to your adb folder on your PC

From your PC command prompt:
adb reboot bootloader

Then

fastboot devices

If your phone serial # shows, then:

fastboot flash boot patched_boot.img

fastboot reboot

You should now have root and the unlock bootloader option in developer settings will not be greyed out.

There is another thread with these same instructions. That is what allowed me to relock my bootloader.


Sent from my moto g(7) power using Tapatalk
 
Last edited:
  • Like
Reactions: d_g_m_2000

MrCamby

Senior Member
Apr 4, 2012
76
28
Also,

Now that you are able to relock your bootloader, you could hold off until 10 is out.

If you don't like the unlocked bootloader message on startup, flash the attached logo.img fileView attachment BootLogo_mg7p.zippreview2.jpg

Sent from my moto g(7) power using Tapatalk
 

Hyoretsu

Senior Member
Jan 12, 2016
248
18
Do t even use twrp. Just install Magisk Manager and then patch a copy of the boot image from the firmware you installed.

So install Magisk Manager

Copy the boot image from the firmware that you installed to your phone.

Run Magisk Manager, click update Magisk and Select patch boot.img

Navigate to the folder on you phone that you copied the boot image to

Wait until Magisk Manager patches it

Copy Patched_boot.img to your adb folder on your PC

From your PC command prompt:
adb reboot bootloader

Then

fastboot devices

If your phone serial # shows, then:

fastboot flash boot patched_boot.img

fastboot reboot

You should now have root and the unlock bootloader option in developer settings will not be greyed out.

There is another thread with these same instructions. That is what allowed me to relock my bootloader.


Sent from my moto g(7) power using Tapatalk
Ty, this was the only way in which I could get root in stock. Although the Allow OEM Unlock is still greyed out it now has the same message as before I unlocked the bootloader for the first time, though if it acts the same way it'll be available in a few days. IMEIs and SIMs still aren't working though, but eh. At least I can try testing the locking bootloader theory to get them working again (IMEI not working = can't even see any of them in settings)
Also, now that you are able to relock your bootloader, you could hold off until 10 is out.
Also Motorola still allows unlocked users to receive OTA for some reason, my device updated and it's still working
 

MrCamby

Senior Member
Apr 4, 2012
76
28
To repair your IMEI on a G7 power, this is what worked for me:

Remove your sim card.

Pull NON-HLOS.bin and fsg.mbn from the firmware that was flashed on the phone.

Startup in bootloader mode:

fastboot flash modem NON-HLOS.bin

fastboot erase modemst1

fastboot erase modemst2

fastboot flash fsg fsg.mbn

Reboot phone. Once it is back up, powerdown, put sim card back in and start back up.



Sent from my moto g(7) power using Tapatalk
 
  • Like
Reactions: sd_shadow

Hyoretsu

Senior Member
Jan 12, 2016
248
18
To repair your IMEI on a G7 power, this is what worked for me:

Remove your sim card.
Pull NON-HLOS.bin and fsg.mbn from the firmware that was flashed on the phone.
Startup in bootloader mode:
fastboot flash modem NON-HLOS.bin
fastboot erase modemst1
fastboot erase modemst2
fastboot flash fsg fsg.mbn
Reboot phone. Once it is back up, powerdown, put sim card back in and start back up.
No luck unfortunately, still don't have IMEI/SIM. Once I can I'll try relocking bootloader and maybe sending it to warranty, since apparently using a tool to re-write IMEI won't work on this phone. (Followed to the T, unless unlocking it after flashing and waiting for microSD messes it up)
 
Last edited:

MrCamby

Senior Member
Apr 4, 2012
76
28
Did you try the LMSA software to try and fix it. There are two options: update and repair.



Sent from my moto g(7) power using Tapatalk
 

Hyoretsu

Senior Member
Jan 12, 2016
248
18
Did you try the LMSA software to try and fix it. There are two options: update and repair.
I tried using it back when I was trying to go back to stock "the right way" (to try and solve the lost IMEI, go back stock and re-lock bootloader) but it couldn't even recognize my phone so that I could download anything
 

Top Liked Posts

  • There are no posts matching your filters.
  • 2
    I was finally able to root, have stock os, should have twrp recovery but dont seem to have any, but thats likely due to me trying to root and all.

    my issue is that the oem unlocking is still grayed out, and running all the locking commands mentioned here and elsewhere still tells me to go unlock the option in developer options (grayed out in off/left position with the note that bootloader is already unlocked).

    rootchecker and magisk confirm device is rooted. any idea how to enable (un-gray-out) the oem (un)lock toogle switch?

    edit: as far as how i was able to root in the end, i flashed twrp to both slots (img file), then from phone selected recovery and got twrp to start, then installed from twrp recovery the patched magisk img, but not sure if could duplicate since ive been at this for hours each day for a while, so it all runs together.
    Magisk Hide must be enabled. Only this option hides the unlocked bootloader which results in an active toggle for the OEM Unlock option.
    1
    Do t even use twrp. Just install Magisk Manager and then patch a copy of the boot image from the firmware you installed.

    So install Magisk Manager

    Copy the boot image from the firmware that you installed to your phone.

    Run Magisk Manager, click update Magisk and Select patch boot.img

    Navigate to the folder on you phone that you copied the boot image to

    Wait until Magisk Manager patches it

    Copy Patched_boot.img to your adb folder on your PC

    From your PC command prompt:
    adb reboot bootloader

    Then

    fastboot devices

    If your phone serial # shows, then:

    fastboot flash boot patched_boot.img

    fastboot reboot

    You should now have root and the unlock bootloader option in developer settings will not be greyed out.

    There is another thread with these same instructions. That is what allowed me to relock my bootloader.


    Sent from my moto g(7) power using Tapatalk
    1
    To repair your IMEI on a G7 power, this is what worked for me:

    Remove your sim card.

    Pull NON-HLOS.bin and fsg.mbn from the firmware that was flashed on the phone.

    Startup in bootloader mode:

    fastboot flash modem NON-HLOS.bin

    fastboot erase modemst1

    fastboot erase modemst2

    fastboot flash fsg fsg.mbn

    Reboot phone. Once it is back up, powerdown, put sim card back in and start back up.



    Sent from my moto g(7) power using Tapatalk
    1
    At one point it did not recognize mine. I flashed an older firmware via adb. Booted it, setup with no account and no sdcard or sim card. Once setup, master reset via the phone. Then connected to lmsa and did a repair.

    After it was done, put sim in and then reboot and set up.





    Sent from my moto g(7) power using Tapatalk
    1
    WOAH!!!! thank you!!- i made progress. now its telling me about connecting to internet or carrier. i know i saw that in one of these threads. going to track that down.
    after trying some things ended back in a bootloop and got to some message about boot being corrupted and offering restore/reset, so i did that. so starting again from full stock.

    i think part of my problem was trying to keep stock recovery and just bootng to twrp, i think that may have led to the patched image from magisk not working as it should. i was afraid the custom recovery would get locked after locking bootloader, but i guess thats why you flash the stock boot.img in the middle of the lock commands. we'll see.