Current Magisk branch : stable
Current Magisk version : 24.1
This project is aim to integrate Magisk into Android-x86 build automatically, and can even be able to use modules as well as Zygisk. It's mainly based on works like MagiskOnWSA or MagiskOnEmu so you will see they might be pretty similar. Kokoro currently aiming to support Android-x86 builds that are Android 10+ with x86_64 only, so if you want x86 support you can contribute here, I don't have any interest to support it so far.
Note that the instruction is only for building the image, if you want to manually integrate into a prebuilts image (say like PrimeOS 2.0) you have to figure it out yourself.
- Clone this repo to vendor/supremegamers/kokoro
- It is recommend to clear everything related to koushSU, the old Superuser that Android-x86 usually use, you can try to remove external/koush folder (which includes Superuser and Widget) , also reverting the commit in Settings (for example, here is my commit on ProjectSakura-x86)
- Go to bootable/newinstaller and cherry-pick this commit to patch sepolicy using magiskpolicy tool
- It is recommend to cherry-pick this commit on bootable/newinstaller too so that if you extract system.sfs out to .img Magisk is still usable, but keep in mind that you will never be able to set system as R/W.
- Go to device/generic/common and cherry-pick this commit so that the build will copy the files and also init.*.rc can recognize init.kokoro.rc
- When building, please export
ANDROID_INTEGRATE_MAGISK=true
so that the build will start copying the Magisk files in. - WARNING : If the build failed in the selinux test stage (to check the integrity of the file), remove the whole out/target/product/arch (in this case x86_64) and then try again, do not make clean or delete the out folder
Well..... same as the 2 projects above, init.kokoro.rc will prepare a tmpfs folder (in this case /dev/magisk
) and then putting all the Magisk files into it (the files are located in /system/etc/magisk), linking to the appropriate tools and then starting the Magisk boot stage like post-fs-data
/services
/boot-complete
.
In order to prevent the magic mount to accidentally mount the whole drive to /data
instead of the only data folder or image, I unmount the data in magic mount (if it does mount) and then linking the mount place to /data instead. Not only does it help magic mount to not accidentally mount the drive, but also helps the Magisk modules show and working properly.
After that, Magisk is completely initialized and you can use it.
The name Kokoro
comes from Hata no Kokoro, a character from Touhou Project , usually appears on fighting games in the series. Since her power is manipulating emotions by using the masks I decided to use her name for this project.
Kokoro art made by Moe Harukawa used in the main series fighting games produced by Tasofro + Team Shanghai Alice
The project is nothing without the work of these guys
- John Wu and the contributors behind Magisk.
- LSPosed Team with the work behind MagiskOnWSA
- HuskyDG for helping me setting up Magisk on Android-x86 so that I can complete make project.