Allow customizable path replacement for conflicting custom ROM apps

This commit is contained in:
osm0sis
2024-01-08 16:06:24 -04:00
parent a9630901b3
commit d106e2a964
3 changed files with 34 additions and 2 deletions

9
module/app_replace.list Normal file
View File

@@ -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

View File

@@ -12,6 +12,18 @@ if [ -d /data/adb/modules/MagiskHidePropsConf ]; then
ui_print "! MagiskHidePropsConfig (MHPC) module may cause issues with PIF" ui_print "! MagiskHidePropsConfig (MHPC) module may cause issues with PIF"
fi 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 # Copy any custom.pif.json to updated module
if [ -f /data/adb/modules/playintegrityfix/custom.pif.json ]; then if [ -f /data/adb/modules/playintegrityfix/custom.pif.json ]; then
ui_print "- Restoring custom.pif.json" ui_print "- Restoring custom.pif.json"
@@ -28,5 +40,5 @@ if [ -f "$MODPATH/custom.pif.json" ] && ! grep -q "api_level" $MODPATH/custom.pi
fi fi
# Clean up any leftover files from previous deprecated methods # 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.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 /data/data/com.google.android.gms/cache/pif.json /data/data/com.google.android.gms/pif.json

View File

@@ -11,6 +11,17 @@ if [ -d /data/adb/modules/safetynet-fix ]; then
touch /data/adb/modules/safetynet-fix/remove touch /data/adb/modules/safetynet-fix/remove
fi 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 # Conditional early sensitive properties
# Samsung # Samsung