Use custom function to hack props without increasing prop change counter

- some apps were detecting tampered props from the increased prop_info serial counter using resetprop
- patching doesn't rely on magiskboot hexpatch so should work on KernelSU and APatch as well
- hopefully temporary until all root solutions adopt a patched system_properties repo to fix counters via resetprop
This commit is contained in:
osm0sis
2024-01-08 12:21:22 -04:00
parent 3088f4b179
commit d7090f3f73
3 changed files with 51 additions and 30 deletions

View File

@@ -1,3 +1,6 @@
MODDIR="${0%/*}"
. "$MODDIR/common.sh"
# Remove Play Services from Magisk Denylist when set to enforcing
if magisk --denylist status; then
magisk --denylist rm com.google.android.gms
@@ -10,21 +13,6 @@ fi
# Conditional early sensitive properties
resetprop_if_diff() {
local NAME=$1
local EXPECTED=$2
local CURRENT=$(resetprop $NAME)
[ -z "$CURRENT" ] || [ "$CURRENT" == "$EXPECTED" ] || resetprop $NAME $EXPECTED
}
resetprop_if_match() {
local NAME=$1
local CONTAINS=$2
local VALUE=$3
[[ "$(resetprop $NAME)" == *"$CONTAINS"* ]] && resetprop $NAME $VALUE
}
# RootBeer, Microsoft
resetprop_if_diff ro.build.tags release-keys