yashsingh1/xdaforums huggingface dataset:
[Moto G5 Plus Guides, News, & Discussion] Nirbhay2:
This Article Will Guide You to how to relock the bootloader of your moto g5 plus (Indian Variant) It should work on other Variants to but tested only on the indian variant.

Things You Need:-

1.Minimal ADB

2.Moto Stock Rom Link:- (https://firmware.center/firmware/Mo...ubsidy-DEFAULT_regulatory-DEFAULT_CFC.xml.zip)

Download the last file that has brasil in file name

Steps To Relock The Bootloader:-

1.Install Minimal ADB

2.Download And Extract Moto Stock​ Rom to any folder

3.Open The folder where you extracted the stock rom and copy all file to Minimal ADB folder.

4.Now Connect Your Device In Fastboot Mode

5.Open Minimal ADB And Type each command one by one

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

Then it will restart your Device. And You Will Get Locked Bootloader.

After locking bootloader, flash full Rom to get ota

https://pastebin.com/ZWTaWuyr

This are the commands to flash full rom.

Thanks To Telegram Group for the commands link.
[Moto G5 Plus Guides, News, & Discussion] Knight sparda:
The process worked I could reblock the bootloader of my G5 Plus XT1680
[Moto G5 Plus Guides, News, & Discussion] Nirbhay2:
Nice. Means it working for other Variant also
[Moto G5 Plus Guides, News, & Discussion] matrixzone:
I don't think you will receive OTA updates even after locking the bootloader again.
[Moto G5 Plus Guides, News, & Discussion] Schrotty35:
You have forget for flashing Recovery too.
[Moto G5 Plus Guides, News, & Discussion] Nirbhay2:
After locking bootloader, if u flash the whole rom again then u will be able to get OTA updates as normal. 100% Tested by me
[Moto G5 Plus Guides, News, & Discussion] Nirbhay2:
Flash full Rom after locking the bootloader.
[Moto G5 Plus Guides, News, & Discussion] Schrotty35:
After? You mean bevor.
[Moto G5 Plus Guides, News, & Discussion] Nirbhay2:
Yes. After locking the bootloader you can flash full rom.
[Moto G5 Plus Guides, News, & Discussion] Rajul:
Can you elaborate?

Do we need to do something else after executing these commands to get otas
[Moto G5 Plus Guides, News, & Discussion] Nirbhay2:
You have to flash full rom to get ota.

Commands are here:- Taken From Telegram Group.

https://pastebin.com/ZWTaWuyr
[Moto G5 Plus Guides, News, & Discussion] Rajul:
Now that my bootloader is locked,cqn these commands be executed?
[Moto G5 Plus Guides, News, & Discussion] Nirbhay2:
Yes
[Moto G5 Plus Guides, News, & Discussion] reuber:
I ran in the rom Brazil latam Mexico did not work, and also tested other roms and to no avail, always asks for the signed system image.
[Moto G5 Plus Guides, News, & Discussion] Nirbhay2:
You have done something wrong. This method is working 100%. Explain the error. Which build you are trying to flash...?
[Moto G5 Plus Guides, News, & Discussion] reuber:
I am using the stock XT1681-XT1683_POTTER_BRASIL_latam_MEXICO (NPNS25.137-15) and following all the commands and in the end returns the message (still requires signed boot.img) will it be due to my device being Brazilian?
[Moto G5 Plus Guides, News, & Discussion] Schrotty35:
I get same error on my EU Version.
[Moto G5 Plus Guides, News, & Discussion] Rajul:
everything works perfectly in indian variant

1.download the brazillian variant of stock rom

2.follow these steps

3.flash whole stock rom using commands posted.

4.you will get ota as soon as you start device
[Moto G5 Plus Guides, News, & Discussion] reuber:
In fact this is not a bug, but a bootloader requirement to flash a signed system image, I think!

---------- Post added at 08:27 PM ---------- Previous post was at 07:40 PM ----------

Should only work then in the Indian variant
[Moto G5 Plus Guides, News, & Discussion] Nirbhay2:
The full rom is already signed.
[Moto G5 Plus Guides, News, & Discussion] Xharos:
Is the NPNS25.137-93-8 or NPNS25.137-93-10 firmware available anywhere? I need it to re-lock my European device (reteu)
[Moto G5 Plus Guides, News, & Discussion] Wolfcity:
Searching too but didn't find one of these firmwares until now. The latest reteu/retus build uploaded is 93-4.
[Moto G5 Plus Guides, News, & Discussion] CanadianGixxerman:
Hello everyone,

My story resembles that of many people here with one difference thought. I too unlocked the bootloader, rooted the phone, took a backup of my phone using the backup utility in TWRP then flashed a few Oreo images. But none of them were bug free and satifactory. I decided to reload my phone with the backup I had done. It went in, but the phone is not working fine and shows application crashes frequently. I wanted to use POTTER_RETAIL_7.0_NPNS25.137-93-4_cid50_subsidy-DEFAULT_regulatory-DEFAULT_CFC.xml.zip to reload and relock it, but I run into a problem : I cannot flash the phone, it's like if it's in read only. When I boot the phone with volume down + power, among all that displays, one line shows : flashing_locked. Evidently that's what's preventing me from flashing ... But I can't explain why this is like like this ... Also, TWRP has been deleted from the recovery partition, but I did not do that (???). Any clues you can give to help me reload with POTTER_RETAIL_7.0_NPNS25.137-93-4_cid50_subsidy-DEFAULT_regulatory-DEFAULT_CFC.xml.zip ? Note : the phone now shows being loaded with NPNS25.137-93-8
[Moto G5 Plus Guides, News, & Discussion] Vishala10@:
I am not able to install stock ROM 7.1 on my moto g5s plus mobile in Indian variant
[Moto G5 Plus Guides, News, & Discussion] vaskar959:
will it bring back the volte?
[Moto G5 Plus Guides, News, & Discussion] ajayjnrdn:
I used to have 137.92-14 version. So can I use 137.92 or should it specifically be the 14 june patch version?
[Moto G5 Plus Guides, News, & Discussion] Wolfcity:
You have to use the version you're on, 137.92-14.

Otherwise you'll downgrade your device and that may cause a hardbrick.

You'll find the firmware here:

https://mirrors.lolinet.com/firmware/moto/potter/official/RETAIL/
[Moto G5 Plus Guides, News, & Discussion] Anilpandit2000:
thanks .. when full flash (OTA command) stock rom.. then on my phone see IMEI 0

then bootloader unlock and flash Twrp recovery then restore EFS backup. then on my phone see IMEI ok?

then what I do ? again full Flash ??
[Moto G5 Plus Guides, News, & Discussion] NZedPred:
You have to apply an ownership fix to the persist partition. Refer to the thread here:

https://xdaforums.com/g5-plus/how-to/fix-persist-resolve-imei0-explanation-t3825147

You can use the TWRP flashable fix in the OP of that thread. Then try repeating the steps above.
[Moto G5 Plus Guides, News, & Discussion] Wolfcity:
Read this: https://xdaforums.com/g5-plus/how-to/fix-persist-resolve-imei0-explanation-t3825147

It seems that your persist file got corrupted and the only way to restore your IMEI is restoring your EFS backup. This only restores your modemst1/ modemst2 files.

As you have to restore your EFS every time you flash stock I recommend to not lock your bootloader. There is no advantage in locking it.
[Moto G5 Plus Guides, News, & Discussion] zooreo:
very slow speed bro . I was downloading latest indian verison june patch. Can you provide me any other alternate link?
[Moto G5 Plus Guides, News, & Discussion] rajeshm21:
Hello. I relocked the bootloader of my moto g5 plus using the latest indian firmware available with june security patch. Now when I try to unlock my bootloader again, it shows "Unlock data unavailable". Also when I use the old unique id which I received by motorola does not seem to work. Any solution?
[Moto G5 Plus Guides, News, & Discussion] this_subha:
Anyone can tell me that which is the model? Is it properly work on XT1686 model?
[Moto G5 Plus Guides, News, & Discussion] sdhadange:
I was on oreo soak test when i unlocked the bootloader...do i have to flash the oreo firmware to relock the bootloader?...i flashed naugat firmware and currently using it...but the bootloader is still unlocked...it showed failed message to relock the bootloader....what should i do to lock the bootloader?
[Moto G5 Plus Guides, News, & Discussion] Fererio:
wiil we get official updates after relocking the bootloader?
[Moto G5 Plus Guides, News, & Discussion] pastorbob62:
You do not have to relock the bootloader to get OTA updates. You only have to be on pure stock with stock recovery, stock kernel and unrooted. Period.
[Moto G5 Plus Guides, News, & Discussion] bictu:
Hi, so I'm using XT1684 from the UK.

Under the Potter firmware:

1. There's only Android 7 (Nougat), can we then upgrade to Android 8?

2. Which firmware should I use as there's loads of different ones?

Also, will this method actually work on this device, it is a 3gb variant, single SIM.

Thanks - Josh
[Moto G5 Plus Guides, News, & Discussion] Wolfcity:
As you're in the UK the firmware should be RETGB, the 8.1 firmware could be found here( the one with XT1684 in front):

https://mirrors.lolinet.com/firmware/moto/potter/official/RETGB/

Relocking should work on any firmware, what's the reason for you to do it? There's almost no scenario where relocking the BL has any profit, maybe when you want to sell the device.
[Moto G5 Plus Guides, News, & Discussion] bictu:
Getting a new phone soon (Pixel 4a, Moto Edge or OnePlus 8), giving this phone to my girlfriend's as she's on a rooted (by me) G4 Plus but with Magisk and SafetyNet, I'm going to give her this but unrooted and take my G4 Plus back as a spare, rooted phone.
[Moto G5 Plus Guides, News, & Discussion] Wolfcity:
No need to relock it, just flashing the signed fastboot firmware is enough. Anyway, the relocking process is the same with any firmware but the Oreo firmware has more sparechunk files than the 7.0 version.

So installing the firmware:

oem fb_mode_set
fastbofastbootot flash partition gpt.bin
fastboot flash bootloader bootloader.img
fastboot flash modem NON-HLOS.bin
fastboot flash fsg fsg.mbn
fastboot erase modemst1
fastboot erase modemst2
fastboot flash dsp adspso.bin
fastboot flash logo logo.bin
fastboot flash boot boot.img
fastboot flash recovery recovery.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 system system.img_sparsechunk.5
fastboot flash system system.img_sparsechunk.6
fastboot flash system system.img_sparsechunk.7
fastboot flash system system.img_sparsechunk.8
fastboot flash oem oem.img
fastboot erase cache
fastboot erase userdata
fastboot erase DDR
fastboot oem fb_mode_clear
fastboot reboot

And if you really want to relock it the commands (after flashing the firmware) should be:

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 system system.img_sparsechunk.5
fastboot flash system system.img_sparsechunk.6
fastboot flash system system.img_sparsechunk.7
fastboot flash system system.img_sparsechunk.8
fastboot flash boot boot.img
fastboot oem lock
[Moto G5 Plus Guides, News, & Discussion] bictu:
Thanks. Copied it into a batch file so I can run either or both.
[Moto G5 Plus Guides, News, & Discussion] arnab317:
how to UNLOCK bootloader again?

bro how to unlock bootloader again , i am trying to unlock bootloader again after locking it ,but its showing

( bootloader ) invalid boot status
[Moto G5 Plus Guides, News, & Discussion] nitinsoni11:
Invalid signed img error comes up
[Moto G5 Plus Guides, News, & Discussion] ravirsaini:
I followed the process, but after a successful reboot, the boot loader in the developer setting remained unlocked. I am unable to use the Bhim UPI app, amazon UPI app (I am on fully signed stock rom)

Please Help!!!!!!!!!!!!!!!!!
[Moto G5 Plus Guides, News, & Discussion] dev4trick:
bhai sare steps follow kiye flash hone ke baad bhi bootloader unlocked hai
[Moto G5 Plus Guides, News, & Discussion] dev4trick:
XT1686 flashed stock rom but still bootloader is unlocked
[Moto G5 Plus Guides, News, & Discussion] dev4trick:
If your stock rom files have fastboot flash system system.img_sparsechunk.1 from 1 to 8 the type command upto fastboot flash system system.img_sparsechunk.8. the i will lock your boot loader
[Moto G5 Plus Guides, News, & Discussion] ChriMo:
I have potter (XT1685) on crDroid 7.22 (A11, Baseband M8953_46.55.07.90R)

Could this relock work or is something different necessary because of baseband/firmware/partitions differences? I'm not an expert but potter has such issues if I remember correctly?
[Moto G5 Plus Guides, News, & Discussion] ChriMo:
Thanks! This with Motorola Device Manager (Drivers), ADB-and-FastbootPlusPlus and the Europe (RETEU) firmware helped to relock the phone. Top.
[Moto G5 Plus Guides, News, & Discussion] Nirbhay2:
I also use the same full rom to flash and lock the bootloader and it works fine. You can do one thing, follow the mentioned commands to lock bootloader and when it give message that it still requires signed boot.img use (fastboot flash boot boot.img) and then (fastboot oem lock) and then see what's happens and if you can please attach screenshots of error.
[Moto G5 Plus Guides, News, & Discussion] FerVillanuevas:
fastboot oem fb_mode_set

fastboot flash partition gpt.bin

fastboot flash bootloader bootloader.img

fastboot flash logo logo.bin

fastboot flash boot boot.img

fastboot flash recovery recovery.img

fastboot flash dsp adspso.bin

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 modem NON-HLOS.bin

fastboot erase modemst1

fastboot erase modemst2

fastboot flash fsg fsg.mbn

fastboot erase cache

fastboot erase userdata

fastboot erase customize

fastboot erase clogo

fastboot oem fb_mode_clear

fastboot reboot
[Moto G5 Plus Guides, News, & Discussion] reuber:
I'll try again
[Moto G5 Plus Guides, News, & Discussion] Schrotty35:
No its not signed. Need signed boot.img.
[Moto G5 Plus Guides, News, & Discussion] reuber:
Still the error continues
[Moto G5 Plus Guides, News, & Discussion] Nirbhay2:
Shorten the last folder to some thing small like g5 plus or potter it will work.

And please read and follow the guide clearly.
[Moto G5 Plus Guides, News, & Discussion] shantiwari35:
OEM unlocking option is grayed out.

fastboot oem lock....this command is asking to check oem unlocking option in developer mode. But this option is grayed out in developer mode.(Stock 35). or else suggest any other option to relock bootloader.
[Moto G5 Plus Guides, News, & Discussion] Nirbhay2:
Screenshot Please
[Moto G5 Plus Guides, News, & Discussion] reuber:
On my device too
[Moto G5 Plus Guides, News, & Discussion] Nirbhay2:
Its weird. Can u try to flash .15 build full rom and then again try to lock bootloader.
[Moto G5 Plus Guides, News, & Discussion] reuber:
I give up, I will continue with my ROOT, thank you very much for your attention. I'll wait for a video made with a Brazilian variant. thank you.:good:
[Moto G5 Plus Guides, News, & Discussion] long2ski:
Just curious, when you go to the fastboot screen after running the relock process does it say oem_locked? Does it pass safety net and can run android pay or other apps that deny use due to unlocked bootloaders? I am so ready to root this phone but don't want to lose app functionality because of safety net checks and want to be able to return to locked bootloader if needed. I'm on US xt1687 (I know it says Indian variant but it seems like it SHOULD work on others, except maybe the Brazilian variant as noted above)

Edit: I know magisk is an option for rooted phones but it seems glitchy from what I read in that thread so I'm reluctant to rely on it... any opinions??
[Moto G5 Plus Guides, News, & Discussion] jutta08:
[MENTION=5486547]Nirbhay2[/MENTION],

thanks you folds well with reteu 25.137-35-5

verry good
[Moto G5 Plus Guides, News, & Discussion] reuber:
You did it? What Variant are you using, the 3 GB ram?
[Moto G5 Plus Guides, News, & Discussion] Nirbhay2:
Yes it shows oem locked. Yes it's passes safetynet
[Moto G5 Plus Guides, News, & Discussion] Nirbhay2:
It will work for you also just follow the guide and put Rom files in adb folder, then it will work
[Moto G5 Plus Guides, News, & Discussion] jutta08:
Yes, 3GB from Slim7 without root to stock,version NPNS25.137-35-5

everything went fine
[Moto G5 Plus Guides, News, & Discussion] Schrotty35:
Whene you have root you can no more close bootloader. This is very bad.
[Moto G5 Plus Guides, News, & Discussion] imxdot:
Pipl

Lpppjy

Pleas
[Moto G5 Plus Guides, News, & Discussion] earlycray:
after completing steps, when i check system update, there is no OTA available but i know there is one (-67)
[Moto G5 Plus Guides, News, & Discussion] iammrugesh:
bro bootloader is lock but i am not get ota update.....i try to flash many time but all time ota not come....even i try to flash by stock recovery but ota not come.....how to solve that?
[Moto G5 Plus Guides, News, & Discussion] FanDroid09:
I am very interested in this.... I was under the impression that the only way to lock the bootloader on a Moto phone was with an official signed firmwares from Motorola's developer site. And Moto hasn't released any for it's newer phones.

Can those of you that were successful point me to the EXACT firmware that you flashed before doing the lock command?

[MENTION=5486547]Nirbhay2[/MENTION]

[MENTION=8427870]jutta08[/MENTION]

[MENTION=8372197]Knight sparda[/MENTION]
[Moto G5 Plus Guides, News, & Discussion] Nirbhay2:
After locking the bootloader you have to flash full stock rom. Then you will be able to get ota updates.
[Moto G5 Plus Guides, News, & Discussion] Nirbhay2:
Use Stock Rom with build id NPN25.137-15. I used this to relock my bootloader and after that i flashed the full rom then i get ota update.
[Moto G5 Plus Guides, News, & Discussion] Nirbhay2:
Thread Updated with the link of firmware i used to lock. See post #1
[Moto G5 Plus Guides, News, & Discussion] FanDroid09:
I saw in OP that you only flashed sparse chunks 0-4... Isn't there like 9? Is it just not needed to do them all?

EDIT: Sorry disregard. I saw that G5 only has that many sparse chunks. Other Moto phones I've used have had up to 9.
[Moto G5 Plus Guides, News, & Discussion] FanDroid09:
I have no idea how you guys were able to get your bootloaders locked with this firmware. It is not officially signed by Moto so it shouldnt be able to work.

I get the same message of "Invalid signed image" "Preflash validation failed".

What firmware were you on BEFORE you used this to lock... the same stock firmware?
[Moto G5 Plus Guides, News, & Discussion] Nirbhay2:
Yes. The same firmware.

You can flash the full rom and then try to lock it.
[Moto G5 Plus Guides, News, & Discussion] FanDroid09:
Yes that what I did. Full flash of stock firmware, boot, reboot back into fastboot, use same firmware and your instructions to relock.

Unfortunately I still get issue with signature verification, like others have had. Not sure why this is working for some and not others.... Doesn't make sense.
[Moto G5 Plus Guides, News, & Discussion] Knight sparda:
Hello, I want to block the bootloader again using the NPNS25.137-35-5 compilation because my cell originally came with the NPN25.137-15 compilation and updated to the NPNS25.137-15-5 and since I do not have a Firmware I had to use the 35-5 that has the same version of GPT and Bootloader so it was possible to close the bootaloder again
[Moto G5 Plus Guides, News, & Discussion] Nirbhay2:
Do you have EU variant..?
[Moto G5 Plus Guides, News, & Discussion] Robert The Husky:
works on LATAM variant XT1681 :D confirmed by me
[Moto G5 Plus Guides, News, & Discussion] FerVillanuevas:
If you have a "new" rom with the update .67 will not work, because the bootlooader is updated and can not be downgraded according to what I read, then the keys do not match and therefore can not be closed: C
[Moto G5 Plus Guides, News, & Discussion] anshul786:
Yes thanks this worked for me

I just locked bootloader and boom i got an update without flashing one more time but as I installed new update 67 built there was an error in recovery please help should I install this rom one more time for removing errors
[Moto G5 Plus Guides, News, & Discussion] arunbeast:
Unable to get ota after relocking bootloader and flashing npn25.137-35

Unable to get the npn25.137-67 ota after relocking bootloader and flashing full npn25.137-35 .
[Moto G5 Plus Guides, News, & Discussion] deepu28792:
same here
[Moto G5 Plus Guides, News, & Discussion] Nirbhay2:
You have to flash NPN25.137-15 Full Rom to get the update of NPN25.137-67. As Indian Variant shipped with NPN25.137-15 Rom.
[Moto G5 Plus Guides, News, & Discussion] deepu28792:
where can I get that 137-15 rom. I couldnt find it anywhere
[Moto G5 Plus Guides, News, & Discussion] arunbeast:
The one that I can find is for BRASIL. Is it okay to flash that?
[Moto G5 Plus Guides, News, & Discussion] deepu28792:
are you sure ? Its showing some different model no. and ours is XT1686 ?
[Moto G5 Plus Guides, News, & Discussion] Nirbhay2:
Yes 100% sure. I use the same Rom
[Moto G5 Plus Guides, News, & Discussion] deepu28792:
thanks bro....thnks for the update
[Moto G5 Plus Guides, News, & Discussion] aehs29:
Just confirming this worked for me.

- XT1867 US Version

- bootloader says oem_locked.

- Using NPNS25.137-35-5
[Moto G5 Plus Guides, News, & Discussion] arunbeast:
Unable to flash NPN25.137-15 after flashing NPN25.137-35. Even after not flashing bootloader and gpt.
[Moto G5 Plus Guides, News, & Discussion] Nirbhay2:
The ROM which has to use to lock the bootloader is already mentioned in the thread than why you used another ROM..?
[Moto G5 Plus Guides, News, & Discussion] arunbeast:
The link that is mentioned in the thread had other ROMs too.
[Moto G5 Plus Guides, News, & Discussion] Nirbhay2:
Did u Read Whole thread..?

Its written that you have to use last rom file which has Brasil in its name.
[Moto G5 Plus Guides, News, & Discussion] arunbeast:
Okay. I didn't read that, but are we here to establish whose fault was that or we are talking about the solution?
[Moto G5 Plus Guides, News, & Discussion] GustavoR14:
Hello! I am using a Custom ROM, I tried to do the procedure of this tutorial, but I did not succeed. With Custom and TWRP installed, what should I do before starting the steps described in this tutorial?
[Moto G5 Plus Guides, News, & Discussion] reuber:
Hi guys, I'm using the Brazilian variant xt1683 with August security patch and it came out all right, I really block the bootloader, thanks to the friend who made the post.

---------- Post added at 08:43 PM ---------- Previous post was at 08:33 PM ----------

Please friend, only the lock with rom stock:rolleyes:
[Moto G5 Plus Guides, News, & Discussion] Nirbhay2:
First flash stock rom then try to lock the bootloader
[Moto G5 Plus Guides, News, & Discussion] GustavoR14:
I already tried to do this, and it does not work! With that I noticed, that the bootloader of my device has the version B8.09 2016-12-12. On almost every device I see, it has the Bootloader B8.20 2017-04-21. I believe this is the reason I can not do the Oem Lock. Are there any ways to update the version of my bootloader?
[Moto G5 Plus Guides, News, & Discussion] Nirbhay2:
I am also using custom rom and tried to lock the bootloader its working fine here. Use the stock rom mentioned in this thread.
[Moto G5 Plus Guides, News, & Discussion] GustavoR14:
I am using the stock ROM of my model (Cedric) and following the steps of your tutorial, but it does not work.
[Moto G5 Plus Guides, News, & Discussion] Nirbhay2:
It will never work for cedric. Its for potter