-
Notifications
You must be signed in to change notification settings - Fork 128
How does it work?
Takeda-senpai edited this page May 11, 2022
·
2 revisions
- System launched with initrd-magisk (
initrd.img
) unpacked into root directory in first stage, then unpack originalinitrd_real.img
to root directory. - Put
99_magisk
script into/scripts
- Launch
init
script from originalinitrd_real.img
and continue to boot.
- Execute
99_magisk
script to patch Android's root directory- Mount tmpfs on
/android/dev
. - Load Magisk from
boot-magisk.img
-
On rootfs (read-write rootdir), directly add magisk binaries into
/android/magisk
and inject magisk services into/init.rc
. On system-as-root (read-only rootdir), mount overlay on/android/system/etc/init
, add magisk binaries into/android/system/etc/init/magisk
and inject magisk services into/android/system/etc/init/magisk.rc
. -
Pre-init sepolicy patch: Patch sepolicy file by using
magiskpolicy
tool, dump it into/android/dev/.overlay/sepolicy
and mount bind on/sepolicy
or vendor precompiled sepolicy. - Unmount
/android/dev
.
- Mount tmpfs on
-
init
switch root directory to/android
and execute/init
to boot Android.
- Android boot with Magisk