yashsingh1/xdaforums huggingface dataset:
[Moto G4 Plus Guides, News, & Discussion] echo92:
Yes, you should get and be able to install the OTA updates okay with this stock ROM, provided you don't modify your system or recovery. Whether your bootloader is locked or not doesn't matter, make sure this build corresponds to the latest version of marshmallow for your territory too (off​ the top of my head, EU/UK and India seem to be okay, not sure about Asia Pacific?) I've flashed this on a UK xt 1642 and updated to Nougat OTA with no issue.

Regarding flashing, yes to following the commands. Bear in mind your data and internal storage may be wiped, so back up. Also, if you're downgrading from Nougat, you'll have to unlock your bootloader and also omit flashing the gpt and bootloader. Good luck either way :) oh, and see stevenfernades's comment below for not relocking too.
[Moto G4 Plus Guides, News, & Discussion] StevenFernandes:
Ul get the update of 7.0(nougat). So u dont have to worry about that

If u don't want to relock the bootloader then skip the 1st 2 lines and 2nd last line i.e

"fastboot oem lock begin"

"fastboot oem lock begin"

"fastboot oem lock"

Thats it.... Ul have stock ROM with unlocked bootloader
[Moto G4 Plus Guides, News, & Discussion] sandipmahajank2:
this rom is for xt 1643 india .....?
[Moto G4 Plus Guides, News, & Discussion] echo92:
Yes - as per the title and first post.

Note, this is the latest Marshmallow ROM of build MPJ24.139-63/64, 1 July 2016 security patch. I've also successfully flashed this on a XT 1642 (UK, retgb device) but our Marshmallow (MM) build numbers are the same as this and have noted EU devices flashing okay with this. Your experience may vary - I believe US phones have the MM build 139-64/65, thus do not flash this on US devices and any other territories where the up-to-date MM build is not 139-63/64.
[Moto G4 Plus Guides, News, & Discussion] kurianvinil:
didnt work for my moto g4 plus...why does that happen??
[Moto G4 Plus Guides, News, & Discussion] niks23:
I am getting on mobile.... So should i press "yes I am in" or may be "later"
[Moto G4 Plus Guides, News, & Discussion] kurianvinil:
where?/
[Moto G4 Plus Guides, News, & Discussion] kurianvinil:
Hello all, actually it didnt work on my moto i think my build number is the problem, my phones build number is NPJ25.75-2.

Does anyone help me with this?
[Moto G4 Plus Guides, News, & Discussion] echo92:
What do you mean by it didn't work? If you meant updating to the latest Nougat via OTA, you won't be able to on the 75-2 build. That was a soak test build and, if your device was not on the soak test program, a dead end. You could either revert back to the MM build in the first post (though you'll have to unlock your bootloader to do so, here's a useful guide https://xdaforums.com/moto-g4-plus/how-to/guide-downgrade-to-marshmallow-nougat-t3515961 ), or alternatively flash the fastboot 93-14 ROM, which is the latest Nougat build (v7.0, Dec 2016 security patch) https://xdaforums.com/moto-g4-plus/how-to/moto-g4-plus-xt1640-43-athene-npj25-93-t3549369

Either method should get you back into the official OTA stream

---------- Post added at 01:11 PM ---------- Previous post was at 01:05 PM ----------

You'll have to unroot and revert back to your stock recovery if you wish to flash via OTA, else the update will abort. No need to lock the bootloader, the OTA updates appear to only check if your system and recovery are not modified.

If you don't have a stock recovery or wish an easier way to update, you could use either method i posted above to flash a stock ROM and proceed (but please check that the marshmallow ROM is compatible for your device). Best in mind flashing the stock will erase any modifications. Also, if you wish to re root in Nougat, you need to flash ElementalX or another custom kernel.

As always, ensure your data is backed up before you proceed. Good luck :)
[Moto G4 Plus Guides, News, & Discussion] StevenFernandes:
It worked for me. What error does it show?
[Moto G4 Plus Guides, News, & Discussion] kurianvinil:
when we run the batch file , it showing failed, sometimes its okay, then again FAILED message coming(in batch file)
[Moto G4 Plus Guides, News, & Discussion] echo92:
Have you got your boot loader unlocked? If you wish to downgrade you must unlock (and thus void your warranty). If you don't wish to void your warranty and still wasn't to upgrade, you could flash the 93-14 nougat update as I posted earlier. That will flash over your soak test and being you up to the latest nougat.
[Moto G4 Plus Guides, News, & Discussion] kurianvinil:
how to know that the bootloader is unlocked or locked??

how to unlock it??
[Moto G4 Plus Guides, News, & Discussion] echo92:
I see that in the fastboot thread you've managed to flash the latest 93-14 update, so just for future reference:

1) You can check if your bootloader is unlocked by rebooting - if it's unlocked, you'll get a 5 sec 'your device cannot be trusted' warning before your device boots. You can however flash a custom logo.bin to hide this warning.

2)You could also check in fastboot: plug your device into your computer, reboot into bootloader, and in adb type 'fastboot getvar all' without the quotes. If the entry iswarrantyvoid is listed as yes, then at some point you unlocked your bootloader.

3)If you want to unlock it, you'll have to go to Motorola and request an unlock code: https://motorola-global-portal.custhelp.com/app/standalone/bootloader/unlock-your-device-a

Of course, that will void your warranty and it appears, from what members are writing, more service centres are now checking if your warranty is void before repairing (rather than looking at the receipts), your experience may vary however. I imagine service centres will check more as our devices reach the 1 year mark of warranty.
[Moto G4 Plus Guides, News, & Discussion] nykola5:
Does it fit into an XT1641 variant? Give some problem?
[Moto G4 Plus Guides, News, & Discussion] rajatgupta1998:
If that's a retail version you can try the firmware from here because the firmware on this xda thread is for XT1643 (Indian 32 GB variant) as per the title. The commands are the same but if incase you had upgraded to Nougat 7.0 don't try relocking the bootloader or flashing the bootloader and partition table -- SKIP them. :good:
[Moto G4 Plus Guides, News, & Discussion] kurianvinil:
thanks man, thanks a lot for the info.catch you later.
[Moto G4 Plus Guides, News, & Discussion] vinoth0t:
thanks brother .. baseband unkown problem fixed thanks a lot
[Moto G4 Plus Guides, News, & Discussion] vinoth0t:
any one share the latest N Stock rom link for XT1643 for indian variant pls guys
[Moto G4 Plus Guides, News, & Discussion] rajatgupta1998:
Build NPJ25.93-14 (Dec 1 Security)

https://xdaforums.com/moto-g4-plus/how-to/moto-g4-plus-xt1640-43-athene-npj25-93-t3549369

A search saves time ? ?
[Moto G4 Plus Guides, News, & Discussion] vinoth0t:
thanks brother
[Moto G4 Plus Guides, News, & Discussion] ironman38102:
Does this work with xt1642? Anybody can confirm?
[Moto G4 Plus Guides, News, & Discussion] echo92:
Seems to, used this ROM on my XT1642 to downgrade to Marshmallow without issue several times. Needed an unlocked boot loader but kept my EMEA baseband and IMEI, also has the 1st July 2016 security patch. Ive also been able to download and flash the nougat ota without problems. I'm in the UK though, and whilst I've seen this work for other EU devices, I don't know about other territories with the XT1642.
[Moto G4 Plus Guides, News, & Discussion] av_z:
HELP

After doing all those steps it still shows "Bootloader unlocked and can't be trusted" warning on bootup...helppp
[Moto G4 Plus Guides, News, & Discussion] rajatgupta1998:
Did you do the oem lock commands?

Better try locking it with Nougat 93-14
[Moto G4 Plus Guides, News, & Discussion] av_z:
Yea i did but didn't work. Now i updated to Nougat.

when i used 'fastboot oem lock' its showed singned rom required
[Moto G4 Plus Guides, News, & Discussion] brunopio:
How can I dump my stock rom to share here too? Without root or modifications, like instaling TWRP?
[Moto G4 Plus Guides, News, & Discussion] echo92:
I'm not sure how to get a fully stock ROM off a device without root or modifications. The stock ROMs posted on XDA, for our devices, generally are from Motorola ('acquired' via various means), and appear to be cryptographically signed by Motorola, so they're flashable with unlocked or locked bootloaders and with a stock recovery.

Without the cryptographic signature, I don't think a stock recovery will accept the flash file (https://source.android.com/devices/tech/ota/sign_builds for more info). As far as I know, we don't have access to the private keys used to sign the builds, so any stock ROMs are likely to be from Motorola and are unmodified (else the signatures would be different to that expected, and thus not flashable).

Besides, it looks like for Nougat v7.0, Motorola appears to have unified the ROMs to NPJ25.93-14 and above, which is much cleaner than all the MM ROMs floating around...
[Moto G4 Plus Guides, News, & Discussion] Thisguy129:
Why would anyone relock bootloader wtf is wrong with you guys.
[Moto G4 Plus Guides, News, & Discussion] rajatgupta1998:
Because they either want to sell it or maybe take it to the Moto Care? Sometimes this helps perhaps..
[Moto G4 Plus Guides, News, & Discussion] Thisguy129:
I give up no it doesn't make it Better to sell unless your hiding modding it which is wrong
[Moto G4 Plus Guides, News, & Discussion] amitbhatt1:
Can I flash this rom in xt-1643 running Android nougat?
[Moto G4 Plus Guides, News, & Discussion] Tavneeet:
Plz help!!!

I have flashed moto g4 stock rom on my moto g4 plus nd now my fone is not ahowing network nd imei nmbr.. Nd when I'm trying to flash stock moto g4 plus rom itz showing error in fastboot.. (bootloader slot count not found) I'm on locked bootloader nd itz not rooted.. Wt to do.. Plz help!!
[Moto G4 Plus Guides, News, & Discussion] echo92:
I've seen that bootloader slot count error before whilst flashing, and have flashed okay in spite of it, so I'd suggest not to worry about it.

If your device was never unlocked (and you are the original owner), perhaps the best thing is taking the device to a service centre to get it repaired under warranty. Back up your data to your computer. We do have a possible way to fix this but as far as I understand it, requires rooting your device and repairing​ the hw partition https://xdaforums.com/showpost.php?p=72340548&postcount=98
[Moto G4 Plus Guides, News, & Discussion] vij@y:
Unable to flash successfully. Need help its URgent

I tried these steps but it gives error saying

(bootloader) Security version downgrade

(bootloader) Image boot failed validation

(bootloader) Preflash validation failed

FAILED (remote failure)

finished. total time: 0.727s

PLease help me
[Moto G4 Plus Guides, News, & Discussion] echo92:
What are you trying to do, downgrade your system? If so, you need to unlock your bootloader before flashing this Marshmallow ROM: https://xdaforums.com/showpost.php?p=67031801&postcount=2

Also, if you're downgrading from Nougat, in addition do not flash the GPT or bootloader partitions. No point with the OEM locking commands too; the script should look like this for downgrading:

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 system system.img_sparsechunk.5
fastboot flash system system.img_sparsechunk.6
fastboot flash system system.img_sparsechunk.7
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 (optional: will erase any customizations if ordered through motomaker)
fastboot erase clogo (optional: will erase the custom boot logo if ordered through motomaker)
fastboot reboot

If you're trying to re-lock your bootloader and you were on Nougat, you cannot use this ROM to re-lock your device, since the Nougat bootloader is newer than the one in this ROM anyway. For re-locking the bootloader, try flashing the latest Nougat stock ROM (March 2017 build) https://xdaforums.com/moto-g4-plus/how-to/stock-rom-npjs25-93-14-4-march-1-t3608138
[Moto G4 Plus Guides, News, & Discussion] vij@y:
Actually my phone moto g4 plus (Android Noughat) doesn't boot ie it shows black screen on pressing power button. So there might be some firmware problem. Hence I tried to flash firmware with the steps given and it gave error.

Can you please help me in resolving this issue.

I am not downgrading for sure.
[Moto G4 Plus Guides, News, & Discussion] echo92:
This firmware (MPJ24.139-63) is v6.0.1 - Marshmallow - so if you're trying to flash this, you'll be downgrading your device. Those errors are normal if you're attempting to flash an OS older than the build you currently have on a locked bootloader. If you want a Nougat firmware, I've linked it above: https://xdaforums.com/moto-g4-plus/how-to/stock-rom-npjs25-93-14-4-march-1-t3608138 This is March 2017, NPJS25.93-14.4, the latest firmware we currently have.

As you're able to access fastboot, perhaps a way to resolve this would be flashing the Nougat firmware (bear in mind this will wipe your device clean, including your data).

Before you do any flashing though, are you able to access your recovery? I wonder if we can wipe your Dalvik/cache or data to help you get your device to boot - though you'll lose your app data, your photos and other files on your internal storage may be rescue able.
[Moto G4 Plus Guides, News, & Discussion] vij@y:
Yes, I can access recovery. Tried flashing noughat firmware ..still stuck with black screen (unable to boot).
[Moto G4 Plus Guides, News, & Discussion] echo92:
How far did you get with flashing the Nougat firmware?

In the recovery, what happens if you wipe your cache/dalvik and reboot? If that doesn't work, what happens with a factory reset?

If those steps don't work, and you're unable to flash the Nougat firmware, perhaps it's worth taking your device to a service centre for repair (it's still under warranty?)
[Moto G4 Plus Guides, News, & Discussion] tsotneforester:
I have been trying relocking bootloader and flashing stock firmware on my Moto g4 plus for several days but with no success.

I have unlocked bootloader, twrp 3.0.2 and Omni rom 7.1.2, before I follow all above mentioned instructions (https://xdaforums.com/mot...igned-t3460695) should I wipe everything with twrp? Or should I flash 6.0 based custom rom and than flash stock mm rom? Please give me some short clue, until I just throw this phone out from the window! thanks
[Moto G4 Plus Guides, News, & Discussion] echo92:
Have you updated your device with the Nougat stock firmware at any point? If you have, your bootloader version should be B1.03 or B1.05.

If so, you won't be able to re-lock your bootloader with this Marshmallow ROM, as your bootloader would be newer than the one included in this stock ROM. You may wish to use the latest stock ROM we have to re-lock your device. https://xdaforums.com/moto-g4-plus/how-to/stock-rom-npjs25-93-14-4-march-1-t3608138
[Moto G4 Plus Guides, News, & Discussion] tsotneforester:
Yes, for several month I did not do anything xdash on the phone, so I had lock Boot with 7.0.. Somehow I managed to flash stock 6.0 now but without fastboot OEM lock commands. You was right, even with own lock command boot was not relocked because I flashed old 6.0 stock. Just to be sure, can I find out version of my loot loader?

As I am on stock 6.0, I will get all the updates, so I will be on stock 7.0 and than I should try locking boot with stock 7.0. Did I get it right?

Version: 0.5

Version boot loader: ...B0.0E(*)
[Moto G4 Plus Guides, News, & Discussion] echo92:
You can check what bootloader version you have by booting to the bootloader screen - as you're on stock, power off your device, then once powered off, hold both the power button and volume down keys to boot to bootloader. I believe B1.03 was from the Nougat, Dec 2016 update and B1.05 is from the Nougat, March 2017 update.

If you were on OmniROM, your bootloader would be unlocked anyway, so you'd been able to flash 6.0.1 without relocking (and the bootloader would prevent re-locking with this ROM). If it's the bootloader warning that's the issue, you can flash a logo.bin to mask it, instead of re-locking (https://xdaforums.com/moto-g4-plus/themes/customized-logo-t3451349 https://xdaforums.com/moto-g4-plus/themes/bootlogo-dev-edition-black-n-removed-t3609835 https://xdaforums.com/moto-g4-plus/themes/splash-screen-stark-sigil-game-thrones-t3562019 for options)

Now you're on v6.0.1, you should be able to receive and install OTA updates. You could update and then lock as you described, though you'd be having several reboots to flash OTA updates (from v6.0.1, to v7.0 Dec 2016 update, to v7.0 March 2017 update). Alternatively, you can directly update to the March 2017 update and lock your bootloader in one go by flashing the fastboot ROM that I linked previously. https://xdaforums.com/moto-g4-plus/how-to/stock-rom-npjs25-93-14-4-march-1-t3608138

Depending on your bootloader, you'd likely have to use this or the Dec 2016 ROM to re-lock your bootloader anyway, since only stock ROMS of the same build or newer than previously flashed on your device appear to re-lock.
[Moto G4 Plus Guides, News, & Discussion] tsotneforester:
One stupid question here? If I choose longer way and choose otas with several update, I get on march 7.0, than can I flash only OEM lock commands to overcome possible incompatibility problems?

The main reason I try to relock is a warranty. It will be void after relocking, I know. Phone has same ghost touches and it reboots very often, incoming calls, video playing. It has something to to with motherboard or battery. I got 2 month of warranty left. I want to get there without bootloader unlocked massage. If am not successful, I just flash the logo.bin

Thanks
[Moto G4 Plus Guides, News, & Discussion] echo92:
In theory, flashing the OTAs and then relocking with the OEM lock commands should work, since it should be the same as simply flashing the the March 2017 fastboot ROM. Flashing the March 2017 fastboot ROM is faster and has less chance of things going wrong, since there are fewer steps to flash (you re-lock and update in one go). You may have to re-flash the March 2017 fastboot ROM to re-lock if a signed file is required anyway. I'm not sure what incompatibility problems you're referring to since these stock ROMs should be the same firmware that Motorola has released, and these firmwares won't boot/flash without the correct cryptographic signatures from Motorola as I understand things.

Re-locking your bootloader should clear the bootloader unlocked warning. However, be aware that some service centres may check your IMEI and warranty status with Motorola, and thus may require payment. Other service centres may not - I imagine it's up to their discretion, what the fault is, and how thorough a particular centre chooses to be. There have been reports of service centres simply repairing the device and others requesting payment, your experience may vary.
[Moto G4 Plus Guides, News, & Discussion] tsotneforester:
guys, I managed it! the only and single problem was thay I had NJ2593-14-4 and I was trying to relock bootloader with flashing NJ2593-14, as soon as I flashed lates 14-4 stock NJ, everything went ok! thanks
[Moto G4 Plus Guides, News, & Discussion] brostar2017:
What the latest software number?

NPN 25.137-15 is my current ota Android 7 update
[Moto G4 Plus Guides, News, & Discussion] echo92:
If you're running NPN firmware, you might want to visit the G5 Plus forums instead :) looks like it's NPN25.137-67 is the latest build (not sure if it's just for Indian devices or can be flashed on other devices) https://xdaforums.com/g5-plus/how-to/npn25-137-33-stock-firmware-t3577081
[Moto G4 Plus Guides, News, & Discussion] brostar2017:
Thank you for that so sorry didn't realise I was still in the old handsets forum.
[Moto G4 Plus Guides, News, & Discussion] vij@y:
I get an error

target reported max download size of 536870912 bytes

error: cannot load 'system.img_sparsechunk.0'

while flashing the noughat firmware.
[Moto G4 Plus Guides, News, & Discussion] echo92:
Just to check, you're using the v1.4.2 adb tool? https://www.androidfilehost.com/?fid=745425885120698566 and have the Motorola drivers installed (for Windows: http://www.devfiles.co/download/5eExXq3a/MotorolaDeviceManager_2.5.4.exe)?

If so, try flashing again. Also, you may wish to re-download the Nougat firmware to check it's all okay.
[Moto G4 Plus Guides, News, & Discussion] tsotneforester:
listen, can I unlock bootloader again after relocking it?
[Moto G4 Plus Guides, News, & Discussion] echo92:
You should be able to (using the unlock key you were given the first time you unlocked your device), however, unlocking your device again will wipe your device as it did the first time round.

Also, don't re-lock your device without a stock recovery, stock system and stock kernel, else your device may fail to boot.
[Moto G4 Plus Guides, News, & Discussion] prakharayush31:
Fastboot mode not accessible. Help me out please...

I have completely format my phone accidentally with twrp and all things are gone. In twrp it's showing install os, thus no sign of fastboot mode.

Please help how do I flash stock rom?
[Moto G4 Plus Guides, News, & Discussion] echo92:
Fastboot mode - also known as the bootloader - should still be there, normally it's not touched by TWRP.

Are you able to reboot to bootloader? Or if not, can you turn off your device, then hold down the power and volume down keys together? That should let you boot into fastboot mode and then you may be able to plug your device into your computer.

Then, you should be able to detect your device on your computer (in the adb terminal, type 'fastboot devices' without quotes - should show your device serial number).

Afterwards, you should be able to flash a fastboot stock ROM - bear in mind if you were on Nougat, you may wish to flash the latest Nougat stock fastboot ROM (https://xdaforums.com/moto-g4-plus/how-to/stock-rom-npjs25-93-14-4-march-1-t3608138). If you were on Nougat and want to flash this Marshmallow ROM (MPJ24.139-63), then you may wish to follow the flashing commands in this post: https://xdaforums.com/showpost.php?p=72607155&postcount=267
[Moto G4 Plus Guides, News, & Discussion] prakharayush31:
Yes fastboot mode is accessible, I pressed the buttons for 2min and now it booted up in fastboot .. ??
[Moto G4 Plus Guides, News, & Discussion] ksamm97:
Not locking the bootloader

Tried every adb drivers but nothing is happening. Did not locking up the bootloader.

Even tried mfastboot v2.

Help :crying:

Flashed stocked rom 10-12 times in hope of locking bootloader but everytime comes with bootloader unlocked warning :rolleyes:

Posting the errors and files I flashed.
[Moto G4 Plus Guides, News, & Discussion] echo92:
The security downgrade errors suggests you're flashing this Marshmallow ROM onto a device that had been updated to Nougat. If so, you need a Nougat stock ROM, you can only lock with a ROM of the same build or newer than what you had previously. Here's the newest fastboot stock Nougat ROM for Moto G4: https://xdaforums.com/moto-g4-plus/how-to/stock-rom-npjs25-93-14-4-march-1-t3608138

If you're trying to relock, also check you've got OEM unlocking toggled in settings>developers options before attempting to relock. Also, relocking may not necessarily guarantee a repair under warranty, depends on the nature of the repair and if the repair centre looks at your IMEI.
[Moto G4 Plus Guides, News, & Discussion] brostar2017:
The only and package that seems to work for windows is abd minimal package found on XDA not sure of Linux.
[Moto G4 Plus Guides, News, & Discussion] rajatgupta1998:
for linux you can try

sudo apt install android-tools-fastboot

sudo apt install android-tools-adb

OR

yaourt -S android-tools --noconfirm