From e9346303ac379984b6118d1d04736b9e0ef66a73 Mon Sep 17 00:00:00 2001 From: KOWX712 Date: Thu, 14 Nov 2024 21:37:32 +0800 Subject: [PATCH] prevent tspa overwrite --- module/service.sh | 9 +++++++++ module/uninstall.sh | 5 +++++ 2 files changed, 14 insertions(+) diff --git a/module/service.sh b/module/service.sh index e5b8675..cf63a91 100644 --- a/module/service.sh +++ b/module/service.sh @@ -1,18 +1,27 @@ MODPATH=${0%/*} TS="/data/adb/modules/tricky_store" SCRIPT_DIR="/data/adb/tricky_store" +TSPA="/data/adb/modules/tsupport-advance" hash_value=$(grep -v '^#' "$MODPATH/boot_hash" | tr -d '[:space:]') if [ -n "$hash_value" ]; then resetprop -n ro.boot.vbmeta.digest "$hash_value" fi +# Disable TSupport-A auto update target to prevent overwrite +if [ -d "$TSPA" ]; then + touch "/storage/emulated/0/stop-tspa-auto-target" +elif [ ! -d "$TSPA" ] && [ -f "/storage/emulated/0/stop-tspa-auto-target" ]; then + rm -f "/storage/emulated/0/stop-tspa-auto-target" +fi + if [ ! -f "$MODPATH/common/module.prop.orig" ]; then sed -i 's/^description=.*/description=Module is corrupted, please reinstall module./' "$MODPATH/module.prop" touch "$MODPATH/disable" exit 1 fi +# Check availability of Tricky Store module if [ ! -d "$TS" ]; then sed -i 's/^description=.*/description=Tricky store is not installed/' "$MODPATH/module.prop" touch "$MODPATH/disable" diff --git a/module/uninstall.sh b/module/uninstall.sh index f8e2333..24c8bf8 100644 --- a/module/uninstall.sh +++ b/module/uninstall.sh @@ -1,6 +1,11 @@ MODPATH=${0%/*} SCRIPT_DIR="/data/adb/tricky_store" +# Enable back TSupport-A auto update +if [ -f "/storage/emulated/0/stop-tspa-auto-target" ]; then + rm -f "/storage/emulated/0/stop-tspa-auto-target" +fi + # Remove residue and restore original keybox. rm -rf "$SCRIPT_DIR/target_list_config" rm -f "$SCRIPT_DIR/UpdateTargetList.sh"