[GUIDE] How to root Nougat on Moto G4 Plus [UPDATED for NPJ25.93-11/12/14]

Search This thread

stevcho91

Member
Aug 21, 2017
5
0
Yeah, the opening post should really mention that regardless of what build you have, stock Nougat on Moto G4 requires a custom kernel to root without issue.

So you've booted your device to TWRP (leaving it on the TWRP main menu), and yet you don't see your device when you've connected it to your computer via USB? Have you got the minimal adb/fastboot drivers on your computer still (I assume so as you've installed TWRP)? Can you take your SD card out and try booting again?

If you can't see your internal storage, you may wish to try re-flashing the stock ROM. I don't know what build you had previously, though the latest stock ROM is the June 2017 stock ROM: https://xdaforums.com/moto-g4-plus/how-to/stock-rom-npjs25-93-14-4-march-1-t3608138 If you can remember your stock ROM security patch level or build, we could give you more tailored advice, or you may wish to flash the latest stock ROM anyway.

Assuming that you have adb/fastboot still:
Reboot your device to the bootloader.
Attach your device to your computer
In the adb terminal, verify your device is communicating by typing 'fastboot devices' in adb (without quotes), it should return your device serial code.
If communicating, you can use the following commands in the adb terminal to update your device, it'll replace TWRP and any other modifications with stock and should not lock your bootloader. It should not affect your data but be prepared to factory reset if your device is not stable:

Code:
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

THANK YOU! It was possible to add kernel while in TWRP, I only tried while in bootloader. I installed the kernel and my phone works again.
After that I backed up and installed the root.zip folder again.

But root checker says I still have not rooted the phone properly. But I can give superuser permissions to apps?. After all that I have gone through, I would like to have root, is this well rooted device or not?
 

echo92

Senior Member
Jan 1, 2017
3,732
1,995
Plymouth
THANK YOU! It was possible to add kernel while in TWRP, I only tried while in bootloader. I installed the kernel and my phone works again.
After that I backed up and installed the root.zip folder again.

But root checker says I still have not rooted the phone properly. But I can give superuser permissions to apps?. After all that I have gone through, I would like to have root, is this well rooted device or not?

Which root manager are you using, phh or SuperSU or magisk? Do your apps have root access even if root checker isn't saying your device is rooted?
 

skastream

Senior Member
Oct 6, 2015
52
0
Im currently on android 6 - should I do root and Twrp with 6 or should I do the stock update to 7 first- which version is safer/better
 

echo92

Senior Member
Jan 1, 2017
3,732
1,995
Plymouth
phh, but my apps have root access so I guess it's ok?

If your apps have root access and they're functioning properly, I'd leave it alone and enjoy the root access :) Seems that root checker isn't picking something up in its checks.

---------- Post added at 01:27 PM ---------- Previous post was at 01:20 PM ----------

Im currently on android 6 - should I do root and Twrp with 6 or should I do the stock update to 7 first- which version is safer/better

Depends on what you're after - both 6 and 7 seem to be stable and perfectly usable (I'm rooted on 7, with the June 2017 update, with magisk 13.3 and have SafetyNet working).

If you choose to stay on 6:
Simpler to root (just flash TWRP and SuperSU/magisk)
Can use xposed and other xposed modules (xposed for Nougat is not that stable yet)
Latest security patch for stock is July 2016

If you choose to update to 7:
You'll have to flash TWRP, then a custom kernel, then root (else rooting with the stock kernel will bootloop your device).
xposed for Nougat is still experimental and provided by unofficial builds, though rovo89 appears to have an official build getting close to release (and might be Oreo ready too)
Latest security patch for stock is June 2017 (though if you've updated to this, downgrading is very risky!)
 
  • Like
Reactions: krishna8691

skastream

Senior Member
Oct 6, 2015
52
0
Thx for your answers. Lets say I stay on rooted stock Android 6 and later maybe we get stock Android 8 by lenovo and I want to switch. How do I make the OTA updates work again. Can I then go back to unrooted stock , Can I make a proper stock android 6 backup for that?
 

echo92

Senior Member
Jan 1, 2017
3,732
1,995
Plymouth
Thx for your answers. Lets say I stay on rooted stock Android 6 and later maybe we get stock Android 8 by lenovo and I want to switch. How do I make the OTA updates work again. Can I then go back to unrooted stock , Can I make a proper stock android 6 backup for that?

Hmm, if you wanted to revert back to stock, then you've have to uninstall root (and flash an unmodified stock kernel), flash a stock recovery and then you may be able to update via OTA. However, the OTAs may fail if they detect that TWRP has been given read-write access to your system. A workaround for this is if you took a TWRP backup before you allowed TWRP to modify your system partition. Furthermore, if you've downgraded your system at any point (which I don't think you have), taking OTAs may result in a hardbrick depending on which firmware you downgraded from.

The easiest way though and the least-likely-to-brick-your-device method would be to formally flash the latest fastboot ROM, which currently is the June 2017 Nougat fastboot stock ROM (or the Oreo stock fastboot ROM if that comes out). One way to flash is as I described in a couple of posts above yours: https://xdaforums.com/moto-g4-plus/how-to/guide-how-root-nougat-moto-g4-plus-t3484672/post73484561
This involves updating the GPT, bootloader, system and modem, with removing TWRP and root, which should formally update your device to Nougat (or Oreo if we do get it, not confirmed). This method should also preserve your data from MM, but as always with flashing anything to your device, you may have to factory reset to get your device stable.
If you were to flash the June 2017 stock update, assuming that's the update before the Oreo OTA, then you should be able to get the OTA and flash (assuming your GPT/bootloader and the rest of your device is formally updated to June 2017 and no modifications, including TWRP and root, are present on your device).

Alternatively, if you do not wish to update your device's bootloader (e.g. you wish to be able to downgrade to MM without risking a hard brick) and wish to retain TWRP, I imagine a member may in time release a TWRP flashable of the stock Oreo ROM - this should only update the system side of things, and not touch your GPT/bootloader. You may have to update your modem firmware to match though, and you will not be able to accept OTA updates. You however should be able to run Oreo. Again, this is all assuming we'll get the Oreo update...
 
Last edited:
  • Like
Reactions: krishna8691

cra1g321

Senior Member
Dec 31, 2013
186
60
I know this is a moto G4 Plus thread but there is no G4 root thread for nougat.
I've got a moto G4 with nougat 7.0 Build Number = NPJS25.93-14-4
is it possible to root this device ?
 

echo92

Senior Member
Jan 1, 2017
3,732
1,995
Plymouth
I know this is a moto G4 Plus thread but there is no G4 root thread for nougat.
I've got a moto G4 with nougat 7.0 Build Number = NPJS25.93-14-4
is it possible to root this device ?

Provided your device is not an Amazon Prime device - the one with ads on the lockscreen - the instructions for unlocking your device and rooting apply the same for Moto G4 as they do for Moto G4 Plus (after all, the only difference is the fingerprint sensor and the camera).

As per many posts in this thread, once you've unlocked your bootloader and flashed TWRP, you must flash a custom kernel to successfully root; rooting on the stock Motorola kernel (the one with hudsoncm) will cause your device to bootloop as you've likely triggered the anti-rooting protections. A custom kernel doesn't appear to have those same protections - by custom kernel, I refer to ElementalX or vegito.

Once done, you may wish to flash either SuperSU or magisk or phh superuser. The guides for flashing SuperSU or magisk can be also found here: https://xdaforums.com/moto-g4-plus/how-to/guide-root-moto-g4-plus-supersu-android-t3587918 or https://xdaforums.com/showpost.php?p=72496111&postcount=270

Essentially, the steps are all the same though for rooting:
1)Unlock bootloader
2)Flash/boot TWRP and backup
3)Flash ElementalX or another custom kernel
4)Flash your preferred rooting manager
5)Reboot and you should be rooted.
 
  • Like
Reactions: cra1g321

cra1g321

Senior Member
Dec 31, 2013
186
60
Essentially, the steps are all the same though for rooting:
1)Unlock bootloader
2)Flash/boot TWRP and backup
3)Flash ElementalX or another custom kernel
4)Flash your preferred rooting manager
5)Reboot and you should be rooted.

Yeah it's not the amazon one thankfully, thanks for the reply, wasn't sure about the build number still being able to be rooted or not,
figured it was best to ask here, thanks for fast reply and great info.
 

Shreekarg

Member
Dec 21, 2014
21
1
Bangalore
Can anyone tell me will i get stock updates if i flash element x kernel ? As far as i know i won't but still need to clarify. Please help me out
 

krishna8691

Senior Member
Oct 22, 2016
151
31
Mumbai
i am onto NPJ25.93 14-8 build can i flash twrp and then go into twrp and flash lineage os 14.1 and boot ?
without flashing elemental x kernel ?
 

echo92

Senior Member
Jan 1, 2017
3,732
1,995
Plymouth
i am onto NPJ25.93 14-8 build can i flash twrp and then go into twrp and flash lineage os 14.1 and boot ?
without flashing elemental x kernel ?

Yes, you only need to flash TWRP to flash lineage or any other custom ROM. Root or ElementalX are not needed, and in fact are replaced by the custom ROM anyway, so it's unnecessary. The custom ROM will replace your system and data with its own, hence the need to erase those partitions in TWRP (as well as cache and Dalvik) as stated in the instructions for flashing most custom ROMs, before you proceed to flash the custom ROM. You may choose to back up your existing system in TWRP so if the custom ROM flash doesn't work, you'll have a backup to fall back to.
 
Last edited:
  • Like
Reactions: krishna8691

osccarr

Member
Aug 21, 2017
9
1
Hello, im new :)


I have a Moto G4 (Not Plus). I have unlocked bootloader and TWRP. I was on a variety of custom roms but decided to restore my clean stock rom from motog4. Can I rootit in the same way as the earlier versions? Flash ElementalX and Magisk / Su? My version is 7.0 NPJS25.93-14-8 XT1622 .

Thanks for help guys , have a nice day :)
 

strongst

Senior Moderator - Developer Committee
Staff member
Sep 18, 2007
13,845
19,187
thank's
HTC Desire
HTC Raphael: Touch Pro, Fuze
Hello, im new :)


I have a Moto G4 (Not Plus). I have unlocked bootloader and TWRP. I was on a variety of custom roms but decided to restore my clean stock rom from motog4. Can I rootit in the same way as the earlier versions? Flash ElementalX and Magisk / Su? My version is 7.0 NPJS25.93-14-8 XT1622 .

Thanks for help guys , have a nice day :)
Yes you can do it as you described!
 

osccarr

Member
Aug 21, 2017
9
1
Thanks :) All working Fine

My last question,
How can I disable automatic updates of OTA Stock Rom? Since I have a custom kernel, I do not want the system to update itself if another security patch comes out etc. Thanks !
 
Last edited:

calinb7

Member
Oct 13, 2016
43
4
From what I've learned in these forums, I don't think your phone will update with your custom kernel no matter what you do. However, when I rooted 6.0, I used SD Maid to freeze the Motorola update process. I still need to install ElementalX and re-root since updating to 7.0 myself, whereas I could use the stock OEM kernel with 6.0.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 43
    ** WARNING **
    If you are on NPJ25.93-11/12/14 (non-soak test Nougat), you MUST flash the ElementalX kernel (link) after step 4. Make sure to backup the stock kernel before proceeding.


    I'm glad we're among the first ones to get updated to Nougat but what about root? Just follow this guide and enjoy!

    Before starting
    • An unlocked bootloader is required.
    • Download Fastboot and install/extract it to a folder.
    • Download TWRP and put it in the same folder as fastboot.
    • Download phh's SuperUser (thread) zip file, open the zip file and then inside you will find config.txt. The default content is
      Code:
      eng verity crypt
      change it to
      Code:
      eng noverity nocrypt
      and save. Copy this zip file to your phone afterwards.

    Steps
    1. Power off your device.
    2. Boot into bootloader mode (Vol Down + Power).
    3. Connect your phone to your PC with USB and flash TWRP using the following command:
      Code:
      fastboot.exe flash recovery twrp-3.0.2-0-athene.img
    4. Boot into TWRP by using volume buttons to navigate and power button to select "Recovery Mode".
    5. Install/flash superuser.zip within TWRP.
    6. Reboot.
    7. Install the phh's SuperUser app from Play Store.
    8. Enjoy your root!
    7
    XT1642 (Android 7.0, NPJ25.93-14) rooted with SuperSU-v2.79-SR3

    I've just successfully performed these steps to root my Moto G 4 Plus (XT1642) with Android 7.0, NPJ25.93-14:

    1. Unlocked bootloader https://motorola-global-portal.custhelp.com/app/standalone/bootloader/unlock-your-device-a with the Code I received from Motorola
    2. Flashed TWRP 3.0.2.0 through bootloader https://dl.twrp.me/athene/
    3. Backup in TWRP (especially the boot-partition)
    4. Flashed ElementalX-G4-1.03.zip https://xdaforums.com/moto-g4-plus/development/kernel-elementalx-g4-0-01-t3424836 through TWRP
    5. Wiped Cache and ART-Cache through TWRP (don't know if necessary but wouldn't harm)
    6. Flashed SR3-SuperSU-v2.79-SR3-20170114223742.zip https://xdaforums.com/apps/supersu/2014-09-02-supersu-v2-05-t2868133. SuperSU v2.79 SR3 (or newer) will flash as systemless by default on Motorola devices running Android 6+. Older versions won't without creating a config file .supersu in /data containing the line
    Code:
    SYSTEMLESS=true

    That's it and it works. SuperSU.apk was also installed in step 6.
    2
    TWRP is stable as usual.

    Did any one tried it did it worked?
    Works fine for me :)
    8eCRQUi.png
    2
    Works Fine, trabaja bien

    works good on nougat NPJ25.93-14 with ElementalX G4-1.01 and SuperSu 2.79 sr3, in xt1641 dual sim. Gracias trabaja bien en android 7.0 con ElementalX 1.01 y SuperSu 2.79 sr3.
    2
    i flashed this supersu along with systemless root method. but there is no supersu app in drawer.
    7. Install the Superuser app from Play Store.
    You need to install the app from Play Store. Also, this is not SuperSU, this is phh's SuperUser.

    When I tried rooting with SuperSU, it broke Wi-Fi and mobile network.