From aa7b5b75732d659f95b168c172f792e1a938039e Mon Sep 17 00:00:00 2001 From: KOWX712 Date: Sun, 13 Jul 2025 19:01:39 +0800 Subject: [PATCH] feat: auto security patch support for pif.prop --- module/common/get_extra.sh | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/module/common/get_extra.sh b/module/common/get_extra.sh index b88f6de..2055586 100644 --- a/module/common/get_extra.sh +++ b/module/common/get_extra.sh @@ -118,12 +118,24 @@ release_note() { } set_security_patch() { - # Find pif.json - [ -f "/data/adb/modules/playintegrityfix/pif.json" ] && PIF="/data/adb/modules/playintegrityfix/pif.json" - [ -f "/data/adb/pif.json" ] && PIF="/data/adb/pif.json" - [ -f "/data/adb/modules/playintegrityfix/custom.pif.json" ] && PIF="/data/adb/modules/playintegrityfix/custom.pif.json" - - security_patch=$(grep '"SECURITY_PATCH"' "$PIF" | sed 's/.*: "//; s/".*//') + # Look for security patch from PIF + if [ -f "/data/adb/modules/playintegrityfix/pif.json" ]; then + PIF="/data/adb/modules/playintegrityfix/pif.json" + [ -f "/data/adb/pif.json" ] && PIF="/data/adb/pif.json" + elif [ -f "/data/adb/modules/playintegrityfix/pif.prop" ]; then + PIF="/data/adb/modules/playintegrityfix/pif.prop" + [ -f "/data/adb/pif.prop" ] && PIF="/data/adb/pif.prop" + elif [ -f "/data/adb/modules/playintegrityfix/custom.pif.json" ]; then + PIF="/data/adb/modules/playintegrityfix/custom.pif.json" + fi + + if [ -n "$PIF" ]; then + if echo "$PIF" | grep -q "prop"; then + security_patch=$(grep 'SECURITY_PATCH' "$PIF" | cut -d'=' -f2 | tr -d '\n') + else + security_patch=$(grep '"SECURITY_PATCH"' "$PIF" | sed 's/.*: "//; s/".*//') + fi + fi [ -z "$security_patch" ] && security_patch=$(getprop ro.build.version.security_patch) # Fallback formatted_security_patch=$(echo "$security_patch" | sed 's/-//g')