2024-09-04 13:12:52 +03:00
|
|
|
MODPATH="${0%/*}"
|
2024-10-23 15:22:27 +03:00
|
|
|
. "$MODPATH"/common_func.sh
|
2024-09-04 13:12:52 +03:00
|
|
|
|
|
|
|
# Remove Play Services from Magisk DenyList when set to Enforce in normal mode
|
2024-07-21 19:34:45 +03:00
|
|
|
if magisk --denylist status; then
|
|
|
|
magisk --denylist rm com.google.android.gms
|
2024-10-23 15:22:27 +03:00
|
|
|
else
|
|
|
|
# If DenyList is disabled, maybe you are using Shamiko
|
2024-10-23 19:03:28 +03:00
|
|
|
if [ ! -f "/data/adb/shamiko/whitelist" ]; then
|
|
|
|
magisk --denylist add com.google.android.gms com.google.android.gms.unstable
|
|
|
|
fi
|
2024-07-21 19:34:45 +03:00
|
|
|
fi
|
|
|
|
|
2024-10-25 00:12:00 +03:00
|
|
|
# safetynet-fix module is obsolete and it's incompatible with PIF
|
|
|
|
SNFix="/data/adb/modules/safetynet-fix"
|
2024-10-25 00:13:49 +03:00
|
|
|
if [ -d "$SNFix" ]; then
|
|
|
|
touch "$SNFix"/remove
|
2024-10-25 00:12:00 +03:00
|
|
|
fi
|
|
|
|
|
2024-10-23 15:22:27 +03:00
|
|
|
# Uninstall conflict apps
|
|
|
|
APPS="
|
|
|
|
/system/app/EliteDevelopmentModule
|
|
|
|
/system/app/XInjectModule
|
|
|
|
/system/product/app/XiaomiEUInject
|
|
|
|
/system/product/app/XiaomiEUInject-Stub
|
|
|
|
/system/system_ext/app/hentaiLewdbSVTDummy
|
|
|
|
/system/system_ext/app/PifPrebuilt
|
|
|
|
"
|
|
|
|
|
|
|
|
for APP in $APPS; do
|
2024-10-25 00:12:00 +03:00
|
|
|
HIDEPATH="$MODPATH$APP"
|
|
|
|
mkdir -p "$HIDEPATH"
|
|
|
|
if [ "$KSU" = "true" ] || [ "$APATCH" = "true" ]; then
|
|
|
|
setfattr -n trusted.overlay.opaque -v y "$HIDEPATH"
|
|
|
|
else
|
|
|
|
touch "$HIDEPATH"/.replace
|
2024-10-23 15:22:27 +03:00
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
2024-09-04 13:12:52 +03:00
|
|
|
# Conditional early sensitive properties
|
2024-07-21 19:34:45 +03:00
|
|
|
|
|
|
|
# Samsung
|
2024-07-24 14:35:19 +03:00
|
|
|
resetprop_if_diff ro.boot.warranty_bit 0
|
|
|
|
resetprop_if_diff ro.vendor.boot.warranty_bit 0
|
|
|
|
resetprop_if_diff ro.vendor.warranty_bit 0
|
|
|
|
resetprop_if_diff ro.warranty_bit 0
|
2024-07-21 19:34:45 +03:00
|
|
|
|
2024-09-04 13:12:52 +03:00
|
|
|
# Realme
|
|
|
|
resetprop_if_diff ro.boot.realmebootstate green
|
|
|
|
|
2024-07-21 19:34:45 +03:00
|
|
|
# OnePlus
|
2024-07-24 14:35:19 +03:00
|
|
|
resetprop_if_diff ro.is_ever_orange 0
|
2024-07-21 19:34:45 +03:00
|
|
|
|
2024-09-04 13:12:52 +03:00
|
|
|
# Microsoft
|
|
|
|
for PROP in $(resetprop | grep -oE 'ro.*.build.tags'); do
|
2024-10-23 15:22:27 +03:00
|
|
|
resetprop_if_diff "$PROP" release-keys
|
2024-09-04 13:12:52 +03:00
|
|
|
done
|
|
|
|
|
2024-07-21 19:34:45 +03:00
|
|
|
# Other
|
2024-09-04 13:12:52 +03:00
|
|
|
for PROP in $(resetprop | grep -oE 'ro.*.build.type'); do
|
2024-10-23 15:22:27 +03:00
|
|
|
resetprop_if_diff "$PROP" user
|
2024-09-04 13:12:52 +03:00
|
|
|
done
|
|
|
|
resetprop_if_diff ro.adb.secure 1
|
2024-07-24 14:35:19 +03:00
|
|
|
resetprop_if_diff ro.debuggable 0
|
2024-09-04 13:12:52 +03:00
|
|
|
resetprop_if_diff ro.force.debuggable 0
|
2024-07-24 14:35:19 +03:00
|
|
|
resetprop_if_diff ro.secure 1
|
2024-09-04 13:12:52 +03:00
|
|
|
|
|
|
|
# Work around AOSPA PropImitationHooks conflict when their persist props don't exist
|
|
|
|
if [ -n "$(resetprop ro.aospa.version)" ]; then
|
|
|
|
for PROP in persist.sys.pihooks.first_api_level persist.sys.pihooks.security_patch; do
|
|
|
|
resetprop | grep -q "\[$PROP\]" || resetprop -n -p "$PROP" ""
|
|
|
|
done
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Work around supported custom ROM PixelPropsUtils conflict when spoofProvider is disabled
|
|
|
|
if [ -n "$(resetprop persist.sys.pixelprops.pi)" ]; then
|
|
|
|
resetprop -n -p persist.sys.pixelprops.pi false
|
2024-10-07 00:48:35 +03:00
|
|
|
resetprop -n -p persist.sys.pixelprops.gapps false
|
|
|
|
resetprop -n -p persist.sys.pixelprops.gms false
|
2024-09-04 13:12:52 +03:00
|
|
|
fi
|