From ae12fe8b282bb64475eb835f4d04961def18cbbe Mon Sep 17 00:00:00 2001 From: KOWX712 Date: Fri, 18 Jul 2025 15:18:06 +0800 Subject: [PATCH] feat: add device props support for qwq233' TS fork ref: https://github.com/qwq233/TrickyStore/commit/bab87cef907222ef99a52070896089e375f0ac11 --- module/common/get_extra.sh | 18 +++--- module/webui/index.html | 50 +++++++++++++-- module/webui/locales/strings/en.xml | 1 + module/webui/locales/template.xml | 1 + module/webui/scripts/about.js | 3 +- module/webui/scripts/security_patch.js | 87 +++++++++++++++++++------- module/webui/styles/security_patch.css | 2 +- 7 files changed, 126 insertions(+), 36 deletions(-) diff --git a/module/common/get_extra.sh b/module/common/get_extra.sh index 2055586..8432ab1 100644 --- a/module/common/get_extra.sh +++ b/module/common/get_extra.sh @@ -143,19 +143,23 @@ set_security_patch() { TODAY=$(date +%Y%m%d) if [ -n "$formatted_security_patch" ] && [ "$TODAY" -lt "$security_patch_after_1y" ]; then TS_version=$(grep "versionCode=" "/data/adb/modules/tricky_store/module.prop" | cut -d'=' -f2) - # Official TrickyStore which supports custom security patch - if [ "$TS_version" -ge 158 ]; then - SECURITY_PATCH_FILE="/data/adb/tricky_store/security_patch.txt" - printf "system=prop\nboot=%s\nvendor=%s\n" "$security_patch" "$security_patch" > "$SECURITY_PATCH_FILE" - chmod 644 "$SECURITY_PATCH_FILE" # James Clef's TrickyStore fork (GitHub@qwq233/TrickyStore) - elif grep -q "James" "/data/adb/modules/tricky_store/module.prop"; then + if grep -q "James" "/data/adb/modules/tricky_store/module.prop"; then SECURITY_PATCH_FILE="/data/adb/tricky_store/devconfig.toml" if grep -q "^securityPatch" "$SECURITY_PATCH_FILE"; then sed -i "s/^securityPatch .*/securityPatch = \"$security_patch\"/" "$SECURITY_PATCH_FILE" else - echo "securityPatch = \"$security_patch\"" >> "$SECURITY_PATCH_FILE" + if ! grep -q "^\\[deviceProps\\]" "$SECURITY_PATCH_FILE"; then + echo "securityPatch = \"$security_patch\"" >> "$SECURITY_PATCH_FILE" + else + sed -i "s/^\[deviceProps\]/securityPatch = \"$security_patch\"\n&/" "$SECURITY_PATCH_FILE" + fi fi + # Official TrickyStore which supports custom security patch + elif [ "$TS_version" -ge 158 ]; then + SECURITY_PATCH_FILE="/data/adb/tricky_store/security_patch.txt" + printf "system=prop\nboot=%s\nvendor=%s\n" "$security_patch" "$security_patch" > "$SECURITY_PATCH_FILE" + chmod 644 "$SECURITY_PATCH_FILE" # Other else resetprop ro.vendor.build.security_patch "$security_patch" diff --git a/module/webui/index.html b/module/webui/index.html index 56d9841..d68d344 100644 --- a/module/webui/index.html +++ b/module/webui/index.html @@ -290,14 +290,54 @@ -