diff --git a/README.md b/README.md index 8af5f32..80c9e70 100644 --- a/README.md +++ b/README.md @@ -50,6 +50,14 @@ You, the user, download the original apps yourself. This module will patch the installed apps during installation **right on your device**. +## Blacklisting packages + +All compatible apps installed on the device are patched by default. + +If you want to exclude certain apps from being patched, +add their packagename into a file called `revancedrepackaged-blacklist.txt` +and place it into `/sdcard` or `/data/adb`. + ## Issues and Support You are welcome to diff --git a/magiskmodule/customize.sh b/magiskmodule/customize.sh index 14620fd..b14136e 100644 --- a/magiskmodule/customize.sh +++ b/magiskmodule/customize.sh @@ -13,6 +13,15 @@ MAGISKTMP="$(magisk --path)" || MAGISKTMP=/sbin MIRROR="$MAGISKTMP"/.magisk/mirror ui_print "- Found Magisk mirror at $MIRROR" +findConfigFile() { + for path in /storage/emulated/0 /data/adb; do + [ -f "$path/$1" ] && echo "$path/$1" && break + done +} + +BLACKLIST="$(findConfigFile revancedrepackaged-blacklist.txt)" +[ -n "$BLACKLIST" ] && ui_print "- Found blacklist at $BLACKLIST" + ui_print "- Preparing Patching Process" [ ! -f aapt2lib/$ARCH/libaapt2.so ] && abort "Failed to locate libaapt2.so for $ARCH" @@ -29,6 +38,10 @@ processPackage() { [ -z "$(pm list packages "$packagename")" ] && return + grep -q -F "$packagename" < "$BLACKLIST" \ + && ui_print "- Skipping $packagename (blacklisted)" \ + && return + ui_print "- Processing $packagename" installedpackageversion="$(pm dump $packagename | grep -E '^ *versionName=.*$' | cut -d'=' -f2)"