support for invisible module update function

This commit is contained in:
KOWX712
2024-11-28 18:03:26 +08:00
parent 5460a2fa5d
commit b7341c80bc

View File

@@ -17,7 +17,7 @@ awk -F'"' '{print $4}' > "$OUTPUT"
if [ ! -s "$OUTPUT" ]; then if [ ! -s "$OUTPUT" ]; then
rm -f "$KBOUTPUT" rm -f "$KBOUTPUT"
skipkb=true skipfetch=true
fi fi
# Find xposed package name # Find xposed package name
@@ -29,12 +29,21 @@ pm list packages -3 </dev/null 2>&1 | cat | awk -F: '{print $2}' | while read -
fi fi
done 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" wget --no-check-certificate -qO "$KBOUTPUT" "https://raw.githubusercontent.com/KOWX712/Tricky-Addon-Update-Target-List/master/.extra"
if [ ! -s "$KBOUTPUT" ]; then if [ ! -s "$KBOUTPUT" ]; then
rm -f "$KBOUTPUT" rm -f "$KBOUTPUT"
fi 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 else
exit 1 exit 1
fi fi