Skip to content

Commit

Permalink
add possiblilty to blacklist packages
Browse files Browse the repository at this point in the history
  • Loading branch information
programminghoch10 committed Dec 12, 2023
1 parent c9346e1 commit b81e3e8
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
13 changes: 13 additions & 0 deletions magiskmodule/customize.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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)"
Expand Down

0 comments on commit b81e3e8

Please sign in to comment.