Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .shellcheckrc
Original file line number Diff line number Diff line change
Expand Up @@ -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
20 changes: 20 additions & 0 deletions magiskmodule/customize.sh
Original file line number Diff line number Diff line change
@@ -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
Loading