[Moto G4 Plus Themes, Apps, and Mods] guessingagain:
Disclaimer

This was last updated on 07/02/2017

This guide will tell you how to install magisk (or magiskify as the app calls it) in order to make systemless mods possible for everything. The thing about magisk is as everything is systemless you can just uninstall magisk in the end and take an ota update without having to worry about what in your system had changed. For custom roms, though not as important, systemless mods are useful for stuff like passing safetynet.

For G4/G4 plus there is no support for Android Pay(at least where I live as there is no h/w for NFC) but various banking apps and apps like Pokemon Go.

First of all, if you want to pass safetynet you will need to use the MagiskSU method to root. This root is based on phh Superuser.

This means if you have anything like SuperSU or phh Superuser then you need to unroot first. Magisk will still work if its systemless but safetynet will not.

Also if you have Xposed installed and enabled, then it will not pass safetynet.

Requirements

1. Unlocked bootloader

2. TWRP installed

This is untested in stock NPJ25-93.11/12/14. If someone can test and report I can update this.

Please flash a custom kernel like elementalX if you are on stock rom

If you are stuck in a bootloop the you need to restore your current boot.img and everything will return back to as it was.

Steps

Take a TWRP backup of current rom. Just the boot image should be enough but everything will make it safer.

1. If you are using a custom rom, I recommend you start from a fresh flash. A dirty flash works as well.

A clean boot.img is recommended as debugging is more difficult without it.

A unrooted rom (Like official Lineage-OS) is best but if you are using a pre-rooted rom then you would need to use the UnSU script by osm0sis (tested on unofficial Lineage by Silesh.Nair)

Get UnSU script from here:

https://xdaforums.com/showthread.php?t=2239421

https://xdaforums.com/showpost.php?p=63615067

2. Download the latest magisk zip and uninstaller from the Magisk release thread.

https://xdaforums.com/apps/magisk/official-magisk-v7-universal-systemless-t3473445

3. After flashing your ROM (or your clean stock rom if you will), flash the magisk zip using TWRP. If your rom is unrooted, Magisk will provide a root solution. If you are rooted with systemless SuperSU, magisk integrates itself there but you will not pass safetynet.

4. Reboot and install magisk manager from play store. Enable Magisk Hide. You can pass safetynet now.

Magisk also supports systemless host files(for Adaway) and busybox support from the app itself. You can just enable and reboot.

If you are on MM, then you can install xposed through magisk itself(but no safetynet support in this case)

Also magisk already has ports of Viper4Android as well. Creating your own mod is simple as well. For further guide search in the Magisk forum. Excellent guides are published there.

Credits:

topjohnwu for Magisk and MagiskSU development

osm0sis for unSU script

shreps for porting TWRP

mrinmaydhar for kernel info

None of this is my work. All I did was compile it so that it becomes easier for others.

If I missed anything please remind me. This is my first thread so everything might not be smoothest.