From d106e2a964cc8f8084174ef689189d8d9d22028f Mon Sep 17 00:00:00 2001 From: osm0sis Date: Mon, 8 Jan 2024 16:06:24 -0400 Subject: [PATCH] Allow customizable path replacement for conflicting custom ROM apps --- module/app_replace.list | 9 +++++++++ module/customize.sh | 16 ++++++++++++++-- module/post-fs-data.sh | 11 +++++++++++ 3 files changed, 34 insertions(+), 2 deletions(-) create mode 100644 module/app_replace.list diff --git a/module/app_replace.list b/module/app_replace.list new file mode 100644 index 0000000..7d66a9a --- /dev/null +++ b/module/app_replace.list @@ -0,0 +1,9 @@ +# Add conflicting custom ROM injection app folder paths to this list +# and they will be replaced systemlessly to disable them + +# Xiaomi.eu +/product/app/XiaomiEUInject +/system/app/XInjectModule + +# EliteRoms +/system/app/EliteDevelopmentModule diff --git a/module/customize.sh b/module/customize.sh index 46a3ffd..89deccf 100644 --- a/module/customize.sh +++ b/module/customize.sh @@ -12,6 +12,18 @@ if [ -d /data/adb/modules/MagiskHidePropsConf ]; then ui_print "! MagiskHidePropsConfig (MHPC) module may cause issues with PIF" fi +# Replace conflicting custom ROM injection app folders to disable them +if [ -f "$MODPATH/app_replace.list" ]; then + for APP in $(grep -v '^#' "$MODPATH/app_replace.list"); do + if [ -d "$APP" ]; then + HIDEDIR="$MODPATH/$APP" + mkdir -p "$HIDEDIR" + touch "$HIDEDIR/.replace" + ui_print "- $(basename $APP) app disabled" + fi + done +fi + # Copy any custom.pif.json to updated module if [ -f /data/adb/modules/playintegrityfix/custom.pif.json ]; then ui_print "- Restoring custom.pif.json" @@ -28,5 +40,5 @@ if [ -f "$MODPATH/custom.pif.json" ] && ! grep -q "api_level" $MODPATH/custom.pi fi # Clean up any leftover files from previous deprecated methods -rm -f /data/data/com.google.android.gms/cache/pif.prop /data/data/com.google.android.gms/pif.prop -rm -f /data/data/com.google.android.gms/cache/pif.json /data/data/com.google.android.gms/pif.json +rm -f /data/data/com.google.android.gms/cache/pif.prop /data/data/com.google.android.gms/pif.prop \ + /data/data/com.google.android.gms/cache/pif.json /data/data/com.google.android.gms/pif.json diff --git a/module/post-fs-data.sh b/module/post-fs-data.sh index 3249525..189d0e0 100644 --- a/module/post-fs-data.sh +++ b/module/post-fs-data.sh @@ -11,6 +11,17 @@ if [ -d /data/adb/modules/safetynet-fix ]; then touch /data/adb/modules/safetynet-fix/remove fi +# Replace conflicting custom ROM injection app folders to disable them +if [ -f "$MODDIR/app_replace.list" ]; then + for APP in $(grep -v '^#' "$MODDIR/app_replace.list"); do + if [ -d "$APP" ]; then + HIDEDIR="$MODDIR/$APP" + mkdir -p "$HIDEDIR" + touch "$HIDEDIR/.replace" + fi + done +fi + # Conditional early sensitive properties # Samsung