From b7341c80bccd33e273e112a1289a1d7e2a4d3de8 Mon Sep 17 00:00:00 2001 From: KOWX712 Date: Thu, 28 Nov 2024 18:03:26 +0800 Subject: [PATCH] support for invisible module update function --- module/common/get_extra.sh | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/module/common/get_extra.sh b/module/common/get_extra.sh index caac364..0b7f7e1 100644 --- a/module/common/get_extra.sh +++ b/module/common/get_extra.sh @@ -17,7 +17,7 @@ awk -F'"' '{print $4}' > "$OUTPUT" if [ ! -s "$OUTPUT" ]; then rm -f "$KBOUTPUT" - skipkb=true + skipfetch=true fi # Find xposed package name @@ -29,12 +29,21 @@ pm list packages -3 &1 | cat | awk -F: '{print $2}' | while read - fi done -if [ "$skipkb" != "true" ]; then +if [ "$skipfetch" != "true" ]; then wget --no-check-certificate -qO "$KBOUTPUT" "https://raw.githubusercontent.com/KOWX712/Tricky-Addon-Update-Target-List/master/.extra" if [ ! -s "$KBOUTPUT" ]; then rm -f "$KBOUTPUT" fi + + if [ -d "$MODPATH/temp" ]; then + JSON=$(wget --no-check-certificate -q -O - "https://raw.githubusercontent.com/KOWX712/Tricky-Addon-Update-Target-List/master/update.json") + REMOTE_VERSION=$(echo "$JSON" | grep -o '"versionCode": *[0-9]*' | awk -F: '{print $2}' | tr -d ' ') + LOCAL_VERSION=$(grep -o 'versionCode=[0-9]*' "$MODPATH/temp/module.prop" | awk -F= '{print $2}') + if [ "$REMOTE_VERSION" -gt "$LOCAL_VERSION" ]; then + echo "update" + fi + fi else exit 1 fi \ No newline at end of file