Adb: Fastboot Magisk Module Repack
To replace a system app systemlessly:
my_module/
└── system/
└── app/
└── MyApp/
└── MyApp.apk
No extra scripts needed – Magisk overlays at boot.
Open module.prop in your text editor. Change it like this: adb fastboot magisk module repack
id=systemless_hosts_repacked
name=Systemless Hosts (Repacked)
version=v1.2
versionCode=120
author=YourName (Forked from OriginalAuthor)
description=Blocks ads via hosts file. Repacked with custom boot script.
Tip: The id must be unique and lowercase with no spaces.
Edit module.prop (change version, description, etc.)
Add/overlay files in system/ (e.g., system/etc/some_config)
Update or add scripts (post-fs-data.sh must be executable) To replace a system app systemlessly: my_module/ └──
To add custom sepolicy.rule:
# Generate from boot image patching (outside scope)
# Place inside module root as sepolicy.rule
To "repack" a module, one must understand what is inside the container. A Magisk module is essentially a standard ZIP archive with a specific file structure. When you unzip a module, you typically find: No extra scripts needed – Magisk overlays at boot
fastboot boot magisk_patched.img
adb shell su -c "ls /data/adb/modules" adb shell su -c "touch /data/adb/modules/<module>/disable" adb shell su -c "rm -rf /data/adb/modules/<module>" adb reboot
fastboot devices
fastboot reboot bootloader