Magisk is a suite of open source tools for customizing Android, supporting devices higher than Android 4.2. It covers fundamental parts of Android customization: root, boot scripts, SELinux patches, AVB2.0 / dm-verity / forceencrypt removals etc.
It was created by and is maintained by John Wo. For the latest release always check the GitHub Releases of Magisk
The aim of this repository is simply to integrate Magisk into the build process of AOSP.
- Extract
addon.d.shfrom the archive. This is needed to have a source file the AOSP build process can use. This is the Magisk addon survival script and will later be copied tosystem/addon.d/99-magisk.sh. - Everything else needs to be performed at the end of the build process (Work in progress)
- Extract
magiskbootfor the host architecture into theintermediatesfolder and set the permissions to755. This is the file needed for modifying the boot image. - Extract
magiskinit,magisk32andmagisk64for the target architecture into theintermediatesfolder. These are the ones that are actually put into the boot image. - Extract
boot_patch.shandutil_functions.shinto theintermediatesfolder and set the permissions to755. These are the script files that will modify the boot image. - The shebang (#!) from
boot_patch.shneeds to be remove otherwise the script won't run. - Also the script needs the correct output device so
export OUTFD="1"is being set. - Now the script can be executed with
boot_patch.sh boot.img. - The file
new-boot.imgis being created and then copied back asboot.imginto the out directory.
Add the following to the manifest-tag in your roomservice.xml
<project name="ADeadTrousers/android_vendor_magisk" path="vendor/magisk" remote="github" revision="master" />Add the following to your device.mk
PRODUCT_PACKAGES += \
99-magisk
- Currently I can't find any way to schedule the build AFTER the building of boot.img. So you've to run your build twice in order get magisk integrated for sure.
- The modified boot.img doesn't get automatically integrated into the final zip. Maybe the packing process uses the information from the "intermediates" folder.
- John Wo for creating Magisk.
- Geofferey Eakins whom I got this idea from.