You've already forked Tricky-Addon-Update-Target-List
mirror of
https://github.com/KOWX712/Tricky-Addon-Update-Target-List.git
synced 2025-09-06 06:37:09 +00:00
feat: auto security patch support for pif.prop
This commit is contained in:
@@ -118,12 +118,24 @@ release_note() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
set_security_patch() {
|
set_security_patch() {
|
||||||
# Find pif.json
|
# Look for security patch from PIF
|
||||||
[ -f "/data/adb/modules/playintegrityfix/pif.json" ] && PIF="/data/adb/modules/playintegrityfix/pif.json"
|
if [ -f "/data/adb/modules/playintegrityfix/pif.json" ]; then
|
||||||
[ -f "/data/adb/pif.json" ] && PIF="/data/adb/pif.json"
|
PIF="/data/adb/modules/playintegrityfix/pif.json"
|
||||||
[ -f "/data/adb/modules/playintegrityfix/custom.pif.json" ] && PIF="/data/adb/modules/playintegrityfix/custom.pif.json"
|
[ -f "/data/adb/pif.json" ] && PIF="/data/adb/pif.json"
|
||||||
|
elif [ -f "/data/adb/modules/playintegrityfix/pif.prop" ]; then
|
||||||
security_patch=$(grep '"SECURITY_PATCH"' "$PIF" | sed 's/.*: "//; s/".*//')
|
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
|
[ -z "$security_patch" ] && security_patch=$(getprop ro.build.version.security_patch) # Fallback
|
||||||
|
|
||||||
formatted_security_patch=$(echo "$security_patch" | sed 's/-//g')
|
formatted_security_patch=$(echo "$security_patch" | sed 's/-//g')
|
||||||
|
|||||||
Reference in New Issue
Block a user