[Magisk] lfom:
Hello there.

First of all, let me thank this incredible tool made by [MENTION=4470081]topjohnwu[/MENTION], it's really a nice idea and implementation. I don't own any of the code here, it's just a modification to be able to install and run under Android-x86.org latest Nougat version (as of now, 7.1-rc2). It may work with other versions, including RemixOS and PhoenixOS, but I have not tested it. It was tested using a normal installation on a FAT32 partition, and should work with either a RW or RO system image.

Newer versions of Magisk don't use magic_magisk.sh anymore, that's why I've chosen v12.0 (it can be downloaded from the official thread on XDA). If topjohnwu want to add patches to the source code, I would be more than glad to help. But probably it's not worth the trouble... Another log is created on cache called logtmp.log if you want to check more info about what's going on.

The first step is to make a "fake" boot.img for the installer can patch the ramdisk.img. In order to do this, you will need the handy tool mkbootimg from this other XDA thread:

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

Copy both kernel and ramdisk.img from the original installation and use this command (all files must be in the current directory, of course):

./mkbootimg --kernel kernel --ramdisk ramdisk.img -o boot.img

then copy the resulting boot.img to the Magisk v12.0 folder you will use to install it on your Android x86 installation. The easy way is use a flash drive connected to USB, and I will assume from now on that you have downloaded and decompressed the Magisk files to the root of your flash drive, creating a folder Magisk-v12.0 on it.

After that, if you still have su working on your installation, do the steps bellow after calling "su" (Magisk installer will remove the original su, so if you do not have it you should still be able to access root using the ALT+F1 terminal):

cd /dev
mkdir tmp
mkdir tmp/magisk
cd tmp/magisk
cp -r /storage/YOUR-FLASH-DRIVE-ID-HERE/Magisk-v12.0/* .
mv boot.img /data
sh ./META-INF/com/google/android/update-binary

YOUR-FLASH-DRIVE-ID-HERE must be replaced with your drive's unique ID. Alternatively you can copy the folder using a file manager to you internal storage (/sdcard) and then use this command instead:

cp -r /sdcard/Magisk-v12.0/* .

If everything goes well, you should see a message in the end that the new ramdisk.img is ready in the current directory, move it to somewhere else you can replace the installed one. The easiest way is moving it to a flash drive, boot on another system and replace the original one. If you can't do it, you can also move it to /data then boot in DEBUG mode and replace it on /mnt after you type "exit" once. then reboot. Also, delete boot.img from /data, it won't be necessary anymore.

This should result in a full installation of Magisk v12.0. Be aware that current modules for Magisk V14.0 won't work, so you have to dig old ones compatible with v12.0. Also, as many have asked me, probably SafetyNet won't work because it's an old version and Android x86 is a debug version anyway, you must "fake" a lot of things to pass SafetyNet test.

Attached are the modified files:

- updater-script

- magic_mask.sh

- magisk.apk (I had to use 4.3.3 for better compatibility, do not upgrade or it make break installation)

Have fun! :D