diff --git a/.shellcheckrc b/.shellcheckrc index 692cb1e..d1d6dcb 100644 --- a/.shellcheckrc +++ b/.shellcheckrc @@ -20,3 +20,7 @@ disable=SC2004 # redundant sed invocation disable=SC2001 + +# referencing unassigned variable +# we need to reference magisk pre-set variables a lot +disable=SC2154 diff --git a/magiskmodule/customize.sh b/magiskmodule/customize.sh new file mode 100644 index 0000000..bbf98b3 --- /dev/null +++ b/magiskmodule/customize.sh @@ -0,0 +1,20 @@ +#!/system/bin/sh + +exec 2>&1 + +[ "$BOOTMODE" != "true" ] && abort "Please install this module within the Magisk app." + +# path to already installed module +INSTALLEDMODPATH=/data/adb/modules/MagicalProtection + +[ ! -d "$INSTALLEDMODPATH" ] && return 0 +[ ! -w /system/etc/hosts ] && return 0 + +ui_print "- Performing in-place update" + +cp -v -r -f "$MODPATH"/* "$INSTALLEDMODPATH" +cp -v -f "$MODPATH"/system/etc/hosts /system/etc/hosts + +rm -v -r "$MODPATH" + +exit 0