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
change security patch logic
check if security patch is older than one year
This commit is contained in:
@@ -29,18 +29,27 @@ if [ -n "$hash_value" ]; then
|
|||||||
resetprop -n ro.boot.vbmeta.digest "$hash_value"
|
resetprop -n ro.boot.vbmeta.digest "$hash_value"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Reset vendor patch if different with security patch
|
# Spoof security patch if older than 1 year
|
||||||
security_patch=$(getprop ro.build.version.security_patch)
|
vendor_patch=$(getprop ro.vendor.build.security_patch | sed 's/-//g')
|
||||||
vendor_patch=$(getprop ro.vendor.build.security_patch)
|
vendor_patch_after_1y=$(echo "$vendor_patch + 10000" | bc)
|
||||||
if [ "$vendor_patch" != "$security_patch" ]; then
|
TODAY=$(date +%Y%m%d)
|
||||||
TS_version=$(grep "versionCode=" "$TS/module.prop" | cut -d'=' -f2)
|
if [ "$TODAY" -ge "$vendor_patch_after_1y" ]; then
|
||||||
if [ "$TS_version" -lt 158 ]; then
|
[ -f "/data/adb/modules/playintegrityfix/pif.json" ] && PIF="/data/adb/modules/playintegrityfix/pif.json"
|
||||||
resetprop -n ro.vendor.build.security_patch "$security_patch"
|
[ -f "/data/adb/pif.json" ] && PIF="/data/adb/pif.json"
|
||||||
else
|
[ -f "/data/adb/modules/playintegrityfix/custom.pif.json" ] && PIF="/data/adb/modules/playintegrityfix/custom.pif.json"
|
||||||
printf "boot=%s\nvendor=%s\n" "$security_patch" "$security_patch" > "$TARGET_DIR/security_patch.txt"
|
security_patch=$(grep '"SECURITY_PATCH"' "$PIF" | sed 's/.*: "//; s/".*//')
|
||||||
|
[ -z "$security_patch" ] && security_patch=$(getprop ro.build.version.security_patch)
|
||||||
|
|
||||||
|
formatted_security_patch=$(echo "$security_patch" | sed 's/-//g')
|
||||||
|
if [ -n "$formatted_security_patch" ]; then
|
||||||
|
TS_version=$(grep "versionCode=" "$TS/module.prop" | cut -d'=' -f2)
|
||||||
|
if [ "$TS_version" -lt 158 ]; then
|
||||||
|
resetprop ro.vendor.build.security_patch "$security_patch"
|
||||||
|
resetprop ro.build.version.security_patch "$security_patch"
|
||||||
|
else
|
||||||
|
echo "all=$formatted_security_patch" > "$TARGET_DIR/security_patch.txt"
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
else
|
|
||||||
rm -f "$TARGET_DIR/security_patch.txt"
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Disable TSupport-A auto update target to prevent overwrite
|
# Disable TSupport-A auto update target to prevent overwrite
|
||||||
|
|||||||
Reference in New Issue
Block a user