yashsingh1/xdaforums huggingface dataset:
[Moto G4 Plus Guides, News, & Discussion] raptor170:
Since I've seen a few instances of loss of imei, I can't for the life of me figure out how to back it up, usually in twrp I have the option to backup efs, currently on mm and looking to upgrade to latest stock firmware just to have nougat modem :/ want to flash custom Roms etc. Or have you xt1641 guys had good luck while using this fastboot method to get to nougat, thanks

Edit: also noticed from reading on earlier that this fastboot ROM baseband is Athene_emea_dsds_cust. Whereas my current baseband is athene_latam_cust which is single sim, will this still be compatible? Thanks!

Also, from my research should you be using mfastboot instead of fastboot especially for the sparsechunks?

Ya paranoid as hell lol, once updated I'll be flashing like crazy. Also anyone try this method for backing up imei? Not sure if only original moto g or if it'll work on all variants https://xdaforums.com/moto-g/help/imp-imei-backup-scripts-moto-g-eall-t3174569
[Moto G4 Plus Guides, News, & Discussion] dayask:
I got this ota what should I do
[Moto G4 Plus Guides, News, & Discussion] dayask:
Needs to flash via fastboot or download from ota notification
[Moto G4 Plus Guides, News, & Discussion] echo92:
Probably the easiest way is to download via OTA notification, then reboot to stock recovery and flash. Provided no changes have been made to your system/kernel, should be okay to flash.

Unless you've updated to this OTA in the past, this might be your last chance to lock your bootloader using this fastboot 93-14 ROM for the time being, since it looks like this patch updates your bootloader. Thus, once you've updated, appears that relocking won't work unless we get a newer fastboot ROM.
[Moto G4 Plus Guides, News, & Discussion] dayask:
Thanks Sir for your time follow your instructions and it's worked thank you
[Moto G4 Plus Guides, News, & Discussion] raptor170:
If I get the gull I might just go and fast boot this, guessing no other xt1641 Canadian guys here to give some input
[Moto G4 Plus Guides, News, & Discussion] peladoro:
Bud I'm going to try now....I wanted to return to stock recovery to get official ota 14.4 from Rogers...have backup of my official stock rom but of course with TWRP recovery. Been using the debloated revivor ROM without issue
[Moto G4 Plus Guides, News, & Discussion] peladoro:
Edit: all good easy...mfastbooted no issues
[Moto G4 Plus Guides, News, & Discussion] raptor170:
This is really comforting to hear!! Awesome dude!, and that you used mfastboot for all the commands, I'm guessing you didn't relock the bootloader also, and just ran all the commands in the OP, but with mfastboot instead of fastboot?
[Moto G4 Plus Guides, News, & Discussion] peladoro:
No didn't relock...as in op just followed each step commands skipped the lock commands and the two that were optional voilà stock. Took ota to 14.4 then reflashed TWRP backuped done[emoji1]
[Moto G4 Plus Guides, News, & Discussion] ivan290:
Guys is just me or there is a lot of lag when you flash a nougat firmware from PC, than updating directly by OTA (from marshmallow). Definitely the phone is a lot smoother when i update by OTA, but i want to know if it is just me, or if there is a solution??

Sorry for my english
[Moto G4 Plus Guides, News, & Discussion] rajatgupta1998:
Maybe because the fastboot method does a complete wipe (unless you manually skipped "fastboot erase ***") ?
[Moto G4 Plus Guides, News, & Discussion] ivan290:
I know that, but it doesn't explain why it is sooooo laggy when you flash nougat from pc (i insist, maybe i'm the only one with this problem,thats why i ask), and smooth like marshmallow, when you update by OTA.
[Moto G4 Plus Guides, News, & Discussion] flroots:
I've rooted my brand new moto G4 Plus (xt1644). I want to be sure to understand one thing. If and when I choose to unroot in order to receive future OTA's do I need to select only xt1644 ROMs or will other variants such as xt 1643 work as well?

I made a TWRP backup before installing ElementalX so I should be OK restoring kernel. I also flashed a custom logo. How would I go about restoring logo to stock? TWRP doesn't seem to offer logo backup or restore.
[Moto G4 Plus Guides, News, & Discussion] echo92:
If you're unrooting completely, normally the easiest way is to follow the root manager's unrooting method (e.g. for SuperSU, the unroot option is in the SuperSU app). If you're looking to revert completely back to stock (e.g. for OTA), for Nougat we appear to all have the same stock ROM (i.e. NPJ25.93-14 - this ROM), so no need to worry about different variants. If you're looking for Marshmallow ROMs however, then you will have to flash XT1644 builds, it seems attempts to flash the wrong firmware has resulted, in quite a few cases, of losing IMEI or SIM status, and once that has happened, I don't recall successful methods to restore them short of a motherboard replacement. Probably why Motorola unified the Nougat builds...

As for your logo.bin, you can download this fastboot ROM (EDIT or this latest stock ROM, NPJS25.93-14.4 https://xdaforums.com/moto-g4-plus/how-to/stock-rom-npjs25-93-14-4-march-1-t3608138) and extract the logo.bin file, or find a Nougat logo.bin file , then flash in the same way as your custom logo:

https://xdaforums.com/moto-g4-plus/themes/customized-logo-t3451349

Of course, be aware that as soon as you flash the stock logo.bin, you may see the bootloader warning again until you can re-lock your device (or once you've updated, flash TWRP and a custom logo.bin).

Though it's quite a hefty download for just one file, it's always useful to have this around just in case you need to re-flash stock. You can also flash the recovery.img from the updated stock ROM to replace TWRP (so you've unrooted, then flashed the stock kernel in TWRP from your back up - and then wiped cache/Dalvik before booting, then flashed the stock recovery in TWRP). That way, you should have a stock recovery, stock kernel and be unrooted for OTA updates, without having to flash the fastboot ROM in its entirety.

Should that not work, you may need to re-flash the stock ROM to unify your system. Though I've not tried this, others have re-flashed stock with these commands, kept their data and appear to have a stable system. Use carefully and your experience may vary. Credit to toppits for this.

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

Edits to reflect that a updated stock fastboot ROM has just appeared - thanks tywinlannister7 :)

2nd edit - thanks for the clarification toppits :D
[Moto G4 Plus Guides, News, & Discussion] toppits:
Thx for crediting me [MENTION=7970352]echo92[/MENTION], though I followed this guide, well more or less.

Just a little note: I didn't flash "adspso.bin" and "oem.img". Logo, boot, recovery and all the sparsechunk should be enough.
[Moto G4 Plus Guides, News, & Discussion] flroots:
Thanks :) Does the overall procedure including the part in parenthesis look like this:

uninstall SuperSU from SuperSU (unroots)

flash stock logo.img using Fastboot (restores stock logo)

restore boot.img from TWRP backup (restores kernel as modified by SuperSU and ElementalX)

wipe cache/Dalvik from TWRP

reboot

flash stock recovery.img from TWRP (restore recovery modified by TWRP)​

If so, I don't understand how one restores recovery using TWRP? I would have thought one would use Fastboot using the recovery.img from stock ROM like with logo.img?
[Moto G4 Plus Guides, News, & Discussion] echo92:
That looks to be the procedure to unroot and revert back to stock. Just to expand on a few procedures:

Uninstall SuperSU from SuperSU (unroots) - done whilst your device is on, via the SuperSU app settings > Full unroot. Might reboot your device automatically.

Flash stock logo.img using Fastboot (restores stock logo) - subsequent boots will have that bootloader warning (as you've discovered)

Restore boot.img from TWRP backup (restores kernel as modified by SuperSU and ElementalX)

wipe cache/Dalvik from TWRP

reboot - Verify your device is still functioning

flash stock recovery.img from TWRP (restore recovery modified by TWRP)

With regards to getting your stock recovery, you certainly can use the fastboot method:

From the stock ROM, find and copy your recovery.img file to your adb folder.

Reboot to bootloader.

Flash recovery in adb using 'fastboot flash recovery recovery.img'.

Reboot to recovery partition, verify you've booted into the stock recovery.

If so, reboot to system.

I've not tried this with a stock recovery (only with updating TWRP this way), so I'm not sure if this will work (so apologies for mis-speaking), it may be possible to flash your stock recovery via TWRP. The steps would be, if it does work:

Copy the stock recovery.img to your device.

Reboot to TWRP.

Under 'Install', select 'Install image'

Navigate to your stock recovery image.

Specify the target image as 'recovery'.

Flash.

Reboot into recovery, should now be stock recovery.

Flashing via fastboot seems to be the preferred method for flashing your recovery however (probably less things to go wrong), same as how you flashed TWRP in the first place :)
[Moto G4 Plus Guides, News, & Discussion] flroots:
Thanks a lot for reviewing and expanding on my procedure :)

A quick question. Since it's nice to flash a custom logo, why doesn't TWRP have the ability of backing up the stock logo in advance? Is it just something that was never deemed worthwhile? I've read that different variants of TWRP have the ability to back up more partitions. At the moment I'm using twrp-3.1.0-1-athene-oadam11.img.
[Moto G4 Plus Guides, News, & Discussion] raptor170:
Mfastboot worked perfect on xt1641, thanks all that helped!!
[Moto G4 Plus Guides, News, & Discussion] Nitink200:
If I install this one and keep my bootloader unlocked will I able to install ota update manually? Because currently I am on custom invicta os .
[Moto G4 Plus Guides, News, & Discussion] echo92:
Yes - though bear in mind that flashing this fastboot ROM will wipe Invicta, TWRP and your data from your device. Back up accordingly. OTAs generally will only flash if you have a stock recovery, kernel and system - bootloader status does not appear to matter.

If you don't wish to wait for the OTA - you may wish to flash with this fastboot ROM which already has the March 2017 security OTA merged with it: https://xdaforums.com/moto-g4-plus/how-to/stock-rom-npjs25-93-14-4-march-1-t3608138
[Moto G4 Plus Guides, News, & Discussion] Nitink200:
Thanks, actually I was a little bit confused.
[Moto G4 Plus Guides, News, & Discussion] Tech 4 9:
Hello all. I need some guidance here. I'm on Xt1644. I think I blew it. I went from Resurrection Remix 6.0 to RR N before noticing I had to flash stock N first. I've since done that using the fastboot N ROM but I don't have VoLTE and no toggle for it. I can go into *#*#info#*#* and toggle volte on, reboot phone and then I'll have toggle for volte under cell settings but upon attempt at making call the Android phone app crashes interrupting the call. My baseband is M8952_70030.25.03.62R ATHENE_RETUSA_CUST.

Any help appreciated.

Should I try this?

Just do them once:<br />

fastboot -w<br />

fastboot erase modemst1<br />

fastboot erase modemst2<br />

fastboot reboot-bootloader<br />

And then flash the full stock ROM using the oem flash bat file. Should work fine.<br />
[Moto G4 Plus Guides, News, & Discussion] rajatgupta1998:
Creating stock ROM for TWRP isn't much of a problem. Either you can create the backups of system and boot or create flashable zips from the system images. As mentioned by [MENTION=7970352]echo92[/MENTION] in a different thread, the OTAs sent by Moto will check each and every thing so the TWRP flashable ROM won't take updates. You might like to check the tools available at Chef Central . Osmosis' scripts are awesome.
[Moto G4 Plus Guides, News, & Discussion] Bunny Joel:
Sorry there was a problem saying gpt partition problem and invalid sign..
[Moto G4 Plus Guides, News, & Discussion] echo92:
Can you clarify what error you're getting (e.g. is it 'security version downgrade'?) and on what flash command are you getting this 'invalid sign'? Also, what are you trying to do with the ROM (are you attempting to relock your bootloader, or are you just reflashing your stock ROM)?

If you're downgrading ROMs in general or reflashing the same ROM, omit flashing the gpt partitions and bootloader - your device should block those commands, but ideally you'll want to omit:

fastboot flash partition gpt.bin
fastboot flash bootloader bootloader.img

Oh, and please don't quote the entire opening post, if you can - it can make it easy to miss your question (as well as take up a lot of space)!
[Moto G4 Plus Guides, News, & Discussion] Tech 4 9:
Could the .bat file be edited to flash XT1644_ATHENE_RETUS_MPJ24.139-48_cid50-subsidy-DEFAULT_regulatory-XT1644_CFC.xml.zip instead of the N so that I might downgrade back to M and then let stock OTA bump me up to N so I know phone is correct?

Sent from the NCC-1701-G4_RR_N_ElmntlX
[Moto G4 Plus Guides, News, & Discussion] echo92:
Should be okay, as the fastboot file structure appears to be the same. I'd suggest omitting the OEM lock commands and the gpt and boot loader commands too, since you're downgrading. Your script should look like this:

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

Also, just a thought, have you tested your SIM in another device, checking if you've got data and VOLTE or alternatively, borrowed a SIM with known working data/VoLTE to test in your device?
[Moto G4 Plus Guides, News, & Discussion] Tech 4 9:
Thank you for great response and the script. If you will indulge me, lets start here(if you might know):

Did flashing a custom N rom before properly updating to stock N to update radio/modem mess up the phone? Because other than the no VoLTE and no data during rom setup the phone seems to work great. If something was wrong with radio/modems wouldnt I know it by now? If the VoLTE thing is a carrier thing (vzw) then I'll flash this .bat as is to get to stock and take phone to Verizon and ask why I don't have VoLTE. I've just assumed that I might have messed phone up flashing N on MM radio/modem. Before this moto my sim was set up by a vzw employee at a store because I had to change from micro to nano which was for a HTC m8. Although I don't specifically remember seeing VoLTE on it I do know that not having data during call is a new thing. Is it possible sim is still set for m8..? When I log into my Verizon it's asks me if I want to register this device (but then I can't because I'm not 'account owner'.) I don't even know if thats related. Also, if it matters..I flashed this bat last night and on the stock N I didn't have volte either but I DID have way of using data for initial setup. I'll try sim in m8 again but I don't think I'll learn anything. Although I thing I once had data with calls on it I don't think I did last time sim was in it. Would I have to reinstall rom to find out or just pop sim in and see what happens?

Thanks again.

Sent from the NCC-1701-G4_RR_N_ElmntlX

---------- Post added at 11:34 AM ---------- Previous post was at 11:08 AM ----------

Ok. This is from the m8 with sim in it. No volte icon , no Toggle for it but I DO get it. I can use data whilst on a call but theres nothing saying anything about volte in settings. Resurrection remix N ROM.

So...I guess there is indeed a issue with my moto g4.
[Moto G4 Plus Guides, News, & Discussion] Tech 4 9:
Isn't this wrong?

I used this tool last night to freshen things up a bit and look around. I did what needed to do...then, to move on, I flashed shreps twrp. Whilst doing wipe to prepare for Resurrection remix flash I noticed the data partition was still formatted in f2fs. Having just come from stock involving two full wipes shouldn't that partition have been restored back to ext4 or whatever it was? I'm fairly sure f2fs isn't stock and I remember converting it mos ago. it seems to be surviving full wipes. I even "repaired" it in twrp and it's still f2fs. Isnt this wonky?

Sent from the NCC-1701-G4_RR_N
[Moto G4 Plus Guides, News, & Discussion] rajatgupta1998:
[MENTION=7538469]Bunny Joel[/MENTION] Next time please use an online portal like Hastebin to post such huge logs. And yes you can play Pokémon Go on the latest stock firmware. I have the same device.

Downgrading needs an unlocked bootloader and you need to skip the bootloader and partition flashing commands.
[Moto G4 Plus Guides, News, & Discussion] Tech 4 9:
Through all the reading, I see some stuff where the only reason people want to go back to mm is for OTA update so that the radio and fingerprint reader work properly. Well mine says I have the right basband and my fingerprint reader works awesome for the most part (I try to set four fingers on one setup so that might not be right) . Therefore is it safe to say my phone is OK?

Sent from the NCC-1701-G4_RR_N_ElmntlX
[Moto G4 Plus Guides, News, & Discussion] rajatgupta1998:
Taking OTAs on a dowgraded firmware isn't recommended though.
[Moto G4 Plus Guides, News, & Discussion] Tech 4 9:
I thought that was only way to ensure phone was 100% correct. (baseband, partitions)

If, under settings, my baseband is correct...and, other than no volte, the phone/rom work pretty darn good, do I have my answer already?...phones good so chase volte issue another direction?

The only reason I'm so stuck on this is I didn't know if did irreversible damage to modem/radio by flashing custom N before stock N. But, other than no volte and having to be on WiFi for initial rom setup...everything else is quite good.

Sent from the NCC-1701-G4_RR_N_ElmntlX
[Moto G4 Plus Guides, News, & Discussion] echo92:
That looks okay - on my device (XT1642), which I've just reflashed the NPJS25-93.14-4 update on, my system and cache partitions are still ext4, whereas my data is f2fs. This was the same with custom ROMs too (using the DiskInfo app to check). I don't know when the change was (perhaps flashing Nougat made f2fs mandatory?), presumably for faster speeds with f2fs. I don't know if attempting to change the file system will require a data wipe, but might just be unnecessary to change the file system.

As for your VoLTE issue, you most likely would have no issue with flashing custom N ROMs before stock ROMs - stock ROMs usually only have the correct permissions to flash to partitions such as the modem. Therefore, custom ROMs don't usually have to worry about including the necessary files (and thus shouldn't touch your modem partition).

Although OTAs aren't strictly recommended on downgraded firmware, provided the GPT and bootloader weren't touched with the downgrade, you may be okay with flashing the OTA (this is why though downgrading can be fraught with trouble, if the GPT and bootloader have been downgraded then a brick may occur). But, as your device is reading your fingerprints and you're getting radio signal, you probably don't have to worry about that.

I recall Moto G4 devices having issues with Verizon's VoLTE service ever since the device came out, so may be worth visiting a Verizon store to fix it. One success story seems to be calling up customer services and get a SIM tied to your IMEI. I imagine, if you needed a new SIM too, they could port your number over to the new SIM card. https://forums.lenovo.com/t5/Moto-G...n-Advanced-Calling-or-VoLTE/m-p/3389629#M3889

Hopefully it might also explain why your M8 works too with your SIM, as the SIM you have is linked to your M8 IMEI rather than your Moto G4!
[Moto G4 Plus Guides, News, & Discussion] Tech 4 9:
Thank you. The reply itself is appreciated but with the insight provided you knocked it out of the park.

I'll take phone to Vzw sometime if the no volte bugs me enough to warrant the hassle of it. I didn't care as much about actually having the volte as just making sure the lack of it wasn't a symptom that my phone was wonky.

Again, thank you for the excellent answer.

Sent from the NCC-1701-G4_RR_N_ElmntlX
[Moto G4 Plus Guides, News, & Discussion] russrn16:
Why does it say "preflash validation failed" everytime I flashed rom. I updated my phone to the March security update. That's why it probably won't let me.
[Moto G4 Plus Guides, News, & Discussion] echo92:
If you've updated to the March 2017 security update, your bootloader - and possibly your GPT too - is newer than this build (this build is Dec 2016). You can try flashing the March 2017 fastboot ROM https://xdaforums.com/moto-g4-plus/how-to/stock-rom-npjs25-93-14-4-march-1-t3608138 instead.

If you're still looking to reflash the December 2016 build, or in future wish to downgrade, you may be able to bypass that warning by omitting the GPT and bootloader flash commands:

fastboot flash partition gpt.bin
fastboot flash bootloader bootloader.img

Also, be aware that re-flashing an older build than that is currently on your device or previously on your device requires an unlocked bootloader - you'll likely get that warning also if you try to downgrade your system on a device with a locked bootloader.
[Moto G4 Plus Guides, News, & Discussion] force73:
Thank you for this. You saved me some time with your tut. Now I am able to sell the phone in original condition. :)
[Moto G4 Plus Guides, News, & Discussion] russrn16:
It worked

Thank you, it worked. But every time I turn on the device. Recovery appears or if I wanted to charge the phone turned off, recovery also appears. Will reflashing it again fix it?
[Moto G4 Plus Guides, News, & Discussion] amitbhatt1:
I am on stock N with 1march 2017 security patch. Suddenly volte has disappeared from the status bar and all volte settings are enable. So if i will flash this rom will i be able to use volte services... Or can you tell me other way to fix this?
[Moto G4 Plus Guides, News, & Discussion] rajatgupta1998:
Try the latest firmware, https://xdaforums.com/moto-g4-plus/how-to/stock-rom-npjs25-93-14-4-march-1-t3608138 .
[Moto G4 Plus Guides, News, & Discussion] Smit01:
Hello

Im currently using ResurrectionRemix v5.8.3 20170415 .

I want to go back to stock and don't wanna mess up things so want to confirm all before trying since i am a noob at this, should i follow the guild available here and files available here or do i need to change some like any for security patch or something? Please clarify to me . Thank you.
[Moto G4 Plus Guides, News, & Discussion] Smit01:
I checked my bootloader and the version was B1:00 , so i don't need to follow the other guilde right? I should use this guide right? And what to do if i get stuck by an error in fastboot while flashing these files ? Sorry for taking more of your time. Thank you.