yashsingh1/xdaforums huggingface dataset:
[Moto G4 Plus Guides, News, & Discussion] calinb7:
I finally got around to re-rooting after taking the Nougat 7..0 ota on my previously rooted Marshmallow XT-1644. This guide worked great for NPJ25.93-14.5, except I chose to simply boot TWRP (sudo fastboot boot ./twrp-3.1.1-0-athene.img) instead of flashing it. Then I used TWRP to flash ElementalX-G4-1.04.zip and SuperSU-v2.82-201705271822.zip. I did not reboot in between flashing of both zip files. (I did it all in one single fastboot session of TWRP.) After booting to Android, I gave SDMaid Pro root permissions and then used SDMaid ApControl to freeze Motorola Update Services (com.motorola.ccc.ota) just to be safe. Thanks for this guide!
[Moto G4 Plus Guides, News, & Discussion] OsckarM3:
is there a process to unroot? I need it please
[Moto G4 Plus Guides, News, & Discussion] strongst:
https://xdaforums.com/moto-g4-plus/help/how-unroot-moto-g4-plus-t3670260/post73724489
[Moto G4 Plus Guides, News, & Discussion] slicnic911:
I can confirm that this process also works on the XT 1640! Thank you all so much for the walkthrough and great info in this thread. Traded my wife's old iphone for this phone and am very glad I could get it rooted.

As mentioned in other comments, flash kernel BEFORE supersu. :) And of course, do that backup in TWRP as well! It saved me a lot of time going back after flashing supersu first...
[Moto G4 Plus Guides, News, & Discussion] ChuyitoSr:
Hello, I have new XT1644 running 93-14.5. I was able to unlock the bootloader (took much longer than usual) using minimal adb fastboot. I've tried installing twrp and can't get it to install on fastboot. I keep getting a twrp failed to load line on fastboot. I've installed the latest Motorola drivers and read several tutorials on this subject. I've also tried mfastboot and also a no go. I placed the twrp img in the minimal adb fastboot directory and nothing works. Any help guys?
[Moto G4 Plus Guides, News, & Discussion] echo92:
So you've unlocked your bootloader by requesting the unlock code from Motorola and entered it into your device (as described here: https://xdaforums.com/showpost.php?p=67031801&postcount=2 )?

Which TWRP image are you using and what command are you using to flash TWRP? Are you able to confirm your device is communicating to your computer? You can check this by:

Connecting your device to your computer

Open an ADB terminal

Type 'fastboot devices' without quotes. That should return your device serial number.
[Moto G4 Plus Guides, News, & Discussion] ChuyitoSr:
Yes, I unlocked the bootloader using Motorola code.

This what I get when I try to flash twrp(latest update from twrp website).
[Moto G4 Plus Guides, News, & Discussion] echo92:
That's not the latest update of TWRP (3.1.1 is the latest). Are there any more outputs from that command?

Shouldn't matter with the .exe but the command is 'fastboot flash recovery <name of your TWRP image in your adb folder>' without the quotes. Are you using minimal adb 1.4.2 or greater?

You've confirmed your device is properly communicating with 'fastboot devices' as I mentioned above? Does TWRP even flash with 'Image not signed or corrupted' or does the process just stall at that output?

You may wish to attempt flashing shreps' TWRP in fastboot: https://xdaforums.com/moto-g4-plus/development/recovery-twrp-3-0-2-r3-moto-g4-g4-plus-t3494337
[Moto G4 Plus Guides, News, & Discussion] ChuyitoSr:
This is what I get when I try to flash twrp.
[Moto G4 Plus Guides, News, & Discussion] strongst:
Make sure the twrp.img file is within the same directory as the fastboot files
[Moto G4 Plus Guides, News, & Discussion] ChuyitoSr:
It is. I'm thinking latest software update for my xt1644 is causing this issue.
[Moto G4 Plus Guides, News, & Discussion] echo92:
In both cases, it looks like fastboot isn't finding the TWRP image to flash.

1)You've spelt athene wrong in the 1st attempt to flash (needs the exact file name).

2)Unless you've renamed the TWRP image to twrp.img, then fastboot cannot find the TWRP image.

As strongst has mentioned, confirm that the TWRP image is copied to your minimal adb folder and is on the same folder level as your adb and fastboot executables. When typing the filename, double check the file name you've entered is exactly the same as that in your minimal adb folder. You can use the tab key on your keyboard to autocomplete the filename if you so wish. Check the included screenshot, where I'm demonstrating with shreps' TWRP, this is with minimal adb 1.4.2 on NPJS25.93-14-8, which I was able to flash successfully previously.

I've seen reports that TWRP is flashable on NPJ25.93-14-5 (June 2017 update for US devices), so I'm not sure what's happening... You're getting the unlocked bootloader warning and on your bootloader screen, you're seeing OEM_unlocked?
[Moto G4 Plus Guides, News, & Discussion] ChuyitoSr:
Still no luck flashing twrp recovery. I checked oem bootloader unlocking and usb debugging. Placed the twrp.img in minimal/adb fastboot directory and still no luck. I'm not sure if this has anything to do with it?
[Moto G4 Plus Guides, News, & Discussion] strongst:
This Warning message comes along after unlocking the bootloader, so no worries about that, everyone who unlocks the bootloader see this.

But really, I have no clue why twrp won't install on your device... Have you tried another twrp version or re-download again?
[Moto G4 Plus Guides, News, & Discussion] ChuyitoSr:
Yes, I've tried 3 different versions. I blame myself for accepting the software updates when I first got the phone last week. It was still running MM and I'm sure that would have been a breeze to flash twrp and root. I'm getting pretty desperate, considering paying $39.95 for oneclickroot to take care if this issue. I had the MXPE prior to this phone and had no issues flashing via fastboot :(
[Moto G4 Plus Guides, News, & Discussion] echo92:
Be aware that rooting on Moto G4 devices running stock Nougat require flashing a custom kernel, if oneclickroot or yourself do not flash a custom kernel before rooting, you'll trip the anti-rooting protections built into the stock kernel, meaning you'll likely have to re-flash the stock ROM to get your device working again.

Can we see a screenshot of your minimal adb/fastboot folder please and the commands you're using to flash again?

Failing that, I'm wondering if a re-flash of the stock NPJ25.93-14.5 June 2017 ROM might be worth trying...
[Moto G4 Plus Guides, News, & Discussion] ChuyitoSr:
I finally figured it out. First, thanks to echo92 and strongst for all the help. Basically, after watching a YouTube video about common fastboot command mistakes I figured out I was renaming the file "twrp.img" and after right clicking on twrp- properties/details it was stating twrp.img.img. I simply renamed twrp.img to "twrp" then flashed as twrp.img and it worked. I'm rooted and good to go.
[Moto G4 Plus Guides, News, & Discussion] strongst:
That's why everybody should enable the full file name extension be displayed within windows explorer. Otherwise you don't see what file you have :good:

Good to hear that you solved the problem, others can profit from that information :good:
[Moto G4 Plus Guides, News, & Discussion] studymadara:
Great!!

works perfectly!

Thank you .
[Moto G4 Plus Guides, News, & Discussion] lpen2146:
Has anyone tried to root with one click root? If so was it successfully done? I saw someone mention it in earlier post and in their advertising looks way too good to be true.
[Moto G4 Plus Guides, News, & Discussion] echo92:
Just had a quick look at it and looks like you'd have to use their remote support service to help you root - this is testing on a Moto G4 Plus (XT1642) running NPJS25.93-14-8, June 2017 stock ROM, though I'm rooted already with magisk 13.3.

You may be better off following this guide. I have the feeling they'd use the same steps (flash/boot TWRP, backup, then flash ElementalX, then flash either SuperSU/magisk).
[Moto G4 Plus Guides, News, & Discussion] lpen2146:
Thanks for looking into it. Wasn't planning on rooting but since no further updates planned for g4 series i may take the plunge. What are the pros/cons SuperSU vs Magisk?
[Moto G4 Plus Guides, News, & Discussion] strongst:
One of "magisk vs supersu" threads https://xdaforums.com/oneplus-3t/help/magisk-vs-supersu-t3532752 also have a look at magisk forum https://xdaforums.com/apps/magisk
[Moto G4 Plus Guides, News, & Discussion] lpen2146:
Very helpful, thank you. Things have really changed since days of rooting flashing my old LG Optimus V.
[Moto G4 Plus Guides, News, & Discussion] strongst:
Every manufacturer handles things other,thats really confusing :(
[Moto G4 Plus Guides, News, & Discussion] caifan:
echo92, so you were able to root the latest update (June 2017 security) with no problems?

I have the Amazon G4 version (7.0 with removed ads using terminal window method) and hope I can remove the ads when I update and then I root since my bootloader is unlocked. I am a bit hesitant to take latest since others are reporting that older removal methods are no longer working, however, I'm not sure if they are rooted.
[Moto G4 Plus Guides, News, & Discussion] echo92:
No issues in rooting on the June 2017 update that I can recall. Basically, it involved:

Flashing/booting in shreps' TWRP 3.1.1

Backup system and other partitions.

Flash ElementalX.

Boot to check system is working.

Reboot to TWRP.

Flash magisk 13.3.

More info is in the opening post or in my post of how I rooted https://xdaforums.com/showpost.php?p=72496111&postcount=270

The only thing I encountered was that Google play store would error 0 when updating. Turns out you had to repair permissions on your data partitions: https://xdaforums.com/showpost.php?p=73604008&postcount=19

Given the latest update appears to have limited permissions to the ads service on Amazon devices, root may be useful for bypassing that. Only way to know is to try it.
[Moto G4 Plus Guides, News, & Discussion] night0crawler:
Hello there.

I am thinking of rooting my Moto G4 Plus v7.0 (XT1643)

Android security patch level - 1 June 2017

Build No. NPJS25.93-14-8

Is this method going to work?
[Moto G4 Plus Guides, News, & Discussion] strongst:
Yes this method is exactly for this device and build you mentioned. See post from echo92 above yours too :)
[Moto G4 Plus Guides, News, & Discussion] echo92:
Should work without issue, ensure you follow the steps in order. If you wish to flash magisk as your root manager, flash this instead of SuperSU.

Edit: strongst is too quick for me :)
[Moto G4 Plus Guides, News, & Discussion] strongst:
Nothing to do [MENTION=408485]work[/MENTION], so I spent my time here :good:
[Moto G4 Plus Guides, News, & Discussion] night0crawler:
Ah! Okay. Thanks for clarifying. I got a bit confused where it came about the last digit '8' in Build No. NPJS25.93-14-8 as some people were asking whether 14.4 is working or 14.5 is working or not, here 14.4 and 14.5 I'm talkin' about last digits of Build No. I thought it would effect the process of rooting.

Hope Security Patch Level ain't gonna affect the process.

Also I'm wondering as nowhere it is mentioned whether which version of ElementalX is to be flashed, whether v1.0.0 or v1.0.4, as in the ElementalX website it is mentioned that v1.0.4 is for Moto G4/G4 Plus (XT1622) and v1.0.0 is for Android Generic Device/Other.

Also if I opt for Magisk which specific version should I opt for?
[Moto G4 Plus Guides, News, & Discussion] strongst:
Keep things simple: The security level is the same for .8. Use that version. Latest 1.0.4 version of ElementalX kernel is also OK. Magisk you can use v14, the older one v13 is working too.
[Moto G4 Plus Guides, News, & Discussion] night0crawler:
Thanks for the help, will try that. ?
[Moto G4 Plus Guides, News, & Discussion] 90180360:
Right after flashing the new kernel (ElementalX-G4-1.04, I'm on a stock G4 Plus) I'm getting ghost touches like crazy -_-
[Moto G4 Plus Guides, News, & Discussion] night0crawler:
Hey thanks guys. I finally rooted my device. Followed each step one by one as mentioned in here and voila! I have Twrp 3.0.2.0 installed. The version of SuperSU v2.79SR3 works perfectly. Also I used ElementalX1.0.4

I have few questions.

1. Following step 3, I took a backup in external sd card. Is this the backup of Stock ROM? If yes, then these are separate files and not a file that can be flashed using TWRP. Is there a way to make a flashable stock ROM of these files?

2. All those custom ROMs I heard about are those working fine with this one as well?

3. And what about Xposed Framework for Moto G4 Plus 7.0 is it available?
[Moto G4 Plus Guides, News, & Discussion] strongst:
1. Yes, it's the backup of stock rom and can only restored with TWRP(restore) not with flashing a zip file like custom rom.

2. Custom roms are working with all g4/g4 plus variants

3. There's a non official working version of xposed not provided by rovo. Search on it https://xdaforums.com/moto-g4-plus/themes/xposed-sdk25-24-t3642091/post73162421

For further questions you can ask here https://xdaforums.com/moto-g4-plus/help/help-thread-question-noob-friendly-t3526598
[Moto G4 Plus Guides, News, & Discussion] night0crawler:
Once again, thanks a lot. :)
[Moto G4 Plus Guides, News, & Discussion] nitinvaid:
i am not able to unlock the bootloader getting error when unlocking and pasting the key

(bootloader) slot-count: not found

(bootloader) slot-suffixes: not found

(bootloader) slot-suffixes: not found

...

(bootloader) invalid boot state

OKAY [ 0.007s]

finished. total time: 0.008s
[Moto G4 Plus Guides, News, & Discussion] strongst:
Check for blank characters, maybe there are some.
[Moto G4 Plus Guides, News, & Discussion] nitinvaid:
Nope there are none

"fastboot oem unlock YSRYD556PVZFLG36GGJI"

It is showing me that the bootloader is unlocked screen but i am sure its not unlocked something is messed up

check screenshot here

https://xdaforums.com/moto-g4-plus/...ting-error-t3678924/post73925056#post73925056
[Moto G4 Plus Guides, News, & Discussion] strongst:
I see you posted the problem in a seperate thread too https://xdaforums.com/moto-g4-plus/help/able-to-unlock-bootloader-getting-error-t3678924
[Moto G4 Plus Guides, News, & Discussion] ldeveraux:
I've tried this on the XT1625 and followed the OP with limited success. I unlocked the bootloader, then OTA to latest Nougat. Then rebooted to bootloader and flashed the latest TWRP. Then I flashed the latest SuperSU (2.82 SR4) and reboot. It just sits on a black screen powered on and never boots the phone. If I hold VOL Down, I get back to Bootloader, but all I can do is go between Bootloader and TWRP. Is there something I'm missing?
[Moto G4 Plus Guides, News, & Discussion] echo92:
Have you flashed a custom kernel before rooting? Attempting to root with the stock Nougat kernel in place won't work, and you'll be in the bootloop you're experiencing (as the stock kernel anti-rooting measures have been triggered).

If you didn't, try reverting back to a backup made in TWRP before you rooted (which hopefully you took), or if not, you may have to re-flash the stock ROM of the same build to restore your device. By latest Nougat, do you mean the June or September build (we have stock ROMs for both)?
[Moto G4 Plus Guides, News, & Discussion] ldeveraux:
I just got the phone, so haven't done much with it. All I want to do is update while unlocked, flash TWRP, then root. Is there another way, or is this thread the best way to do that?

The phone came with MPJ24.139-64, and I believe I'm trying to flash 24.31.65 (that's what was in the updater app folder). Where can I get these files, and which ones should I use for the XT1625? I got what I thought was the stock installed image from mirrors.lolinet.com (XT1625-XT1644_ATHENE_RETUS_MPJ24.139-64_cid50_subsidy-DEFAULT_regulatory-DEFAULT_CFC.xml). Is there another stock image?

So at some point, I couldn't get the phone to boot as I said, so I extracted the above image and fastboot flashed everything back to the device. I think that got me back as stock as I could get. Even with Stock recovery and no root, now the update won't stick. When it reboots, it gets halfway through the flash and then the android guy says Error!!

Sorry for all the questions, this isn't going well for me :(

*UPDATE*

I wiped everything and flashed each segment of the stock ROM in batch and finally got a stable stock system. Then after the wipe I was able to perform the first system update. I went back and read what you said about attempting to root the stock Nougat kernel. I guess I never flashed ElementX prior to attempting root, because it worked for me this time. Rebooted a few times, but worked like a champ. I made sure to check the system update before rooting, I think there were 3 updates in addition to the main Nougat update. What is the recommended action to take when there is another system update?
[Moto G4 Plus Guides, News, & Discussion] echo92:
Good to hear you managed to get your device working. Which stock ROM update did you flash onto your device to get it working again?

Depending on what Nougat stock ROM you flashed, you may be already on the latest version (which for US devices I think is NPJ25.93-14-5, but it depends on what your OTA gave you). For updating via OTA update, you'll have to revert back to stock recovery, unmodified system/kernel/logo and unroot. Attempting to use an OTA with TWRP flashed may result in a soft bootloop unless you boot into bootloader and boot to system from there.

You could either revert back to the stock ROM (ensuring it's the same build as the most recent firmware on your device) and then take the OTA or wait for the corresponding stock ROM firmware and flash that. Either way, you'll have to unroot/remove TWRP. If you don't wish to update, then you can freeze the Motorola updater if you choose. Check this thread for various ways on how to disable/remove the updater: https://xdaforums.com/moto-g4-plus/help/how-disable-notification-update-t3459587
[Moto G4 Plus Guides, News, & Discussion] ldeveraux:
I believe after I totally wiped it, I flashed MPJ24.139-64, then ran system update.

I feel like the best way to update is to wait for the stock ROM, but would that wipe everything? If so, doesn't seem worth it...
[Moto G4 Plus Guides, News, & Discussion] echo92:
Ah, okay - just a heads up that with the March, June, September 2017 and future updates, I would suggest only flashing the stock ROM that corresponds to the newest firmware on your device. Don't roll back to the original stock (MPJ24.139-64) once you're on the June 2017 or later updates, else you may risk a hard brick if you attempt to update via OTA. This appears to result from having a newer bootloader (in case of the June 2017 update, it's version B1:06) but older system - OTA updates only seem to check if your system is the appropriate patch level, and assumes your bootloader is of the same patch level, which if mismatched could corrupt your bootloader and leave you unable to boot. Just be careful.

As for updating, you could update without wiping everything. I've used the following fastboot commands with the September 2017 update (and should work on either the June 2017 update, NPJ25.93-14.5 or the September update when it arrives for US devices) on a previously rooted device to update, and I retained my data. Though I removed TWRP, ElementalX and magisk (and a custom logo.bin) in the process, having all the files on my device meant 2-3 minutes of flashing and was back to a rooted state. Of course, back up your data before using these commands, and be prepared to factory reset/wipe if you experience instabilities.

fastboot flash partition gpt.bin
fastboot flash bootloader bootloader.img
fastboot flash logo logo.bin
fastboot flash boot boot.img
fastboot flash recovery recovery.img
fastboot flash dsp adspso.bin
fastboot flash oem oem.img
fastboot flash system system.img_sparsechunk.0
fastboot flash system system.img_sparsechunk.1
fastboot flash system system.img_sparsechunk.2
fastboot flash system system.img_sparsechunk.3
fastboot flash system system.img_sparsechunk.4
fastboot flash 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 reboot

These commands should flash the updated GPT, bootloader, logo, recovery, system and modem without wiping your data. As the fastboot files flash whole files rather than the OTA code patches, this should be safer than the OTA updates. Then re-flash/boot TWRP, backup and then proceed to flash ElementalX and SuperSU/magisk.
[Moto G4 Plus Guides, News, & Discussion] slicnic911:
Please help me clarify. I used this process to root my phone on NPJS25.93-14-8. Now, I'm getting constant reminders to install NPJS25.93-14-10. If I'm following, I shouldn't take the OTA install. Correct? Should I disable the update reminders or is there a way to update and retain root? Thanks so much!
[Moto G4 Plus Guides, News, & Discussion] echo92:
If you're already rooted, do not update via OTA, that's correct. Attempting to update via OTA whilst still having TWRP and root may cause the OTA to fail and keep your device stuck booting into recovery unless you boot to bootloader and boot to system from there. Currently there is no way to formally update and retain root, as the OTA and system updates rely on an unmodified system to update with.

If you wish to update, you could flash the September 2017 stock ROM (NPJS25.93-14-10) , see the instructions I posted above. Sept 2017 stock ROM is linked here: https://xdaforums.com/moto-g4-plus/how-to/stock-rom-npjs25-93-14-4-march-1-t3608138 Of course, this will remove TWRP, ElementalX and root, but if you have the files handy you should be able to re-root quickly.

If you wish to freeze the update notification, you can look at this thread for various methods: https://xdaforums.com/moto-g4-plus/help/how-disable-notification-update-t3459587
[Moto G4 Plus Guides, News, & Discussion] mustang1068:
Lost camera

I followed this procedure and just about everything worked with the exception of my camera. I would get an error that the app cannot connect to the camera. I went ahead and restored my backup and the camera is back again. Anyone else have this issue?
[Moto G4 Plus Guides, News, & Discussion] echo92:
Hmm, that's an odd issue to have - can I ask:

1)What device do you have and what firmware do you have?

2)What TWRP, ElementalX and root manager versions did you use?

3)Which camera apps did you experience this problem with?
[Moto G4 Plus Guides, News, & Discussion] mustang1068:
G4 Plus with June 1, 2017 security patch Xt1644

ElementalX 1.04

SuperSU 2.82

TWRP 3.1.1.0

All camera apps had same issue - moto, google

I'm going to give it another try today if I can find time. Maybe try the same versions described rather than the newer versions.
[Moto G4 Plus Guides, News, & Discussion] mustang1068:
Nevermind, had nothing to do with rooting. The first thing I did with my new powers was update build.prop to enable tethering via the "net.tethering.noprovisioning=true" hack. This is what breaks the camera, yet tethering works fine. Geez, this was my entire purpose in rooting the phone and I have to choose between camera and tethering. Obviously camera wins. I'll see if I can find a thread with this issue.
[Moto G4 Plus Guides, News, & Discussion] echo92:
Have a look at this thread https://xdaforums.com/moto-g4-plus/help/wifi-tether-xt1625-t3543061

Similar scenario where the tethering prop affected the camera. Try the magisk module as suggested (obviously needs magisk to root).
[Moto G4 Plus Guides, News, & Discussion] varma.gnvs@gmail.com:
Mobile not Switching on

Tried above process after that mobile is not switching on
[Moto G4 Plus Guides, News, & Discussion] echo92:
Which above process do you mean, and by mobile not switching on, are you seeing a flashing white light or nothing at all?

If you were attempting to root, did you flash the elementalx kernel first before rooting?
[Moto G4 Plus Guides, News, & Discussion] varma.gnvs@gmail.com:
If you were attempting to root, did you flash the elementalx kernel first before rooting?[/no]

every time mobile is going to team win recovery project