yashsingh1/xdaforums huggingface dataset:
[Moto G4 Plus Guides, News, & Discussion] echo92:
Looks like this method appears to still work on the 93-14.4 update (e.g. https://xdaforums.com/showpost.php?p=71875244&postcount=123) and I've not seen any evidence that this method would not also apply to your XT1644.

Once you've flashed TWRP recovery (I'd suggest flashing the latest build you can find for athene devices, either the official 3.1.0 build https://dl.twrp.me/athene/ or one of shrep's TWRP builds, which are stable: https://xdaforums.com/moto-g4-plus/development/recovery-twrp-3-0-2-r3-moto-g4-g4-plus-t3494337), backed up your system, and completed flashing ElementalX, I'd recommend to wipe cache and Dalvik (not data, nor internal storage), then reboot at this point, just to check your device still boots properly. It should do, but as with a cache/Dalvik wipe, your device will take time to set up everything.

Then, reboot to TWRP (you may wish to obtain a TWRP backup at this point) and flash SuperSU v2.79 SR3 beta, then reboot. You'll likely have one automatic reboot as SuperSU sets up (and indeed warns you of at the completion of the SuperSU flash), then your device should reboot properly and you should have root access.

Just ensure you don't directly flash SuperSU without a custom kernel in place and you should be okay. Oh, and by doing any of this, your warranty will be voided (as you need an unlocked bootloader).

As always, ensure you have a back up, have plenty of time to flash and good luck :)
[Moto G4 Plus Guides, News, & Discussion] WTF?:
How should I answer the initial question in TWRP about leaving the system read only (since Elemental modifies /boot, rather than /system) - and any other questions I should know the answer to in advance?
[Moto G4 Plus Guides, News, & Discussion] echo92:
Probably best to 'swipe to allow modifications' in TWRP, as though you're modifying the boot partition as you mentioned, might be worth giving that you may want to flash other software in TWRP in future.

As for other things to be aware of, here's a few I can think of:

As usual with flashing, ensure you've got a decent charge on your device. Preferably 60% or more since TWRP will drain a fair bit whilst running.

Ideally, download the elementalx kernel and your root manager to your device directly, to minimise the chances of a corrupted file (e.g from copying it across to your device). You may wish to use a file browser app (e.g. amaze) to check the md5 checksums match that provided by the download sites, to check if your download is okay.

Unlocking your bootloader will also, in addition to voiding your warranty, wipe your device. Back up accordingly before wiping. Also, by unlocking your bootloader, flashing a custom recovery and root, your device's physical security is weakened (not sure if encryption can still be used on rooted devices). I think you can still remotely wipe your device if it's lost/stolen.

When flashing TWRP onto your device via adb, the message 'image not signed or corrupted ' will appear. That's normal because we're flashing an unsigned recovery image. So long as the flash reports [okay], then you'll want to reboot to recovery after flashing (don't reboot to system else the stock recovery will overwrite TWRP. Booting back to recovery prevents this). Subsequent boots then should be as normal.

If your device does decide to take a long time to boot (e.g. 15+ minutes) after flashing then you may wish to hold the power button for about 2-3 minutes. Your device should then shut down, in which case, hold down both the power and volume down keys when turning your device back on. That key combination should let you boot back to your boot loader and then you can boot back to twrp. You may wish to wipe caches and dalvik before rebooting this time... Also, appears that power and volume up will execute a forced reboot too https://mobilesupport.lenovo.com/us...roid-series/moto-g-4th-gen/documents/MS110630

As you've probably been mentioned, updating with OTAs is a no-go with root, custom recovery and kernel in place. Either revert back to stock using the fast boot ROM

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

or if you want to keep TWRP, you could flash Revivor, a custom ROM based on the latest stock ROM we've got. I imagine tywinlannister7 will keep it updated as new updates come out, saving you having to revert. :) https://xdaforums.com/moto-g4-plus/development/rom-npjs25-93-14-4-deodexed-debloated-t3587180 of course, with both approaches, be aware you'll need to back up.

Still, good luck with rooting your device :)
[Moto G4 Plus Guides, News, & Discussion] WTF?:
OK, this method worked great on USA unlocked XT1644 with newest 93-14-4 OTA loaded in advance. Thanks to all who helped.

I want to freeze some Moto/Google bloatware, which works best on Nougat? - Link2SD (my previous favorite) or Titanium Backup Pro, or something else? Keep in mind I have latest Nougat stock ROM with Elemental X kernal at this point. I don't care about cost of app, I care about reliability of freeze & unfreeze.
[Moto G4 Plus Guides, News, & Discussion] bullfinch110:
Try sdmaid pro.
[Moto G4 Plus Guides, News, & Discussion] rajatgupta1998:
Try Magisk Module : Terminal Debloater

https://xdaforums.com/apps/magisk/module-terminal-debloater-debloat-t3584163
[Moto G4 Plus Guides, News, & Discussion] mapalma:
Works perfect on Moto g4 (XT1621)
[Moto G4 Plus Guides, News, & Discussion] itasterix:
Works perfect on Moto g4

But I need to upgrade to the last android 7.0 patch version.

But It is not possible because it tell me upgrade failed.

I think it is because of the kernel.

How can I solve ?

---------- Post added at 10:48 AM ---------- Previous post was at 10:47 AM ----------

Read here:

https://xdaforums.com/showpost.php?p=67031810&postcount=5
[Moto G4 Plus Guides, News, & Discussion] echo92:
OTA updates require a stock system, kernel and recovery, any one of those being custom and the update may fail.

Use this guide as a checklist to check if you're unrooted and flashed the kernel (in boot.img) and the stock recovery https://xdaforums.com/moto-g4-plus/how-to/how-to-ota-rooting-nougat-npj-25-93-14-t3601747 of course, this will remove root, elementalx and TWRP.

If you obtain an error 7 after this, you may have to flash the stock fastboot ROM https://xdaforums.com/moto-g4-plus/how-to/moto-g4-plus-xt1640-43-athene-npj25-93-t3549369 you may be able to save your data by only using these commands, but as with anything, backup in case you have to full wipe:

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

Credit to toppits for the info.
[Moto G4 Plus Guides, News, & Discussion] Adarsh balu:
Is it working on xt1643
[Moto G4 Plus Guides, News, & Discussion] rajatgupta1998:
Check the OP man -_- You have yourself tested it. And yes this is the only method to root any of the G4s / Plus' on stock N.
[Moto G4 Plus Guides, News, & Discussion] Adarsh balu:
Yup...i just moved back to phh superuser and now i thought if it is a newr version....

After testing it again i found that flashfire is not working
[Moto G4 Plus Guides, News, & Discussion] echo92:
Seems that flashfire doesn't work with phh superuser - you'll likely need SuperSU (v2.79 SR3 beta for the timebeing) or magisk (latest is v12) for flashfire to work.
[Moto G4 Plus Guides, News, & Discussion] Adarsh balu:
Nop im talking about SuperSU (v2.79 SR3)...

I tried that not working
[Moto G4 Plus Guides, News, & Discussion] echo92:
Ah, okay - your post sounded like flashfire wasn't working under phh superuser.

What do you mean by not working? Did you have a clean system (or at least removed any old root managers by uninstalling or flashing a stock boot.img) before flashing SuperSU?
[Moto G4 Plus Guides, News, & Discussion] Adarsh balu:
Yes..

I'll say it asks for root permission which i granted...

After checking it just goes off

It just closes when i reopen it same thing happens

---------- Post added at 02:49 PM ---------- Previous post was at 02:43 PM ----------

Why is supersu at beta now...

We should have it already...

I'm kind of fed up with phh superuser...it doesnt support so many apps...

I'm just temporarily using it due to unavailability of Supersu...
[Moto G4 Plus Guides, News, & Discussion] echo92:
I don't understand what you mean by unavailablity of SuperSU? We've had both stable and beta releases of SuperSU for a while, and I've been running the v2.79 SR3 beta for a while, showing itself to be stable. I'm just suggesting SuperSU v2.79 SR3 beta for the time being since the stable v2.80 and v2.81 releases appear to have bugs: https://xdaforums.com/showpost.php?p=72428986&postcount=1645 You're more than welcome to flash the latest stable versions, however if you wish.

As for the permissions and force-closing issue, if you can repeat it on a clean system (or at least one where you've uninstalled phh superuser app, then flashed your unrooted stock kernel before reinstalling Elementalx and SuperSU), then may be worth reporting it with logs on the flashfire thread: https://xdaforums.com/general/paid-software/flashfire-t3075433
[Moto G4 Plus Guides, News, & Discussion] Adarsh balu:
Im sure I've done it in a clean system...
[Moto G4 Plus Guides, News, & Discussion] echo92:
Though now phh superuser has been flashed as you previously mentioned, there's no point getting logs to help troubleshoot whatever issue was experienced with flashfire whilst on SuperSU, hence asking if you can repeat flashing flashfire and SuperSU on a clean system with ElementalX (probably also including a data wipe) or alternatively by restoring your clean stock kernel then reflashing ElementalX.
[Moto G4 Plus Guides, News, & Discussion] Adarsh balu:
I had a twrp backup before flashing ex kernel and superuser .... I went back using that and then flsahed ex and SuperSU...

Edit: Solved it.I installed the lastest version of flashfire that solved the force closing problem :D
[Moto G4 Plus Guides, News, & Discussion] Adarsh balu:
This link to EX kernel is v1.02 and there is v1.04 available..Has anyone tried that

Is it good...

I found it in the EX kernel manager app
[Moto G4 Plus Guides, News, & Discussion] SoNic67:
I am using the EX kernel 1.04 since it was posted in his thread. And root only with the SuperSU v2.79 SR3 beta (systemless mode), I have tried the other options mentioned in this thread and none where stable enough.
[Moto G4 Plus Guides, News, & Discussion] echo92:
As SoNic67 also mentioned, I was using v.104 with SuperSU v2.79 SR3 beta, whilst on the NPJ25.93-14 Dec 2016 build and found it stable too. I doubt that flar2 would release a kernel that wasn't stable :)
[Moto G4 Plus Guides, News, & Discussion] Adarsh balu:
So i just flash it over the older ex kernel from twrp ??
[Moto G4 Plus Guides, News, & Discussion] echo92:
That should work, and also should preserve root - you may wish to wipe caches and Dalvik after flashing, before you reboot.
[Moto G4 Plus Guides, News, & Discussion] Adarsh balu:
Yup.Thanks mate

One thing that troubles me is that the ota update of 40 mb after the nougat is not working well with flashfire
[Moto G4 Plus Guides, News, & Discussion] EkisDeMX:
Thanks

Works in XT1641:D:good:
[Moto G4 Plus Guides, News, & Discussion] danilomrx:
It works with LineageOS 14.1 too or just stock 7.0?
[Moto G4 Plus Guides, News, & Discussion] echo92:
What are you asking, are you asking if these steps are required to root on Lineage OS or are you asking if SuperSU works on Lineage OS?

If it's the first question, no - Lineage OS has support for root, but you need to flash a root manager to gain root on Lineage OS. You can opt to flash ElementalX on LineageOS if you choose, if you wish.

Following on from that, and answering the second question too, you can flash either the su-arm-addon from the Lineage Extras page (link: https://download.lineageos.org/extras), or SuperSU or magisk. Either of these will give you root. Bear in mind that if you wish to switch root managers, you have to uninstall the old manager before flashing the new manager - you may run into issues otherwise.

This guide is mainly for rooting the stock ROM (and as far as i know, a reliable method of rooting on stock).
[Moto G4 Plus Guides, News, & Discussion] heyo111:
Fingerprint works normally?
[Moto G4 Plus Guides, News, & Discussion] echo92:
Yes, I'm on the March update stock ROM (NPJS25.93-14.4), rooted with ElementalX v.104 and magisk v12, and my fingerprint sensor works with unlocking and locking the sensor - with a long press - as normally. When flashing the ElementalX kernel, I did not select 'Use Fingerprint Sensor as Home' (so letting the system handle the sensor).
[Moto G4 Plus Guides, News, & Discussion] aniketjain:
The root was successful. I am still on stock android and EX. Although I am facing lag and major slow down issues while playing games that worked fine previously or while running multiple applications(I couldn't snap while running G maps and online radio app :( ). I suspect the EX kernel is tweaked to not handle heavy performance. Is there a possibility of reverting to stock kernel? Or any other solution?
[Moto G4 Plus Guides, News, & Discussion] echo92:
If you're reverting to stock kernel, you cannot root (trying to root the stock kernel may trip the anti-root protection and result in your device failing to boot). If you've followed the guide, you should be able to revert by flashing the TWRP backup you've taken prior to flashing ElementalX. This will revert your device to when you took the TWRP backup, so any messages you've received since then will be wiped - back up to cloud or use Titanium Backup to preserve your app data, then restore after you've reverted to the previous backup.

Alternatively, if you wish to keep your data, you need to unroot (search for the appropriate unrooting method for your particular root manager), then reboot to TWRP and re-flash your backup of the stock boot partition (either just the boot partition from your full backup or the standalone backup - we're not flashing the full backup in this method!). That should revert your system back to stock kernel, wipe Dalvik and cache, then reboot.

Did you wipe cache/Dalvik as mentioned in the guide when you rooted?

Alternatively, you could try tweaking the ElementalX kernel by downloading either EX Kernel Manager or Kernel Adiutor - either app will allow you to tune the kernel as you wish. With EX Kernel Manager, for example, you could set the CPU governor to performance, so the CPU is at maximum speed (at the cost of battery).

A few things to watch out for on the kernel manager:

You may wish to disable zRAM (usually under the memory category) - see if turning off the memory compression improves the lag.

If the kernel manager has a CPU usage monitor, is CPU usage normal or is something using a lot of CPU at idle (>=20 %, for example, on a constant basis)? If so, you may wish to close all your apps and open them one by one, see if an app is misbehaving with the new kernel or maybe now wants root access?

You could check what CPU cores are active on ElementalX and tweak which ones are on (though bear in mind the more cores online, the more battery drain you'll experience).

I don't game, so anyone else with suggestions is free to chime in. You could try the other custom kernels (but you'll need to re-flash the stock - in this case, the Motorola - kernel before changing, don't directly change between custom kernels!).
[Moto G4 Plus Guides, News, & Discussion] Mohitpahariya1:
Help Please. While try to flash twrp through bootloader i am facing some errors kindly help. I am using twrp 3.0.2-0 athene

here is the logs of cmd window.

C:\Program Files (x86)\Minimal ADB and Fastboot>adb reboot bootloader

C:\Program Files (x86)\Minimal ADB and Fastboot>fastboot flash recovery twrp-3.0

.2-0-athene.img

(bootloader) slot-count: not found

(bootloader) slot-suffixes: not found

(bootloader) slot-suffixes: not found

(bootloader) has-slot:recovery: not found

target reported max download size of 536870912 bytes

sending 'recovery' (12496 KB)...

OKAY [ 0.400s]

writing 'recovery'...

(bootloader) Image not signed or corrupt

OKAY [ 0.192s]

finished. total time: 0.598s

C:\Program Files (x86)\Minimal ADB and Fastboot>

---------- Post added at 08:49 AM ---------- Previous post was at 08:46 AM ----------

Hello,

Kindly share the video. I am waiting for your video about how to root step by step.
[Moto G4 Plus Guides, News, & Discussion] echo92:
That 'error' message you encountered is normal - as long as the command finished with [OKAY], which it did. You'll want to reboot into recovery after flashing TWRP, to ensure TWRP is set as the recovery. If you try to reboot to system, the stock recovery will replace TWRP. Once you've rebooted to recovery once, then you can reboot as normal.

P.S - you may wish to use the search bar at the top, you may find your questions answered https://xdaforums.com/showpost.php?p=72198344&postcount=31
[Moto G4 Plus Guides, News, & Discussion] w98linux:
Can anyone please help me?

I rooted my Moto G4 Plus and after that I did factory reset my phone. The phone was unable to boot and was constantly going to twrp. After that I went into bootloader and booted my device with the help of Factory mode. Root checker showed this message "sorry root access is not properly installed on this device" So, like a noob I went into twrp again and installed ElementalX & superuser again. Everything was fine but I did not gain root access.

After that again I went to twrp and skipped re-installation of ElementalX and just installed superuser. Now, the phone wont boot it just vibrates for like 5 seconds and reboots then vibrates for 5 seconds. All I can do is go into bootloader. PLEASE HELP!
[Moto G4 Plus Guides, News, & Discussion] w98linux:
Hey!

Thanks for all the help man.

As you have suggested in Option 4. I want to flash stock ROM and start from scratch. I dont have any data on the internal storage so, I'm least concerned about that. I did root my phone on the first attempt but I did factory reset my phone after rooting and it started giving me problems. I was able to boot and in root checker app displayed "sorry root access is not properly installed on this device".

Would it be safe to flash stock ROM?

Thanks again for all the help :)
[Moto G4 Plus Guides, News, & Discussion] echo92:
I'd agree that flashing the stock ROM again would be the safest option, since we don't know what's causing the root to fail - especially since you got it working, and then something happened on the factory reset. What SuperSU and ElementalX versions are you using? Alternatively, option 3 (flashing the TWRP zip of the stock) may well get you a near stock ROM without having to reflash TWRP, plus it'll give you a clean stock kernel too.

So if you want to try rooting again (with the stock ROM/TWRP flashable):

Flash stock ROM (check it's not flashing with the locking commands and GPT/bootloader) either via fastboot or using the TWRP flashable. If with the TWRP flashable, wipe cache, Dalvik and data.

Reboot. Set up your device.

Reboot to bootloader. Flash TWRP via bootloader (I find shreps' TWRP to be very stable, though you are free to use other TWRP builds. Link for shreps' TWRP https://xdaforums.com/moto-g4-plus/development/recovery-twrp-3-0-2-r3-moto-g4-g4-plus-t3494337 ).

Reboot to TWRP (to ensure the TWRP sticks - subsequent boots you can boot as normal).

Backup your system (in full).

Flash ElementalX v1.04 stock. Wipe Dalvik/cache. Reboot to system - check it's working.

If all looks good, flash your root manager of choice (either SuperSU 2.79 SR3 beta or higher, think 2.82 is the latest SuperSU OR flash magisk v12 /v13 beta - don't mix SuperSU and magisk without a full uninstall and reflash of a clean boot.img).

More info here: https://xdaforums.com/showpost.php?p=72496111&postcount=270

Good luck either way :)
[Moto G4 Plus Guides, News, & Discussion] w98linux:
Ok I'll give Option 3 a try. My ElementalX is v1.04 and I'm not sure with superuser version. Can I please get a step by step process for Option 3 that'll be helpful. Thanks :)
[Moto G4 Plus Guides, News, & Discussion] w98linux:
I used option 4 and I'm back into the OS.

Is it safe to root again?? Also, should I use SuperSU 2.82 SR1 because i cannot find SuperSU 2.79 SR3
[Moto G4 Plus Guides, News, & Discussion] echo92:
Which OS did you flash? If you flashed NPJS25.93-14.4 (March 2017), you should be okay to root. NPJ25.93-14 is also rootable, though the improvements in battery brought by the March 2017 patch are perhaps worth updating to prior to rooting (as once you've rooted you cannot install OTA updates without reverting the changes).

SuperSU 2.82 SR1 should be okay (looks like it replaced SuperSU v2.79 SR3 beta in the beta thread), or https://xdaforums.com/apps/supersu/stable-2016-09-01supersu-v2-78-release-t3452703 for SuperSU 2.82 if you want to flash a stable release. Up to you, both root managers should suffice.

Root as per the guide in the first post or in the guide I've updated to cover both SuperSU and magisk. https://xdaforums.com/showpost.php?p=72496111&postcount=270 Basic procedure for both guides is the same - flash TWRP athene (I prefer shreps' as mentioned above), back up in TWRP, flash ElementalX, wipe cache/Dalvik, reboot to system. Reboot to TWRP, backup again, flash your root manager, reboot.

I've rooted my XT1642 with either guide without issue (I'm currently on NPJS25.93-14.4 with ElementalX and magisk v13 as the root manager). If you need to reset your system, try re-flashing the TWRP backups that you made if you were following the guides (preferably restoring a backup with the ElementalX kernel) first.

As an aside to your earlier question, I was testing the TWRP flashable and it does work - you flash as a normal zip in TWRP and it'll give you a clean install of NPJS25.93-14.4. Might be worth downloading and keeping handy somewhere for an emergency.
[Moto G4 Plus Guides, News, & Discussion] w98linux:
Thanks a lot for all the help once again

Successfully rooted my phone and its working absolutely fine now.
[Moto G4 Plus Guides, News, & Discussion] ritikag:
its working fine..thanks a lot..
[Moto G4 Plus Guides, News, & Discussion] erickbm12:
I followed the instructions but then, when the phones restart it shows black screen, it is turned on but the screen do not shows anything. What can I do?
[Moto G4 Plus Guides, News, & Discussion] echo92:
At what point did you restart (e.g. was it after flashing ElementalX or was it after flashing SuperSU)?

If you hold the power button down for 2-3 minutes, can you force a hard restart, to allow you to reboot?

What OS and what device are you attempting to root?
[Moto G4 Plus Guides, News, & Discussion] Adge40:
Hi all,just a quick question,I've installed shreps 3.1.1. Twrp, I've then installed ex kernel on my nougat 7.0 stock xt1622,do I have to type command systemless = true or can I just go head and flash sr3 root??,thx in advance
[Moto G4 Plus Guides, News, & Discussion] strongst:
You don't need to type anything. The line on op that you mean is inside a config file. Just flash su 2.79 sr3 and all ok.
[Moto G4 Plus Guides, News, & Discussion] Adge40:
[MENTION=613506]strongst[/MENTION]

Once again,thank you