yashsingh1/xdaforums huggingface dataset:
[Moto G4 Plus Guides, News, & Discussion] tk8320:
i pushed this file using twrp terminal but is dosent showed anything that file is pushed successfully or anything but after some time it restarts as i forgot to puh modem and fsg don't know what will happen next
[Moto G4 Plus Guides, News, & Discussion] HeethJain21:
Push the files through terminal app after booting into ROM.

su
dd if=/data/media/0/modem.img of=/dev/block/mmcblk0p1
dd if=/data/media/0/fsg.img of=/dev/block/mmcblk0p16
dd if=/data/media/0/hw.img of=/dev/block/mmcblk0p43

Also if you are pushing the edited hw, then type the name of that image, in your case it would be:

dd if=/data/media/0/hwtk8320.img of=/dev/block/mmcblk0p43

Check the commands, this time try "/data/media/0" instead of "/sdcard" as maybe it might work........although there is no difference between both of them.
[Moto G4 Plus Guides, News, & Discussion] tk8320:
did this but after pushing hw phone restarts now what to do next according to some threads after pushing hw phone restarts they said to flash firmware so i am trying to flash firmware again
[Moto G4 Plus Guides, News, & Discussion] HeethJain21:
Alright, try flashing stock firmware again. Btw, before restart, were you able to see hw file sucessfully pushed?

And if this doesn't work either, a log would really help.

How to collect logs:

1. Open two command prompt windows in adb shell.

2. Start collecting logs in one command prompt by: "adb logcat>log.log"

3. Push the files using dd commands in another command prompt window "adb shell" then "su" then dd commands.

4. After reboot, give pstore i.e "adb pull /sys/fs/pstore". This will create a pstore folder in your adb folder and the pstore folder would have 2 or 3 files.

Once done, check the adb folder, there will be a file named "log.log"

Please share log.log and pstore files. Hopefully logs should tell why it isn't working for you but working for me
[Moto G4 Plus Guides, News, & Discussion] tk8320:
okay iwill do it for sure but i noticed another problem again as i run command ls -l /persist

itshows following output

ls: /persist : No such file or directory
[Moto G4 Plus Guides, News, & Discussion] HeethJain21:
Let's leave ls -l persist for now. First, let's try to solve this, then we will go to persist.
[Moto G4 Plus Guides, News, & Discussion] tk8320:
i think i have one good news for you

check this output

D:\Minimal ADB and Fastboot>adb shell

athene:/ $ su

athene:/ # dd if=/data/media/0/modem.img of=/dev/block/mmcblk0p1

204800+0 records in

204800+0 records out

104857600 bytes transferred in 10.323 secs (10157667 bytes/sec)

athene:/ # dd if=/data/media/0/fsg.img of=/dev/block/mmcblk0p16

16384+0 records in

16384+0 records out

8388608 bytes transferred in 0.676 secs (12409183 bytes/sec)

athene:/ # dd if=/data/media/0/hwtk8320.img of=/dev/block/mmcblk0p43

16384+0 records in

16384+0 records out

8388608 bytes transferred in 0.415 secs (20213513 bytes/sec)

athene:/ #

hw is flashed but phone becomes unresponsive and screen goes black and i am unable to take log it says partition is mount for only read purpose
[Moto G4 Plus Guides, News, & Discussion] HeethJain21:
Deleted Duplicate post
[Moto G4 Plus Guides, News, & Discussion] HeethJain21:
It seems it did flash correctly. If the device is still connected to PC, type reboot bootloader inside the shell and it will reboot to bootloader mode. Then flash the latest stock ROM available here: https://xdaforums.com/moto-g4-plus/how-to/stock-rom-npjs25-93-14-4-march-1-t3608138
[Moto G4 Plus Guides, News, & Discussion] Pistero07:
What are you guys

What are you guys like? First of all, I want to thank this immense community. know how to understand my English I am Argentine and I am obviously the google translator ... if someone can help me immensely I would appreciate it ... I have an xt1641, I lost the two imei (0) when doing downgrade, try perfectly to do 2 xda tutorials, obtaining the same result without 4g / imei / wifi. I flash baseband latam (tutorial xda) and I get as a result a single imei in 0, but in baseband indian I have two imei 0. I have a backup twrp, (v3.2.1) (2.3gb) when I try to recover the digest check fails, and if I disable the verification I get an installation without errors, but very fast it seems that it restores some folders. I have back up persist, (persist.ext4 237 kb) when I restore it (2 seconds) I do not get imei. 4 days ago I've been testing and reading everything, I'm about to resign myself ... I ask you a hand for favor and a thousand thanks!
[Moto G4 Plus Guides, News, & Discussion] HeethJain21:
I have sent you a private message. Please check it.
[Moto G4 Plus Guides, News, & Discussion] tk8320:
i am unable to boot it in bootloader after flashing hw it just goes black and wont compile any command for it i need to press power button then it will start and after that same thing happens again and again
[Moto G4 Plus Guides, News, & Discussion] HeethJain21:
Nevermind......once device is working properly, reboot into bootloader and flash latest stock nougat (April 2018) and report back if it worked.
[Moto G4 Plus Guides, News, & Discussion] tk8320:
nope didnt worked..:crying::crying::crying::crying:
[Moto G4 Plus Guides, News, & Discussion] HeethJain21:
[MENTION=9204366]tk8320[/MENTION], try this.

su
dd if=/data/media/0/hwnew.img of=/dev/block/bootdevice/by-name/hw

Tell if device stops responding after this command as well or not.

Attaching hwnew.img
[Moto G4 Plus Guides, News, & Discussion] HeethJain21:
https://drive.google.com/file/d/1oDs0Rjc9EAs5Dwo_kmTCAy5H_ZVQaWpQ/view?usp=drivesdk

hwnew.img
[Moto G4 Plus Guides, News, & Discussion] tk8320:
by using this mobile shut downs instanteneously by flashing previous hw it hang ups and then goes black but in this it goes black suddenly
[Moto G4 Plus Guides, News, & Discussion] HeethJain21:
I hope you tried this command new:

su
dd if=/data/media/0/hwnew.img of=/dev/block/bootdevice/by-name/hw

Ok so I noticed something. All the images including hw is stored in different sections of the device all together. And on pulling them differently, we get them of various sizes. We just can't copy them via file manager as it shows 0.0 kB as size.

Also try to restore hw.img with this app: https://play.google.com/store/apps/details?id=ma.wanam.partitions&hl=en_IN

Make sure that you are replacing hw.img in correct partition i.e mmcblk0p43.

Anyways thank you for not giving up on this already.........once you sucessfully fix this, it will be helpful for a lot of peopl!
[Moto G4 Plus Guides, News, & Discussion] tk8320:
same thing happening with given apk mobile just shut downs what to do next any idea??

---------- Post added at 09:01 AM ---------- Previous post was at 08:59 AM ----------

what if i push hw then boot into bootloader push old stock and brick device and after that blankflash it and again try to push hw?? will it work?
[Moto G4 Plus Guides, News, & Discussion] HeethJain21:
Well I dont know, using blankflash again might make your device again be recoginized as G4 Plus so there might be no issue of reflashing them again. But there's a risk.

I have used blankflash 3 times. Once when I didn't knew about downgrading, second time while trying to recover imei=0 and the third time when trying to recover Volte after IMEI=0 and my device turned into G4 the third time I used blankflash. Also it was very hard for me to get the device recognized as qualcomm loader.

Try the images for different baseband (everything will work but only the baseband will get changed).

If that doesn't work either, there are 2 options which you have.

1. Hard brick your device now and use blankflash and then try pushing hw file.

2. Wait for Official Oreo to come out. Now since the soak test is out, official oreo isn't much far away from a release. Once official oreo is out, it should probably fix this issue and if not then we can try the new modem files from official oreo.

Also do note that the blankflash we have now will only work for the current Stock Nougat so if you hard brick your device after Official Oreo, you will be stuck until someone makes a new blankflash.
[Moto G4 Plus Guides, News, & Discussion] tk8320:
yup i am also waiting for oreo update this is last ray of hope for me but i think OTA update wont resolve my issue i need to flash them with fastboot only then it will work now i will give a try and blackflash it and will notify you when it is done ..... give me best luck .....
[Moto G4 Plus Guides, News, & Discussion] HeethJain21:
Yes when oreo update comes, do flash it from fastboot.

Oh so you've decided to go for blankflash, so be it. Good luck!
[Moto G4 Plus Guides, News, & Discussion] tk8320:
well!! Can you provide me XT1643 indian modem and fsg files??
[Moto G4 Plus Guides, News, & Discussion] HeethJain21:
Do you mean the fastboot ones??

Also did you hardbricked your device yet?

If not then judt try to flash the modem via fastboot.....maybe it might work.
[Moto G4 Plus Guides, News, & Discussion] HeethJain21:
[MENTION=9204366]tk8320[/MENTION], here are the files: https://drive.google.com/open?id=1VCznd_yO3CWKfP5krDFKlUmRbRzmCIUp

Please use just these 4 commands:

fastboot flash modem NON-HLOS.bin
fastboot erase modemst1
fastboot erase modemst2
fastboot flash fsg fsg.mbn

Also then reboot and push modem.img, fsg.img and hw.img using dd commands.

If they work, flash Stock ROM, and you are good to go.
[Moto G4 Plus Guides, News, & Discussion] tk8320:
well i havent hardbriked it yet i will try to flash this files if it worked then no problem but if not then i willthink about hardbricking
[Moto G4 Plus Guides, News, & Discussion] tk8320:
hey i noticed something odd the fastboot files which had downloaded earlier are not for moto g4 plus according to me as i am uploading the text file along with which shows model no and other information please check it i dont think so it is for moto g4 plus
[Moto G4 Plus Guides, News, & Discussion] tk8320:
and if it is wrong please give me a link to download correct firmware
[Moto G4 Plus Guides, News, & Discussion] HeethJain21:
I went through the txt file. Since the model is shown Moto G(4), its making you believe its for G4 and not G4 Plus. Do not worry, as the files are common for G4 and G4 Plus retail variants, XT1621, XT1622, XT1640, XT1641, XT1642, XT1643, XT1644.

XT162x is G4

XT164x is G4 Plus

It is the correct link so you need not worry. The files I uploaded were from NPJS25.93-14-18.

Also when you check build.prop file in Stock ROM, you will see there G(4) always even if your device is a G4 Plus.
[Moto G4 Plus Guides, News, & Discussion] tk8320:
but as i remember in about section of my phone it shows moto g4 plusbut now it shows just moto g4
[Moto G4 Plus Guides, News, & Discussion] HeethJain21:
The model which is in the txt file is of build.prop

Model in build.prop will always be Moto G(4) irrespective of your device being G4 or G4 Plus

Model in About section will be G4 Plus if device is G4 Plus and will be G4 if device is G4. In you case, since your mdoel has been converted to G4, about section will also show G4.

If you have any further questions please do ask. Rest assured as the files are correct. I have flashed them n number of times on G4 Plus and it always remained G4 Plus.

Only when the model is converted to G4, on flashing the Stock ROM, the device will be detected as G4, and hence it will remain as G4 unless we push modem, fsg, hw files.
[Moto G4 Plus Guides, News, & Discussion] HeethJain21:
[MENTION=9204366]tk8320[/MENTION], I just sent you a pm please check it.
[Moto G4 Plus Guides, News, & Discussion] lordstein:
hello, after flashing dual sim latam baseband, i have retusa and only 1 imei and no signal
[Moto G4 Plus Guides, News, & Discussion] HeethJain21:
Umm......I realzed those files are wrong. I am uploadig a new pair of files soon. Of that doesn't work either, I will collect a new pair of LATAM files.

For now, just use any other baseband like Indian for dual sim to work
[Moto G4 Plus Guides, News, & Discussion] HeethJain21:
Update: [MENTION=3774603]lordstein[/MENTION] I have uploaded a new pair of files. The link is same. This time download the files from dual sim folder which is inside LATAM files. If they still don't work, I will get a new pair of files, so please respond if they work fine. I personally tested them and they are working!

[MENTION=4948275]red002[/MENTION], Now there is a a thread for backing up baseband, as well as all partitions. Here is the link: https://xdaforums.com/moto-g4-plus/how-to/guide-moto-g4-plus-complete-partition-t3875787
[Moto G4 Plus Guides, News, & Discussion] rodriman92:
Ayuda!

Hola, pudiste recuperar el 4G? Estoy en la misma situacion, intente de todo pero nada me da resultado. Espero tu respuesta. Saludos!
[Moto G4 Plus Guides, News, & Discussion] HeethJain21:
Were you able to recover network or dual sim?
[Moto G4 Plus Guides, News, & Discussion] rodriman92:
Hello! No I have imei 0. I follow the instruction step by step but I cant recover my network. The problem start when I flash the OREO SOAK TEST and my backup of rom stock cannot work. Can you help me? Thanks
[Moto G4 Plus Guides, News, & Discussion] HeethJain21:
For fixing IMEI=0, check out this thread: [Guide] [XT16XX] [Solve] Moto G4/Plus IMEI=0 issue
[Moto G4 Plus Guides, News, & Discussion] rodriman92:
I have that step by step but cannot work. When I have fastboot getvar imei I can see mi imei but network dont work
[Moto G4 Plus Guides, News, & Discussion] yoni22:
no funciono

cuando coloco los comandos me dice unknown operand if.. en la señal me dice solo emergencia.. hice la operacion para recuperar el imei pero no me recupero me sigue saliendo imei 0..anteriormente flashe el archivo imei 0 fix y pude tener señal en claro argentina solamente.. pero ahora instale otra rom y se me fue la señal de nuevo y ya no pude recuperar mas..
[Moto G4 Plus Guides, News, & Discussion] Kosuke360:
Hi! I tried with XT1641 Dual Sim LATAM but this erases or hides my second sim card, I tried with Single Sim not work, I finally used the files for India devices and my phone recognizes the second sim card, but the imei is a random numer like that "431017114****", my 2nd ime start with 3541160*****... Can you help me, please?

pic: https://i.imgur.com/MrsWyrd.jpg
[Moto G4 Plus Guides, News, & Discussion] HeethJain21:
LATAM files aren't erasing your second IMEI, it just hides as it thinks its a single sim device. I think I got them mixed with Single SIM ones.

I think the LATAM baseband files are wrong. I'll get a new pair of files!

You tried Indian baseband and it shows a random number instead of second IMEI. That isn't a random number. That would be MEID of SIM 1 or MEID of SIM 2.

Check IMEI in settings>about phone>status>imei information. You will definitely see 2 correct IMEI there.

Now why are you seeing random numbers in dialer on dialing *#06#? idk, some bug. A reset should fix it and if not, a Stock ROM flash again should fix it.

As soon as I get a new pair of files, I'll tag you here.
[Moto G4 Plus Guides, News, & Discussion] HeethJain21:
[MENTION=9098159]Kosuke360[/MENTION], I have uploaded a new pair of files. Please download the new pair of files for Dual SIM XT1641. The link for the files and the process remains the same.

[MENTION=9098159]Kosuke360[/MENTION], could you also please report back whether the files work or not.
[Moto G4 Plus Guides, News, & Discussion] Kosuke360:
thanks, I’ll try
[Moto G4 Plus Guides, News, & Discussion] clonechill:
I have a query. I'm using XT1642 (EMEA retail) variant. As I'm in India, I badly need Volte for Jio. The only thing that's missing is that the EMEA retail variant doesn't have jio volte. It can get cell reception and data without issues. Can I try flashing the modem of Indian variant (XT1643) in my XT1642? What might happen? Whatever be the case, I'm ready to try it out if it's possible to revert back to EMEA in case this experiment goes haywire. Can you please give your opinion on this?
[Moto G4 Plus Guides, News, & Discussion] HeethJain21:
It depends.

If Jio VoLTE just needs Indian baseband without Indian model (XT1643) i.e if it just checks for baseband alone and ignores the device model, then this will work.

However if it checks for Indian baseband as well as for Indian model , it wouldn't work.

You can always revert back to EMEA baseband by flashing the modem files for EMEA variant again.

I have tested all the modem files by flashing them and have changed my baseband to all five i.e BRAZIL, LATAM, EMEA, RETUSA, INDIA.

While reverting back, I just flashed INDIAN files again by the method in OP and it was back to normal.

If you still have any fear, you can always backup all of your partitions, (I have mentioned link of thread for backup of all partitions in post #2), so if there's an issue, you can revert back.
[Moto G4 Plus Guides, News, & Discussion] clonechill:
Thanks man. That was quick and super helpful. I'll try and get back to you.
[Moto G4 Plus Guides, News, & Discussion] FelipeFritschF:
Hello, I tried your IMEI=0 solution (and it worked, thanks!), but I'm still getting the no network problem. Now, I'm trying to do this solution for my XT1640 (Brazilian), but in the google drive folder (in fact, there are two, seemingly redundant, modem files), there's no fsg file, and as such when I input the command in the adb shell it just tells me there's no such file, so it's not working after I reboot it even though I can flash the other two files just fine. Can you reupload the files or get whoever uploaded them to reupload the fsg file? Thanks again.
[Moto G4 Plus Guides, News, & Discussion] HeethJain21:
Thank you for pointing out. It was my fault, earlier when I was deleting modem.img, I deleted fsg.img by mistake and hence there were two modem files and no fsg.

I have reuploaded the fsg file now. Please have a look at it.
[Moto G4 Plus Guides, News, & Discussion] HeethJain21:
[MENTION=8724736]clonechill[/MENTION], did you get VoLTE working??
[Moto G4 Plus Guides, News, & Discussion] HeethJain21:
Update: All the links have been updated to AndroidFileHost. Please download accordingly.
[Moto G4 Plus Guides, News, & Discussion] Ruan Carlos:
I used these hw files and it did not work for me any, I need a hw (Brazilian version) dual chip, or if someone has the solution let me know.
[Moto G4 Plus Guides, News, & Discussion] HeethJain21:
What didn't work?? Did your baseband changed to BRAZIL?? Did you get both IMEI?

Are you sure you donwloaded the correct files??

And did you follow whole method i.e pushing modem fsg and hw??
[Moto G4 Plus Guides, News, & Discussion] clonechill:
Didn't try bro, will do it this weekend.
[Moto G4 Plus Guides, News, & Discussion] Ruan Carlos:
Yes, I downloaded all files, I did everything correctly, I put right the baseband was Brazilian, but my imei did not come back, I tried everyone, baseband, that is there for download, but none came back my imei.
[Moto G4 Plus Guides, News, & Discussion] HeethJain21:
You get to just see one IMEI.........right?? And the other one is just gone.

Try different modem files (INDIA as it is of Dual SIM) and see if they work.

I hope you don't have both IMEI=0 problem and its just that you can see only one IMEI in settings.
[Moto G4 Plus Guides, News, & Discussion] Ruan Carlos:
When I put the files from India or Latam or Brazilian, none of the imeis back, I already tested everything I found in the forum xda, if someone has more and can send me, it has to be dual chip, thank you already ....
[Moto G4 Plus Guides, News, & Discussion] HeethJain21:
Indian files are of dual SIM..........infact, there is no single sim model launched in India, there was only a dual sim model launched in India.

Please share a screenshot of IMEI from settings (of course hide your IMEI except any 1-2 digits)

Q1. What do you mean by "none of the IMEI's back"??

Q2. Do you have IMEI=0?

Q3. Did you flash the latest Stock ROM again via fastboot after flashing modem.img, fsg.img and hw.img files?

We can't help you unless you are specific.
[Moto G4 Plus Guides, News, & Discussion] Ruan Carlos:
After I install the Indian or Brazilian files, my imei does not return, only recognizes the chip, but my imei does not return.

https://prnt.sc/lwn788

https://prnt.sc/lwn7d2

If you want getvar all photos on fastboot, please let me know.
[Moto G4 Plus Guides, News, & Discussion] HeethJain21:
deleted
[Moto G4 Plus Guides, News, & Discussion] HeethJain21:
Oh, so you have IMEI=0.

You are following the wrong guide, my friend.

"my imei does not return" has 3 different meanings.

Follow this to get your IMEI back: [Guide] [XT16XX] [Solve] Moto G4/Plus IMEI=0 issue and if you still have any issues, please reply in that thread itself.

Once you get your IMEI fixed, follow this thread again as your baseband ends with "DFLT_FSG".
[Moto G4 Plus Guides, News, & Discussion] perfectmem:
Did not work with me.

Do I have to do the procedure and then move on to ROM?

Because when I do the normal procedure, it continues the same way.

help please.
[Moto G4 Plus Guides, News, & Discussion] clonechill:
[MENTION=6490709]Heeth21[/MENTION] am I needed to flash the stock rom with "erase userdata" command? This had caused the IMEI to become zero once which i fixed with your persist fix. Please suggest as I'm afraid whether using a different modem may cause the IMEI to go for good.
[Moto G4 Plus Guides, News, & Discussion] HeethJain21:
I am sorry I didn't understand what you meant. Could you elaborate a little more?

What do you mean by normal procedure?
[Moto G4 Plus Guides, News, & Discussion] HeethJain21:
"erase userdata" has no connection with IMEI.

modemst1 and modemst2 are your EFS and "fastboot erase modemst1" and "fastboot erase modemst2" erases your EFS which is regenerated by persist.

Pie ROMs and Soak test Oreo are making changes in persist. You will have to do the persist fix method each time you flash a Pie ROM or Oreo Soak Test. However you can also restore your "working persist" by TWRP and then there will be no loss of IMEI as persist will be working fine.

Once you fix your persist and if you do not flash 64 bit Pie ROM or Soak Test Oreo, then you will not lose IMEI on "fastboot erase modemst1" and "fastboot erase modemst2" (tested and working on my device already more than 10 times)

Its a good practice to use erase modemst commands, but if you fear of losing somethings, its better to take backup of everything before flashing or you can also skip those commands.

Userdata is basically has the information of your ROM. Just like "data" when you wipe it in TWRP before clean flashing ROM and has no connection with IMEI what so ever.

Use "erase userdata" without any risk and you can skip "fastboot erase modemst1" and "fastboot erase modemst2".

I would strongly recommend to take backup of partitions from TWRP. I have also made a thread for that (read post #2 of this thread) where you can backup and restore all partitions by just flashing a TWRP flashable zip file and also recommend using "erase modemst" commands.

And using different modem won't cause any issues with IMEI whatsoever.
[Moto G4 Plus Guides, News, & Discussion] perfectmem:
IMEI not repaired

I did the whole procedure, however did not install the rom soon after, should I do the process again and move to ROM?
[Moto G4 Plus Guides, News, & Discussion] HeethJain21:
Yes do the whole process again and flash Stock ROM latest version by fastboot only (link given in Step 3)