yashsingh1/xdaforums huggingface dataset:
[Moto G4 Plus Guides, News, & Discussion] rahul8074:
NPJS25.93-14-13 Dec 1 2017 g4 plus 32 gb xt1643
[Moto G4 Plus Guides, News, & Discussion] echo92:
Thanks, can I ask what TWRP are you using? I've had good success rooting with shreps' TWRP 3.1.1 from here: https://xdaforums.com/moto-g4-plus/development/recovery-twrp-3-0-2-r3-moto-g4-g4-plus-t3494337

Hmm, the method you've used should have worked, from what you've described, flashing ElementalX first and then SuperSU is the correct order. I don't think you need to add the 'echo systemless' command as that should be included in 2.82.

Though, firstly, let's get your device working:

1)Flash the stock ROM from here: https://xdaforums.com/moto-g4-plus/how-to/stock-rom-npjs25-93-14-4-march-1-t3608138 . You can use the following commands to keep your data, and won't re-flash your GPT, bootloader or modem:

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 erase cache
fastboot reboot

2)If your device reboots properly, then flash or boot TWRP. Up to you which version but as I mentioned above shreps' 3.1.1 TWRP should work well.

3)Back up as before.

4)Flash ElementalX 2.0 and reboot, test if your device is still working.

5)If it's still working, you could try flashing SuperSU 2.82 SR5 (rather than the stable 2.82) https://xdaforums.com/apps/supersu/2014-09-02-supersu-v2-05-t2868133 or magisk 15.4 https://xdaforums.com/apps/magisk/beta-magisk-v13-0-0980cb6-t3618589 magisk is currently the more frequently updated root manager, and has built in support to hide root from various anti-root detection methods.

I'm currently stably rooted with this method using shrep's TWRP 3.1.1 and ElementalX 2.0 with magisk 15.3, so I'm not entirely sure what's happened with your device, unless there was a previous root attempt without flashing the custom kernel first?
[Moto G4 Plus Guides, News, & Discussion] rahul8074:
Yes the first time I forgot to flash custom kernel, then it started booted into twrp, I flashed stock rom of dec 1 2017 using fastboot and was back on stock rom. should I follow the same steps again or do something for ( first time I forgot to flash custom kernel )
[Moto G4 Plus Guides, News, & Discussion] echo92:
Yeah, if you forget to flash the custom kernel then root on the stock ROM, it seems that every subsequent boot may fail until you re-flash the stock ROM. It appears that you trip some anti-rooting protection built into the stock kernel, which causes your device to fail to boot, hence why we need a custom kernel without said protections.

Now you've got back to the stock ROM, follow the same steps: flash TWRP, then ensure you flash ElementalX 2.0 next. Then you can flash either SuperSU or magisk. Chainfire has retired from SuperSU development so you may elect to flash magisk. For rooting on G4/Plus devices, the general order for stock Nougat has been the same - TWRP, then ElementalX or another custom kernel, then root.
[Moto G4 Plus Guides, News, & Discussion] rahul8074:
Great! this comination worked.. really appreciate the effort. thanks man!!

:)
[Moto G4 Plus Guides, News, & Discussion] ibrahim haleem khan:
Hey please direct a link to original Guide

Link please

---------- Post added at 03:29 AM ---------- Previous post was at 03:02 AM ----------
[Moto G4 Plus Guides, News, & Discussion] jksyankeesrock:
How can I backup my device prior to unlocking the bootloader ?
[Moto G4 Plus Guides, News, & Discussion] disguisedview:
For apps you can try "Helium - App Sync and Backup": https://play.google.com/store/apps/details?id=com.koushikdutta.backup&hl=de

But it doesn't work for all apps...

For SMS and contacts you can use for example "MyPhoneExplorer": https://play.google.com/store/apps/details?id=com.fjsoft.myphoneexplorer.client&hl=de

You need the app on your phone and the program on your PC: http://www.fjsoft.at/de/
[Moto G4 Plus Guides, News, & Discussion] jsoue:
Just quick review, i did the process with Magisk/SU but the phone dies after i flash the zips(1° with Magisk/SU and then flash ElementalX) and need to flash stock boot, any solutions for this?

PD: Stock N, Stock Kernel, TWRP3.1 x64
[Moto G4 Plus Guides, News, & Discussion] echo92:
If you can get your device working again, you need to flash ElementalX first then flash SuperSU/magisk. You cannot root on the stock Motorola kernel with Nougat - you'll just experience boot failures.

So:

Flash/boot into TWRP.

Back up (or if your backup is current, you may wish to skip this step)

Flash ElementalX

Flash SuperSU/magisk.

Wipe cache/Dalvik.

Reboot.
[Moto G4 Plus Guides, News, & Discussion] sameersti:
Hi,

Recently I got & install OTA for Feb1. I have non rooted stock XT1643.

Can I root this phone by your procedure using latest twrp-3.2.1-0-athene, ElementalX-G4-2.00 & Magisk-v14.0

I have not rooted this phone ever.
[Moto G4 Plus Guides, News, & Discussion] strongst:
Yes, procedure is the same, but please use latest twrp, ex kernel and magisk
[Moto G4 Plus Guides, News, & Discussion] sameersti:
I have found following version as latest :

TWRP: twrp-3.2.1

Ex Kernal: 2.0

Magisk: v16.0

So do i need to use these version only or any previous version.
[Moto G4 Plus Guides, News, & Discussion] antraaddy:
Hi.

I tried all the steps as mentioned but after insatlling Superuser through TWRP, my screen turns black and there's a blinking near the fingerprint unlock area.

Can anyone tell whether my phn is rooted or not?

Thanks in advance.
[Moto G4 Plus Guides, News, & Discussion] strongst:
You can use these versions.

Please give detailed instructions what steps did you take. Read again maybe you missed something.
[Moto G4 Plus Guides, News, & Discussion] antraaddy:
I didn't miss anything. I cross-checked every single step. AFter step 6, it got stuck. Followed the latest twrp release too.
[Moto G4 Plus Guides, News, & Discussion] strongst:
Did you use supersu or magisk? Magisk is a way better in lot of terms
[Moto G4 Plus Guides, News, & Discussion] echo92:
Did you flash ElementalX or vegito (for stock ROMs) before rooting?
[Moto G4 Plus Guides, News, & Discussion] jeanalex:
Root G4 7.0 works well

I followed the steps to root and it's works well on my G4 XT1626 , android 7.0. Thank you.
[Moto G4 Plus Guides, News, & Discussion] sameersti:
Device not booting after above steps

Hi,

I have rooted my Moto G4 Plus as provided steps in this page.

First i boot twrp, then take backup, then flash Elemental kernal, then flash magisk 16.

Now when rebooting device, it is showing unlock screen then motorola logo and then black screen, not booting further?

What to do??
[Moto G4 Plus Guides, News, & Discussion] echo92:
1) reboot to TWRP and try wiping cache and dalvik, then reboot.

2) if that doesn't work, restore your back up in TWRP. Flash ElementalX. Wipe cache and dalvik then reboot. Does your device boot then?

3) if your device does boot, try rooting with magisk again (you do not have to use the echo systemless commands). Wipe cache, dalvik and reboot.

4) if your device still hangs on boot, re-flash the backup, then flash ElementalX and perhaps an earlier version of magisk (try 15.3).
[Moto G4 Plus Guides, News, & Discussion] sameersti:
Hi, I have tried to flash the backup created by TWRP, after successfull restoration, when restarted the phone again same issue appeared. means now my restored backup also not booting beyond moto logo? This backup was created just after flashing TWRP for the very first time.

I dont know what have happened. I tried to flash stock rom available here, but that was till Dec 1 patch and i have already february update installed, so i think bootloader is not gettin downgrade and i am not able to install that too. Now my phone is looking dead. However able to start bootloader and twrp.

So overall now I am not able to even flash stock ROM till Dec, as well as my own Backup is also not doing anything. Please help?
[Moto G4 Plus Guides, News, & Discussion] echo92:
Hmm, if you can boot to bootloader/TWRP, that at least is a good sign.

Did you try a factory reset or cache/Dalvik wipe in TWRP? Ensure your backup is somewhere safe (not on your device) before attempting this.

You can try re-flashing the NPJS25.93-14-15 stock ROM (though this link is not on the main page, several users have reported it works for them. As always, it's up to you to verify the firmware before flashing: https://xdaforums.com/showpost.php?p=76250128&postcount=753
[Moto G4 Plus Guides, News, & Discussion] reggiexp:
question can you relock bootloader?

since i got the phone from amazon refurbished. i dont really care but if i get a defective thing that i can send it back to amazon. i guess i need to relock it.

(got my unlock code)

i just unlocked my assu zenfone 2 also (gotta love phone who you can unlock by just typing 'unlock' in adb (or a lil tool kit 3 clicks and done)

this is all really easy compared to my **** xioami where they have unlocking problems since decemebner 2017... cant unlock my bootloader anymore seems a server probleme of there software anyway i guess im kinda done with xioami. (love my xioami redmi note 3 with the power full s650 :) ) but miui is just anoying AF :) the motorola g4 feels smoother even doh it only has 2gb ram. for some reason all the motorola on stock android work better then any other phone i have even with 3gb ram :)

anyway im going of topic sorry, just that for the moto unlock code was so easy also :)
[Moto G4 Plus Guides, News, & Discussion] echo92:
You can re-lock the bootloader - you will need the stock firmware of the same version or newer than your bootloader version (e.g. if you have B1:07 bootloader version, you will need either Dec 2017 or Feb 2018 firmware at least). Check if you need the retail or retail US firmware as well.

Also, re-locking will erase your data via the OEM lock commands - if you want a full flashing list, here's one: https://xdaforums.com/moto-g4-plus/how-to/stock-rom-npjs25-93-14-4-march-1-t3608138 If you are flashing over stock firmware, then also ensure you have OEM unlocking enabled in Settings>Developer Options.

Be warned though that requesting the unlock key voids your warranty, so you may have issues if you return the device to Amazon or are asking for a warranty repair. Re-locking your bootloader will not restore your warranty though you may be covered by local consumer laws (e.g. if your location is correct, you may be covered by EU consumer law and/or the French equivalent).. Your experience may vary.
[Moto G4 Plus Guides, News, & Discussion] reggiexp:
it's not new. and doesn't have warranty. it's a refurbished Amazon phone. (6months Amazon warranty and 30 days sending back ****) and they don't do repairs i the zenfone 2 who has ghost touches and one line across the screen that doesn't register touch but yeah sending it back will only give me my 57€ back. and not get a new phone. so that one i flashed custom rom and didn't help ****. still trying ot find hpw to fix it.

Anyway the Motorola works great. haven't found a bug or something but yeah with refurbished im always carefull. don't trust it xd

the Motorola dont really needs to flash a other rom. it works great but i like to flash ****. for the moto g4 i paid 55€ i think seems in a really good shape no scratches that i found.

i will flash the **** later till i know what im doing with the phone
[Moto G4 Plus Guides, News, & Discussion] sameersti:
Let me give it a try, then will told you.
[Moto G4 Plus Guides, News, & Discussion] CMKdaGreatest:
I can't flash recovery image using power shell in windows 10 pro. It keeps showing "waiting for device". What should I do?
[Moto G4 Plus Guides, News, & Discussion] strongst:
It's working with power shell the same way. I did it too. Make sure your device drivers are the right one, firewalls are down, driver signature verification is off.

Attached a screenshot where I flashed stock rom ;)
[Moto G4 Plus Guides, News, & Discussion] Eduardo27:
Can I root using magisk, as SuperSU is officially dead ??
[Moto G4 Plus Guides, News, & Discussion] strongst:
Sure, just use Magisk instead of supersu :good:
[Moto G4 Plus Guides, News, & Discussion] ajdee:
is't same guide tom to [ROOT] [GUIDE] Root Moto G4 (Plus) with SuperSU on Android 7.0 (NPJ25.93-15)

and can install this rom ATHENE_NPJS25.93-14-18_cid50_subsidy-DEFAULT_regulatory-DEFAULT_CFC.xml on my moto G4 XT-1622
[Moto G4 Plus Guides, News, & Discussion] strongst:
Yes for the first question and yes for the 2nd question.
[Moto G4 Plus Guides, News, & Discussion] jaspreet0589:
did you root your device using this method ?

is it easy to root my moto g4 plus using this method ?
[Moto G4 Plus Guides, News, & Discussion] echo92:
It's straightforward to root on the G4/G4 plus with this method, just be aware that you will wipe your data when you first unlock your bootloader (and void any warranty usually), and that you need to flash a custom kernel before rooting if your device is on stock Nougat.

Also, you do not need root if you want to flash custom ROMs, you just require the correct TWRP recovery and an unlocked bootloader to flash custom ROMs.

I'm rooted on the April 2018 security patch stock firmware with ElementalX 2.0.1 and magisk 16.1 (instead of SuperSU) following this method and it's a stable root.
[Moto G4 Plus Guides, News, & Discussion] reggiexp:
euh,

it says my device is not qualified to unlock..
[Moto G4 Plus Guides, News, & Discussion] echo92:
What device do you have, is it carrier locked? Can you post your getvar all info here please?

To get your getvar info:

1)Boot your device to the bootloader, connect to your computer via the original USB cable or a high quality USB data cable.

2)Open up Minimal ADB, confirm you can communicate with your device by typing and entering 'fastboot devices' without quotes.

3)If you get a serial number response, then enter 'fastboot getvar all' without quotes and press Enter.

4)Post the output here - you may wish to remove your IMEI.
[Moto G4 Plus Guides, News, & Discussion] reggiexp:
thanks for the reply just got it lol

for some reason i had the code with enter between every line that i forgot to remove i put i all in onr line and it worked.

just got it unlock pretty easy with Motorola.
[Moto G4 Plus Guides, News, & Discussion] Bandeet:
no twrp for motog4?
[Moto G4 Plus Guides, News, & Discussion] strongst:
Moto g4 uses the same twrp like g4 plus.
[Moto G4 Plus Guides, News, & Discussion] sanibel686:
Hi guys I have a moto G4 which is 2 years and 2 weeks old. I am desperate to have my call recording app reinstated after the software upgrades that stopped people running these apps. I understand that I need to get the phone rooted so that call recording will work but it is beyond my technical ability I live in Sunderland in the north east of England and I was wondering if there were any members local to me who would be prepared to root my phone. I am happy to pay or provide beers etc all the best
[Moto G4 Plus Guides, News, & Discussion] echo92:
Whilst I'm not near Sunderland, may I ask what you're having difficulty with with respect to rooting? Perhaps we can elaborate on some of the instructions here.
[Moto G4 Plus Guides, News, & Discussion] sanibel686:
Hi Echo and thanks for getting back to me, my technical ability is stretched at finding open software to open a zip file for free! I have looked at the threads on rooting but what scares me is commentary when people say they bricked their phone then others jump in with stuff like "oh yes it doesn't work on that version try this instead" etc,

I'm more than happy to provide my imei number and software version. I am reasonably savvy and I can follow instructions like a trained monkey if they are comprehensive but I can't join the simplest of dots if there is a gap!

To be clear if there is a simpler way to get call recording functioning again ill do that instead because really thats all I need my phone rooted for

Cheers
[Moto G4 Plus Guides, News, & Discussion] BrentskyB:
Hi Echo, You helped me a few months back to fix my 16GB Moto G4 that wouldn't do self updates. Does this rooting process work on 7.1.2 on a G4 XT1625 with unlocked bootloader ? Thank you !!
[Moto G4 Plus Guides, News, & Discussion] echo92:
Hi, sorry about the late reply. If you're running Android 7.1.2, I'm guessing you're running a custom ROM since the stock ROM was only on 7.0? If so, you'd have to look up the custom ROM's rooting methods. However, the majority of the custom ROMs have a kernel suitable for rooting without having to do any of the above, so you should be able to directly root.

The reason for the above steps is that the Motorola stock Nougat kernel comes with anti-rooting measures (I think dm-verity?), thus necessitating a kernel replacement with a custom kernel that did not have those anti-rooting measures. Custom ROMs typically do not come with these measures in their kernel.
[Moto G4 Plus Guides, News, & Discussion] jerryspring:
after flashing, it wont boot. all i can do is access bootloader
[Moto G4 Plus Guides, News, & Discussion] echo92:
What device are you flashing to and which firmware are you running?
[Moto G4 Plus Guides, News, & Discussion] jerryspring:
Edit. I fastboot OEM unlock. Thanks. I forgot to wipe system
[Moto G4 Plus Guides, News, & Discussion] echo92:
I'm guessing you're using a different device to a Moto G4/plus, since rooting on stock Nougat G4 plus firmware usually doesn't involve wiping system...?
[Moto G4 Plus Guides, News, & Discussion] jerryspring:
Yes. On 7.0
[Moto G4 Plus Guides, News, & Discussion] echo92:
Okay, these steps should work on a Motorola G4/Plus (2016) - I've no idea if they'll work on other devices running Nougat (and looking at your post history, I see a variety of devices including a Note 4 and One X). Our Moto G4/Plus on stock Nougat (running the hudsoncm kernel) requires a custom kernel (e.g. ElementalX) to be able to root. These custom kernels are device specific usually, so these tips on another device may not work.

Without knowing what device you're trying to root, I don't know where to point you for more device specific assistance.
[Moto G4 Plus Guides, News, & Discussion] jerryspring:
I figured it out. I forgot to wipe system.. Moto g4 plus
[Moto G4 Plus Guides, News, & Discussion] Chaitanya Vaishampayan:
works for Moto G4 (not plus) XT1624. confirmed myself.
[Moto G4 Plus Guides, News, & Discussion] srinivasmurthy9597:
Motorola G4 plus Oreo 8.1

Can we try the same process to root my Moto G4 plus running Android Oreo 8.1 official??
[Moto G4 Plus Guides, News, & Discussion] HeethJain21:
just flash the latest magisk zip and you will be good to go
[Moto G4 Plus Guides, News, & Discussion] echo92:
In addition to heeth21's reply, on stock 8.1, a custom kernel is optional to root.

The general process would be:

1) unlock your bootloader (will wipe your device in the process)

2) Flash or boot TWRP (the official 8.1 stock firmware is 32 bit, so the official TWRP, shreps's TWRP for example should be good.

3) back up your device in TWRP (including boot, your kernel partition)

4) [OPTIONAL] Flash a custom kernel

5) Flash magisk

6) wipe cache and reboot.

7) if your device boots, install the magisk manager app
[Moto G4 Plus Guides, News, & Discussion] ALPH000:
Oreo stock kernel is rootable unlike nougat stock kernel.

I will not recommend ElementalX for rooting Oreo.

When flashed magisk on ElementalX 3.01, phone may not boot up.

Stock kernel is best unless you don't want to tweak with frequency of cpu.
[Moto G4 Plus Guides, News, & Discussion] echo92:
Hmm, I'm not sure what the issue with your device is, I've just got my G4 Plus rooted with magisk and ElementalX 3.0.1 and I've booted.

Setup - G4 Plus, retgb, updated to OPJ28.111-22

Unlocked bootloader.

Back up in TWRP (using shrep's TWRP 3.1.1 32 bit https://xdaforums.com/moto-g4-plus/development/recovery-twrp-3-0-2-r3-moto-g4-g4-plus-t3494337 )

Flash ElementalX 3.0.1.

Flash magisk 19.3

Wipe cache and Dalvik

Reboot.
[Moto G4 Plus Guides, News, & Discussion] AniLeo:
Thanks a lot.. was stuck in bootloop with other method..

So, now i'm in stock ROM with SuperSU 2.79, I wish to migrate to Magisk

How can i do that without getting stuck in bootloop??

Is using Magisk with Stock ROM Okay???
[Moto G4 Plus Guides, News, & Discussion] echo92:
Which stock ROM are you running?

Generally, to switch root without bootlooping or possible further issues, you will need to unroot (using unSU https://xdaforums.com/showpost.php?p=63615067&postcount=2437 ) then flash a clean stock kernel (either from a backup of the same firmware or from a boot.img). The clean kernel should remove traces of root.

If you're still running stock Nougat 7.0, you will then need to flash ElementalX 2.0.1 for stock Nougat, then flash magisk. If you're running stock Oreo 8.1, you can flash magisk onto the stock kernel. Clear cache, then reboot.
[Moto G4 Plus Guides, News, & Discussion] disguisedview:
Yes. But you also have to install custom kernel.
[Moto G4 Plus Guides, News, & Discussion] LionLorena:
And having that I can reLock my bootloader afterwards?
[Moto G4 Plus Guides, News, & Discussion] disguisedview:
I'm not sure, but i would say you shouldn't relock your bootloader afterwards...
[Moto G4 Plus Guides, News, & Discussion] LionLorena:
Why? I mean, if Im having the stock firmware, and its all working as it should.

I know that with custom recovery I cannot relock because it will bootloop and I will be unable to flash a solution.
[Moto G4 Plus Guides, News, & Discussion] rajatgupta1998:
There's no point of returning to stock recovery. And for re-locking the bootloader and/or taking system OTA updates, the best is to use the fastboot method. :good:
[Moto G4 Plus Guides, News, & Discussion] echo92:
Ah, your system won't be stock as you've flashed a custom kernel in order to root, so your relocked bootloader may well detect that you have an unsigned kernel (in boot.img) and fail to boot. This is, as far as I can tell, one of the security features enforced in Nougat - only signed (i.e from Motorola) kernels, recoveries and systems will be permitted to boot with a locked bootloader.

If you wanted to relock, you'd have to:

Unroot.

Flash your stock kernel back (either from booting into TWRP, flashing the boot.img from a previous backup or extracted from a fastboot file).

Assuming you've been booting into TWRP via fastboot (and not flashed TWRP onto your device) - so you've still got stock recovery, you may be able to re-lock, but as you'll notice, you'll effectively be back at stock firmware (stock kernel, stock recovery, stock system) without the root you want. Besides, as tywinlannister7 mentioned, the easiest way to re-lock is to flash the fastboot ROM anyhow (that is, if you've not updated to the 1st March 2017 security update - if you have, we don't have access to the latest firmwares).
[Moto G4 Plus Guides, News, & Discussion] LionLorena:
Yeah, in this case the point of relocking the bootloader was to prevent unauthorized flashing, let's say, by a thief.
[Moto G4 Plus Guides, News, & Discussion] WTF?:
I have brand new XT1644 - I already have NPJ25.93-14-4 OTA loaded, will this root method still work? - would like to hear from anyone who has this config.

do I reboot between the flash of Elemental and SuperSU?