yashsingh1/xdaforums huggingface dataset:
[Moto G4 Plus Questions & Answers] Soureen:
Yes I did select all the ones you mentioned.

My Baseband Version is : M8952_70004.04.03.32R DFLT_FSG

About the flashing part, I used the app's restore button selected the above mentioned ones and just flashed, didn't do anything else
[Moto G4 Plus Questions & Answers] Soureen:
Any developments guys?
[Moto G4 Plus Questions & Answers] m.swastik:
Have you tried updating to official Nougat?
[Moto G4 Plus Questions & Answers] Soureen:
Read OP !

I'm rooted with TWRP so OTA won't flash at this moment.

Give me the full size ROM if you might !
[Moto G4 Plus Questions & Answers] m.swastik:
I meant flashing stock MM firmware first and then official OTA.

Anyway, found link of N firmware flashable through fastboot.

https://xdaforums.com/moto-g4-plus/help/stock-firmware-t3530377

Guys in the forum are saying it is working on Moto G4 Plus.
[Moto G4 Plus Questions & Answers] LoneWolf x_o':
Did any one try this? Even my phone's like an ipod now that link confirms you can relock you're bootloader ,hopefully it flashes succesfully and sim works again! My phone's not with me now if you guys did try please keep us updated :)
[Moto G4 Plus Questions & Answers] Soureen:
Flashed the Nougat Official over MM throught the "flashall" file theres no change except the Firmware version The problem is still there :crying::crying: .

If there are any other ways to flash the file do let me know i have no problem trying !
[Moto G4 Plus Questions & Answers] LoneWolf x_o':
Try

Try flashing proper mm via fastboot (lot of confusions among the correct firmare) then flash n package via fastboot or install mm and directly try ota update . i have the same problem as you so I'll be trying the same thing on mine. Please let me know what happens
[Moto G4 Plus Questions & Answers] Kickass1415:
i had no problems whatsoever when i downgraded my os and no problems when i upgraded it again. We just have to make sure that the bootloader is unlocked
[Moto G4 Plus Questions & Answers] m.swastik:
Looking at the contents of "hwflash", I have high hopes that this file has solution to our problem. From the look of it this file detects phone hardware and flashes relevent files into the system. Have you tried flashing it?
[Moto G4 Plus Questions & Answers] LoneWolf x_o':
Hi i tried flashing this over stock mm didn't change a thing

Should i follow any specific proceedure while doing this. This is my primary phone so if any one has any solutions please help us, it's not only me there are many ppl who are facing the same problem??
[Moto G4 Plus Questions & Answers] m.swastik:
I will suggest first flashing flashall file and then this file. If it doesn't work even then it is very disappointing.
[Moto G4 Plus Questions & Answers] LoneWolf x_o':
Thanks will try ,also flash all nougat or mm?
[Moto G4 Plus Questions & Answers] Soureen:
Double clicking the "hwflash" doesnt flash anything :eek: it just runs a script on the cmd window and then closes on its own.

I wonder whats the proper way !

Have you tried flashing the N Rom ?
[Moto G4 Plus Questions & Answers] m.swastik:
Guys for whom everything is working do you have hw_config.xml file in your phone, try searching through ES Explorer,if found can you share it?
[Moto G4 Plus Questions & Answers] echo92:
Just to confirm, did you try flashing this stock MM ROM when you were testing ROMs? https://xdaforums.com/moto-g4-plus/how-to/moto-g4-plus-xt1643-updated-signed-t3460695?

I'm wondering if it's worth downloading this ROM to internal storage, going into TWRP recovery, wiping system, data, Dalvik and cache (so wiping everything except internal storage), then rebooting to bootloader and flashing this MM ROM via adb/fastboot. Have you tried this or a similar procedure?
[Moto G4 Plus Questions & Answers] Soureen:
I have wiped all partitions through TWRP and then flashed ROM via fastboot but still nothing happened :(
[Moto G4 Plus Questions & Answers] lloco73:
I think also that hw_flash.bat might be the solution for your problems but you'll need to update to Nougat.

Try this

Put phone in bootloader mode

open a cmd window and navigate to where you have extracted the zip and type flashall.bat. Note: Flashall script includes hwflash.bat on it, so it will flash it.

Wait till it boots up.

Check if it's all ok.
[Moto G4 Plus Questions & Answers] Soureen:
I have flashed the ROM via fastboot using the "flashall.bat" files a couple of times at this point already and theres no change except that the Android version has changed from MM to N. The problem is still there
[Moto G4 Plus Questions & Answers] m.swastik:
Can you share output of below codes when device is on fastboot mode

fastboot oem config product
fastboot oem hw

In my case both values are empty.
[Moto G4 Plus Questions & Answers] lloco73:
C:\Users\Carlos>fastboot oem config product
(bootloader) slot-count: not found
(bootloader) slot-suffixes: not found
(bootloader) slot-suffixes: not found
...
(bootloader) <UTAG name="product" protected="false">
(bootloader) <value>
(bootloader) </value>
(bootloader) <description>
(bootloader) Product name override
(bootloader) (treating one product as if it is another)
(bootloader) </description>
(bootloader) </UTAG>

OKAY [ 0.052s]
finished. total time: 0.054s

C:\Users\Carlos>fastboot oem hw
(bootloader) slot-count: not found
(bootloader) slot-suffixes: not found
(bootloader) slot-suffixes: not found
...
(bootloader) .version: 2.2
(bootloader) storage/.system: ro.hw.
(bootloader) storage/.range: 16GB,32GB,64GB
(bootloader) storage/.auto: key=hwprobe;index=__storage
(bootloader) storage: 16GB
(bootloader) ram/.system: ro.hw.
(bootloader) ram/.range: 2GB,3GB,4GB
(bootloader) ram/.auto: key=hwprobe;index=__ram
(bootloader) ram: 2GB
(bootloader) radio/.range: US,LATAM,EMEA,China,Brazil,India
(bootloader) radio/.cmdline: androidboot.
(bootloader) radio/.auto: key=hwid;index=2;map=1:US,2:China,3:EMEA,4
(bootloader) :India,5:LATAM,6:Brazil,7:VZW,8:Brazil,9:LATAM
(bootloader) radio: EMEA
(bootloader) nfc/.system: ro.hw.
(bootloader) nfc/.range: true,false
(bootloader) nfc/.chosen: mmi,
(bootloader) nfc: false
(bootloader) imager/.system: ro.hw.
(bootloader) imager/.range: 13MP,16MP
(bootloader) imager/.chosen: mmi,
(bootloader) imager/.auto: key=hwid;index=5;separator=_;map=13mp:13M
(bootloader) P,16mp:16MP,power:13MP
(bootloader) imager: 16MP
(bootloader) frontcolor/.system: ro.hw.
(bootloader) frontcolor/.range: white,black,other
(bootloader) frontcolor/.auto: uspace=config;name=build_vars
(bootloader) frontcolor: black
(bootloader) fps/.system: ro.hw.
(bootloader) fps/.range: true,false
(bootloader) fps/.chosen: mmi,
(bootloader) fps/.auto: key=hwid;index=5;separator=_;map=13mp:false,
(bootloader) 16mp:true,power:false
(bootloader) fps: true
(bootloader) dualsim/.system: ro.hw.
(bootloader) dualsim/.range: true,false
(bootloader) dualsim/.cmdline: androidboot.
(bootloader) dualsim: true
(bootloader) dtv/.system: ro.hw.
(bootloader) dtv/.range: true,false
(bootloader) dtv/.chosen: mmi,
(bootloader) dtv/.auto: key=hwid;index=2;map=1:false,2:false,3:false
(bootloader) ,4:false,5:false,6:false,7:false,8:true,9:true
(bootloader) dtv: false
(bootloader) .attributes: .range,.cmdline,.chosen,.system
(bootloader) .features: version,radio,ram,storage,imager,fps,dualsim
(bootloader) ,dtv,nfc
(bootloader) version: 1.4
(bootloader) ram/.cmdline: androidboot.
(bootloader) storage/.cmdline: androidboot.
(bootloader) .reboot: 0
OKAY [ 0.242s]
finished. total time: 0.246s
[Moto G4 Plus Questions & Answers] iamarijitsingha:
Does your problem solved?

Does Motorola service center solved the problem?

I guess It's not covered under warranty as you unlocked and then relocked the bootloader? If so how much they charged?
[Moto G4 Plus Questions & Answers] m.swastik:
I think this is the problem our hw properties are not setup, I tried setting few hw properties through setprop and then flashing ROM but it doesn't help. And When I try to unlock hw to modify it I get error

fastboot oem hw unlock

I get

Do you have hw_config.xml file in /data/local/tmp and /pds/factory?
[Moto G4 Plus Questions & Answers] iamarijitsingha:
Same Issue

I have the same issue!

What do you people think flashing right firmware would solve the problem or I have to change the motherboard.

Planning to visit SC soon.

Thanks to all in advance.
[Moto G4 Plus Questions & Answers] rooban90:
I think the script fails and so cmd window closes on its own, is it closing immediately ?

I am facing the issue in this step with error as
[Moto G4 Plus Questions & Answers] m.swastik:
Posting link which may help in solving the problem https://xdaforums.com/moto-g/general/motorola-moto-g-partitions-explained-t3418644
[Moto G4 Plus Questions & Answers] Sunny020:
Any solutions guys to this issue :(

The very same happened to me as mentioned by OP [MENTION=5183396]Soureen[/MENTION]

Do tag me if you find any working solution . this is my primary phone and its of no use to me.
[Moto G4 Plus Questions & Answers] anhoxhrs:
everyone here,i had the same problem.I got my motherboard replaced for free.And yes my device was unlocked.So do as i say.First just concentrate on relocking ur bootloader.And if u get sucess then ota update to N.Then walk to the service centre and tell them after the ota network,fps,wifi stopped working.They will flash the stock firmware but they will also fail.Atlast they will conclude that the mother board needa to be replaced.Here comes the twist ,they nvr check that u asked for unlock code.They just see the bill and conclude its in warranty.So guys chill and walk to the sc.
[Moto G4 Plus Questions & Answers] LoneWolf x_o':
I'm giving up hopes dont know if anything can be done
[Moto G4 Plus Questions & Answers] iamarijitsingha:
I relocked the bootloader and went to service center, they checked the IMEI online for warranty and said warranty is void.

Bad luck for me!
[Moto G4 Plus Questions & Answers] GeeteshKhatavkar:
Which city bro ?
[Moto G4 Plus Questions & Answers] anhoxhrs:
Ahmedabad
[Moto G4 Plus Questions & Answers] Sunny020:
Few things need to ask you

1.They didn't even checked you warranty online ? bcuz it is required for them to claim warranty for ur device.

2.Any way to check warranty online by our own ? any site ?

3.any easy way to lock bootloader ?
[Moto G4 Plus Questions & Answers] anhoxhrs:
1.Nupe they didn't.They just saw the bill and concluded it's in warranty.

2.I don't know.

3.Well u can search the forum.
[Moto G4 Plus Questions & Answers] ____Mdd:
2- Sign-in to Motorola Website with same Email ID that you used to Unlock Bootloader, then go to My stuff ( best way, just Google "Motorola My Stuff" you will see first result ) check there..

There May be any other way to check warranty details for authorized centers that we don't know or not available for us... Just test your luck..

3- easier on MM, but if you updated to N then follow guide available in Guide/Discussion section...
[Moto G4 Plus Questions & Answers] Sunny020:
Assuming by your user id , u seem to be an Indian :)

But as per conversation with Moto customer care via online chat they confirmed me that for warranty claim on service center , they only require Invoice copy which shows purchase date and IMEI number on it.

BTW I found site to check warranty -

https://motorola-global-portal.custhelp.com/app/mcp/my_devices/p/30,6720,9687

Login via the same Email which you used for Motorola Id in your phone.

then add your device accordingly

and finally it will show warranty status.

If it shows error then submit your invoice copy here - https://motorola-global-portal.cust...,9687/reg/3479791/sn/35818707486847/#/service

it will show up hopefully within 7 working days.

If not then directly contact Moto care via chat and provide them IMEI number and they help you with warranty details
[Moto G4 Plus Questions & Answers] Sunny020:
[MENTION=5183396]Soureen[/MENTION]

Did You Got AnyWay Out This Problem ?

Or Anyone Else
[Moto G4 Plus Questions & Answers] Rshivam9:
same problem with me,went to motorola service centre today ,they checked my warranty which was obviously void but still they took my phone for further consideration and asked me to contact them in a week.... i guess they won't replace my motherboard
[Moto G4 Plus Questions & Answers] m.swastik:
Your service centre people seem to be nice, can you ask them how to resolve this issue if this happens again. This is definitely a minor software issue, only absence of hw properties in phone IMO, since bootloader doesn't find these properties in the phone it flashes default firmware hence the name DFLT_FSG in baseband unfortunately default firmware is for single SIM hence one IMEI and doesn't contain fingerprint drivers/files.

Just persuade them to reveal some information it will help the community as most of us doesn't have access to such nice service centres.
[Moto G4 Plus Questions & Answers] Rshivam9:
i will try [MENTION=3684416]m.swastik[/MENTION]
[Moto G4 Plus Questions & Answers] m.swastik:
Anybody not having this issue can you please share your /dev/block/platform/7824900.sdhci/by-name/hw file.

My hw file has __UTAG_TAIL__ just after __UTAG_HEAD__ so may be due to this our hw properties are not being read. Since __UTAG_TAIL__ should be at the end of the file, all scripts stops executing after reading UTAG_TAIL.

Also, people having this issue can try deleting __UTAG_TAIL__ from this file using ES Explorer and try flashing firmware and post results.
[Moto G4 Plus Questions & Answers] GeeteshKhatavkar:
Any working solution ?
[Moto G4 Plus Questions & Answers] benedictusg:
I have lived with this "feature" long enough. I will try some new ROMs and so on to see if there is a way to fix it. I plan to do it this weekend.

I have not gotten a sense of that anyone has solved it yet or am I wrong?
[Moto G4 Plus Questions & Answers] m.swastik:
[MENTION=7922568]Rshivam9[/MENTION] is your phone fixed now?

[MENTION=6582365]benedictusg[/MENTION] it is not a ROM thing I have done lot of experiments with flashing several ROMs it is not working, may be you can try blankflash.
[Moto G4 Plus Questions & Answers] MK+2017:
You were looking for hw file, you have my working hw dd image here http://www.mediafire.com/file/es45hobzs4ghtjz/DD.XT1642.BaseBand.EMEA.Channel.Retail.Europe.7z (and a lot more ;))
[Moto G4 Plus Questions & Answers] jayeshaupe90:
did you solve the issue?
[Moto G4 Plus Questions & Answers] benedictusg:
No success :(
[Moto G4 Plus Questions & Answers] givitago:
Resolved!

Thank you m.swastik for noticing the issue in the hw partition and MK+2017 for posting the image! The hw partition was indeed corrupted as the attached diff shows. After copying over all those bytes in the attached image and using dd to overwrite my hw partition, my Moto G4 plus is a Plus again. No need to reflash the OS as the firmware simply reads this partition on startup. FYI, I have an XT1644 and even though MK+2017's image was an XT1642, it worked fine. Note I didn't copy MK+2017's entire hw.img, only the first few bytes of it.

Next time I flash, I won't be relying on the very partial TWRP backup, but rather use the script I posted here:

Complete Partition Backup Script
[Moto G4 Plus Questions & Answers] :
That's good news.

Would you mind creating a tutorial for all the poor G4 Plus to G4 users? If you need help from different models and their gpt details, we can help out, I suppose.
[Moto G4 Plus Questions & Answers] echo92:
Woo, nice work :) So, if I've understood things correctly, it appears that the flash of a stock ROM may be incomplete and thus corrupt your hw partition to the point where no device identifiers are written? Thus, the system falls back to a 'baseline' of sorts (i.e. thinking it's a G4)?

I'm wondering, are the UTAGs in the same place across devices? If so, as zeomal suggested, would make writing a guide easier :) If we know where to look too, I'm sure people would be happy to contribute their device properties.
[Moto G4 Plus Questions & Answers] givitago:
It appears to be only the first 512 bytes (dd's block size) that are corrupted. I noticed that the preceding partition is sp (service pack maybe ??). Not sure if something in the upgrade moves 1 block too many/few and overwrites something, or doing an upgrade with an invalid GPT.bin file ends up causing this.

I guess it doesn't matter - the lesson is that we can make mistakes and issues can happen and we should be backing up everything before flashing. For noobs like myself, it really isn't obvious that a TWRP backup is such a partial backup - seems like most of the documentation says it is enough. It would be nice if something like the partition backup script would be posted along with instructions for the steps to flash to stock.

If you launch an adb (I do this from twrp booted from pc drive), the following may fix it (I haven't tested but it does make a backup so you can revert):

The steps are as follows:

1) Extract the g42g4plus.sh file to your adb/fastboot (android platform tools folder) on your pc

2) Open a cmd window and cd to the folder with the g42g4plus.sh

3) Boot into TWRP Recovery

fastboot boot twrp.img

4) Run the following commands via ADB to patch hw partition:

adb push .\g42g4plus.sh /data/media/0/g42g4plus.sh
adb shell chmod 0755 /data/media/0/g42g4plus.sh
adb shell /data/media/0/g42g4plus.sh
[Moto G4 Plus Questions & Answers] LoneWolf x_o':
do i have to type the whole thing ? thanks in advance ?any other options?
[Moto G4 Plus Questions & Answers] givitago:
I would use copy paste myself. Note do not destroy your backup by running the first line twice.
[Moto G4 Plus Questions & Answers] LoneWolf x_o':
I'm a noob could you help me, can you tell me how to copy psste and do it please?

Also i might have ran the first command twice :/
[Moto G4 Plus Questions & Answers] LoneWolf x_o':
yes it would help a lot of people
[Moto G4 Plus Questions & Answers] LoneWolf x_o':
It says dd is disabled I've put up a screenshot , can you help please?
[Moto G4 Plus Questions & Answers] givitago:
Is your phone booted into TWRP or the main system when you run this. I had no troubles when booting into TWRP via fastboot. Also, I was root from the start. Perhaps a different version of TWRP would help?
[Moto G4 Plus Questions & Answers] m.swastik:
Install Busybox to /system/xbin and type in terminal PATH=/system/xbin:/system/bin
[Moto G4 Plus Questions & Answers] m.swastik:
adb shell is not accepting such long command when doing this from linux terminal. It only shows half of the command when pasting . How exactly did you solved your problem?
[Moto G4 Plus Questions & Answers] LoneWolf x_o':
Will try it out , thank you
[Moto G4 Plus Questions & Answers] givitago:
I used winmerge2011 on a windows pc to do a binary patch between a working hw partition and mine and then restored with dd. I thought the script would be easier for others. There many ways to update those first 512 bytes.

Not sure if you can resize your console, but I would just save the line in an sh file and upload it to the device using adb, make it executable

chmod 755 fix.sh

and then run it.
[Moto G4 Plus Questions & Answers] LoneWolf x_o':
same adb shell isnt taking the whole code (im doing this from twrp)
[Moto G4 Plus Questions & Answers] m.swastik:
Tried everything you mentioned, the closest thing i get is file gets changed but after reboot it reverts to its earlier form. This was happening earlier also when I tried to manually edit the file 2-3 months ago. The partition is protected so maybe something to do with it.

I also tried to generate patch file through winmerge2011 but keep getting error "Cannot create patch file from binary files".

I even tried to completely flash new hw.img file to mmcblk0p43 partition but terminal gets hanged while doing it.

Need further help on how did you generated patch file, which dd command you used?
[Moto G4 Plus Questions & Answers] givitago:
Sounds like progress if you can edit the file. Don't worry about winmerge or flashing or dd as all that is just another way to edit and copy the file.

The issue now sounds like something is overwriting the file. I didn't have this behavior.

If I had to guess, you are running ADB with the system (android) running and on shutdown, the file is overwritten. Try what I did: use fastboot to launch an image of TWRP stored on your PC, then launch the adb shell and run the patch script you saved.
[Moto G4 Plus Questions & Answers] m.swastik:
Tried it, did not work. Can you share your patch script?
[Moto G4 Plus Questions & Answers] givitago:
That isn't very descriptive.

Anyway, I have shared all I have. I did not use winmerge to make any sort of patch, I simply copied the first 512 bytes from a working hw into my copy of hw and reflashed the entire hw file/partition. I only did this because nobody shared an hw image from an xt1644. If you can find anyone with a working version of your model and can convince them to provide an image, you could avoid the edit and try flashing that. Your issue may not be the same issue I had either. My hw certainly never reverted.

I never figured out the cause of this. I'm pretty sure it is related to the gpt image - I'd verify that the gpt.bin file is the correct version.

Good luck!
[Moto G4 Plus Questions & Answers] Tavneeet:
I hav given mah fonr to servc center itz under warranty bt they are sying that if the imei numbers are corrupt it will nt cover in warranty.. They said wait until 7.1.1 update.. May be that update will fix it..
[Moto G4 Plus Questions & Answers] givitago:
I don't think a system update will help you. Not sure if we are all experiencing the same issue either. Mine was limitted to phone not recognizing it was a G4Plus. I still had one working imei. If all imei's are broken, I think it is probably the modemst1,modemst2 and fgs partitions.

Again, for next time, do a full backup of all partitions, not just the limitted backup done by TWRP - again, I wrote a script to backup the smaller partitions as well:

Partition Backup Sript

I updated my original post to be a bit more descriptive and use a script due to issues with command line length.

I suggest people post their hw partitions and include the model number so people can compare working and non-working files.
[Moto G4 Plus Questions & Answers] harshp54:
nothing happened after flashing

---------- Post added at 08:19 PM ---------- Previous post was at 07:56 PM ----------

copying over all those bytes in the attached image and using dd to overwrite my hw partition

can you explain this ?? what is dd and how did you overwrite your partitions?
[Moto G4 Plus Questions & Answers] m.swastik:
Can anybody try this and report https://xdaforums.com/moto-g4-plus/how-to/moto-g4-plus-hardbrick-solved-guide-t3657761
[Moto G4 Plus Questions & Answers] tazlooney89:
Hello, I have same problem, moto g4 plus change to moto g4, no imei, no fingerprint sensor.

This happened after I re-unlocked the bootloader after installing the firmware NPJS25.93-14-8.

The first time I install the mentioned firmware everything worked fine and relock the bootloader.

Now I wanted to test Lineage OS and re-unlock the bootloader but on restart the model had changed to normal G4 and I no longer recognized the fingerprint sensor, and I was left without IMEI.
[Moto G4 Plus Questions & Answers] akash0007:
if i flash MK+2017's hw file what will happned?

and please tell me how do i flash hw file to my phone because it is a text file?

---------- Post added at 11:54 PM ---------- Previous post was at 11:46 PM ----------

i manually copy and past the backupPartition.sh file to my /data/media/0/PartitionImages/backupPartitions.sh and make back up , is this the right way ?
[Moto G4 Plus Questions & Answers] givitago:
If your model is identical to his, flashing should be fine. I patched it only because I have a different model number and was not sure about the other bits of the file.

Did you try running the script I uploaded and did it fail? Seems it works for some but not others. Strange.

hw is a binary file, but flashing is no different than you likely did to mess up your phone.

fastboot flash hw