diff --git a/build.py b/build.py index f41d2f5fd..db5a9deb1 100755 --- a/build.py +++ b/build.py @@ -327,7 +327,7 @@ def zip_main(args): zipf.writestr(target, util_func) # addon.d.sh source = os.path.join('scripts', 'addon.d.sh') - target = os.path.join('common', '99-magisk.sh') + target = os.path.join('common', 'addon.d.sh') zip_with_msg(zipf, source, target) # Prebuilts diff --git a/scripts/addon.d.sh b/scripts/addon.d.sh index 9052a6dea..b4fe7ad88 100644 --- a/scripts/addon.d.sh +++ b/scripts/addon.d.sh @@ -1,5 +1,4 @@ #!/sbin/sh -# ADDOND_VERSION=2 ########################################################################################## # # Magisk Survival Script for ROMs with addon.d support diff --git a/scripts/flash_script.sh b/scripts/flash_script.sh index b4c57603d..f3ddc6b76 100644 --- a/scripts/flash_script.sh +++ b/scripts/flash_script.sh @@ -103,7 +103,9 @@ chmod -R 755 $MAGISKBIN if [ -d /system/addon.d ]; then ui_print "- Adding addon.d survival script" mount -o rw,remount /system - cp -af $INSTALLER/common/99-magisk.sh /system/addon.d/99-magisk.sh + echo "#!/sbin/sh" > /system/addon.d/99-magisk.sh + echo "# ADDOND_VERSION=2" >> /system/addon.d/99-magisk.sh + echo ". /data/adb/magisk/addon.d.sh" >> /system/addon.d/99-magisk.sh chmod 755 /system/addon.d/99-magisk.sh fi