From 608e60adbb1b35ddd5970d2bb081c9f1eb99ab00 Mon Sep 17 00:00:00 2001 From: osm0sis Date: Fri, 2 Feb 2024 15:44:33 -0400 Subject: [PATCH] Allow files on the app replace list --- module/customize.sh | 29 ++++++++++++++++++++--------- module/example.app_replace.list | 8 ++++++-- module/post-fs-data.sh | 25 +++++++++++++++++-------- 3 files changed, 43 insertions(+), 19 deletions(-) diff --git a/module/customize.sh b/module/customize.sh index 21b3869..c8c83ae 100644 --- a/module/customize.sh +++ b/module/customize.sh @@ -20,22 +20,33 @@ 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 +# Replace/remove conflicting custom ROM injection app folders/files to disable them LIST=$MODPATH/example.app_replace.list [ -f "$MODPATH/custom.app_replace.list" ] && LIST=$MODPATH/custom.app_replace.list for APP in $(grep -v '^#' $LIST); do - if [ -d "$APP" ]; then + if [ -e "$APP" ]; then case $APP in - /system/*) HIDEDIR=$MODPATH/$APP;; - *) HIDEDIR=$MODPATH/system/$APP;; + /system/*) HIDEPATH=$MODPATH/$APP;; + *) HIDEPATH=$MODPATH/system/$APP;; esac - mkdir -p $HIDEDIR - if [ "$KSU" = "true" -o "$APATCH" = "true" ]; then - setfattr -n trusted.overlay.opaque -v y $HIDEDIR + if [ -d "$APP" ]; then + mkdir -p $HIDEPATH + if [ "$KSU" = "true" -o "$APATCH" = "true" ]; then + setfattr -n trusted.overlay.opaque -v y $HIDEPATH + else + touch $HIDEPATH/.replace + fi else - touch $HIDEDIR/.replace + mkdir -p $(dirname $HIDEPATH) + if [ "$KSU" = "true" -o "$APATCH" = "true" ]; then + mknod $HIDEPATH c 0 0 + else + touch $HIDEPATH + fi + fi + if [[ -d "$APP" -o "$APP" = *".apk" ]]; then + ui_print "! $(basename $APP .apk) ROM app disabled, please uninstall any user app versions/updates after next reboot" fi - ui_print "! $(basename $APP) ROM app disabled, please uninstall any user app versions/updates after next reboot" fi done diff --git a/module/example.app_replace.list b/module/example.app_replace.list index c5db621..d0228a5 100644 --- a/module/example.app_replace.list +++ b/module/example.app_replace.list @@ -1,7 +1,7 @@ # Rename to custom.app_replace.list once customized # -# Add conflicting custom ROM injection app folder paths to this list -# and they will be replaced systemlessly to disable them +# Add conflicting custom ROM injection app folder/files paths to this list +# and they will be replaced/removed systemlessly to disable them # Xiaomi.eu /product/app/XiaomiEUInject @@ -13,3 +13,7 @@ # hentaiOS /system_ext/app/hentaiLewdbSVTDummy + +# PixelOS +/system_ext/overlay/CertifiedPropsOverlay.apk +/system_ext/overlay/config/config.xml diff --git a/module/post-fs-data.sh b/module/post-fs-data.sh index 3d2bf38..692fab8 100644 --- a/module/post-fs-data.sh +++ b/module/post-fs-data.sh @@ -11,20 +11,29 @@ 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 +# Replace/remove conflicting custom ROM injection app folders/files to disable them LIST=$MODDIR/example.app_replace.list [ -f "$MODDIR/custom.app_replace.list" ] && LIST=$MODDIR/custom.app_replace.list for APP in $(grep -v '^#' $LIST); do - if [ -d "$APP" ]; then + if [ -e "$APP" ]; then case $APP in - /system/*) HIDEDIR=$MODDIR/$APP;; - *) HIDEDIR=$MODDIR/system/$APP;; + /system/*) HIDEPATH=$MODDIR/$APP;; + *) HIDEPATH=$MODDIR/system/$APP;; esac - mkdir -p $HIDEDIR - if [ "$KSU" = "true" -o "$APATCH" = "true" ]; then - setfattr -n trusted.overlay.opaque -v y $HIDEDIR + if [ -d "$APP" ]; then + mkdir -p $HIDEPATH + if [ "$KSU" = "true" -o "$APATCH" = "true" ]; then + setfattr -n trusted.overlay.opaque -v y $HIDEPATH + else + touch $HIDEPATH/.replace + fi else - touch $HIDEDIR/.replace + mkdir -p $(dirname $HIDEPATH) + if [ "$KSU" = "true" -o "$APATCH" = "true" ]; then + mknod $HIDEPATH c 0 0 + else + touch $HIDEPATH + fi fi fi done