[Magisk] DiracDeBroglie:
About installing Magisk for:

Samsung Galaxy J5 (2016) - SM-J510FN - region code: NEE - Android Nougat 7.1.1

I finally managed to solve the issue with Magisk.

Now that the problem is sovled - in some way, I took the opportunity to fix a small manual/guide for those who may have a similar device and would like to root their phone too using Magisk.

As was suggested, I've patched with Magisk v23 (Mv23) the boot.img which I extracted from the Stock ROM and then installed the Mv23_patched.boot.img via TWRP.

Note that, as Samsung does not provide their Stock ROMs on their own website, you need to pick them up from elsewhere.

There are several third party sites to download Samsung Stock ROMs from, such as: https://www.sammobile.com and https://www.odinrom.com/

However, those Stock ROMs are usually encrypted, and the best thing one can do is to use specific dowload apps such as Frija or SamloaderKotlin from Zacharee. See following links as a start:

https://www.xda-developers.com/download-samsung-software-updates-samsung-firmware-downloader/

https://www.xda-developers.com/download-samsung-updates-free-tools/

https://github.com/zacharee/SamloaderKotlin

https://www.droidwin.com/download-samsung-stock-firmware-frija/

https://xdaforums.com/m/slackingveteran.5187994/

I used SamloaderKotlin on a Win7 PC and that worked just fine; downloaded and decrypted the 1.7GB Stock ROM Nougat 7.1.1 in no time. Take into account that the regional code of your phone is required for the download, see link:

https://krispitech.com/find-samsung-csc-code/ and take a good look at the video.

So far so good for downloading and decrypting the Stock ROM.

Now follows the boot.img extraction. For that, unzip the Stock ROM; you'll find 4 files in there. The largest file is called AP....tar.md5 (3.7GB); unpack that with 7-Zip to an AP...tar file which then contains the boot.img (13MB).

Next, copy boot.img and put (paste) that in the "root" of the /user or /data partition of your Samsung device (USB connected to PC).

Then patch the boot.img with the Mv23 app on your Samsung device and leave the Mv23_patched.boot.img on your device in case you'll flash it using TWRP, or copy it back to your PC in case you're going to flash it using Odin.

(Note! that some users do not extract boot.img and patch the 3.7GB AP...tar straight up and then flash it using Odin on PC, as Odin uses *.tar files. That's OK if you got a lot of flash memory sitting in your Samsung device, which was no so in my case with just 16GB; hence that I extracted the boot.img, which size is only 13MB)

I used TWRP to flash Mv23_patched.boot.img. So, boot into TWRP, push [Install] botton, change flash-mode toggle button (bottom righ on screen) from ZIP to IMG, then pick up Mv23_patched.boot.img, and flash it (took less than 1 second in my case).

Then reboot your device into the (Android) system and install the Magisk app part (which is also an interface to connect to the core elements) and you're all set to go.

In my specific case, after reboot, everything seemed to work normally, root was there, but, .... the patched boot.img did not solve the original problem addressed in post #1; i.e. in the Magisk card, status of -Installed- remained at N/A, so no version number. Also all other "hide" options were absent in the Magisk app menu and settings. Nonetheless, the device was rooted and all root apps worked fine, except for bank & ID apps.

Then I took the decision to uninstall the Mv23 app through the Android menu and installed MagiskManager-v8.0.7.apk, and that worked!!! All "hide" options and modules became available.

But, in Magisk card the Magisk status variable -Installed- showed Magisk v22.1 in stead of v23 although v23 was definitely the version installed in the core elements.

During the test, MagiskManager-v8.0.7 kept on insisting for updating to v22.1, which I then finally did. Unfortunately that resulted in the old problem being back, the status variable -Installed- became N/A again and all options and modules were gone.

Note that between the testing of different versions I applied the Deep Cleansing Procedure (DCP) so to get rid of any Magisk file remnants; DCP entails:

- Uninstall Magisk core elements by installing the Uninstall.zip of the same Magisk version (rename Magisk.zip/apk to Uninstall.zip) using TWRP

- Uninstall any Magisk app leftovers or remnant parts through the Android Apps menu.

- Install SuperSU-v2.82-SR5.zip via TWRP

- Install Solid Explorer File Manager (SE - requires root) from Google Play Store

- Run SE and take SE to system root, then search for "Magisk"; that should give you all files and folders with the word "Magisk" in it

- Then remove/delete all those Magisk remnant files and folders; among those for sure are /root/data/adb/magisk (folder), /root/data/adb/modules (folder) and the file /root/data/adb/magisk.db

- Uninstall & remove SuperSU and completely unroot the device

- Check with Root Checker, or any similar app, that the device is definitely unrooted

- Perform tests with ID and Bank apps just to verify if they're working normally

Next, I installed and tested the full version of Magisk v22.1 by installing a patched boot.img through TWRP.

But Mv22.1 had exacly the same problem as v23, no connection with the core elements, no options, no modules,.... but root was working. Mv22.0 I did not even try out. Conclusion is that there must be a more fundamental problem with those versions.

After running the DCP, I installed Magisk v.21.4.zip using TWRP followed by the installation of MagiskManager-v8.0.7.apk, and all that works flawlessly! With MagiskHide I could hide root from all apps, except those few apps that really need root. There was one banking app that refused working after still detecting root (or the presence of Magisk), but after changing the name of MagiskManager that banking app now also works well.

As MagiskManager-v8.0.7 is sometimes asking to update, I unchecked the option Check-Update and turned off notifications too. So now MagiskManager is quiet and all works well.

All credit and thanks go to the developers and the xda folks.