Restructure index.js, simplify translation process

No big change
This commit is contained in:
KOWX712
2024-12-24 22:25:41 +08:00
parent 5347ac29bf
commit de43439200
22 changed files with 896 additions and 867 deletions

View File

@@ -47,11 +47,28 @@ check_update() {
REMOTE_VERSION=$(echo "$JSON" | grep -o '"versionCode": *[0-9]*' | awk -F: '{print $2}' | tr -d ' ')
LOCAL_VERSION=$(grep -o 'versionCode=[0-9]*' "$MODPATH/update/module.prop" | awk -F= '{print $2}')
if [ "$REMOTE_VERSION" -gt "$LOCAL_VERSION" ]; then
echo "update"
if [ "$MODPATH" = "/data/adb/modules/.TA_utl/common" ]; then
[ -d "/data/adb/modules/TA_utl" ] && rm -rf "/data/adb/modules/TA_utl"
cp -rf "$MODPATH/update" "/data/adb/modules/TA_utl"
else
cp -f "$MODPATH/update/module.prop" "/data/adb/modules/TA_utl/module.prop"
fi
echo "update"
fi
fi
}
uninstall() {
if [ "$MODPATH" = "/data/adb/modules/.TA_utl/common" ]; then
[ -d "/data/adb/modules/TA_utl" ] && rm -rf "/data/adb/modules/TA_utl"
cp -rf "$MODPATH/update" "/data/adb/modules/TA_utl"
else
cp -f "$MODPATH/update/module.prop" "/data/adb/modules/TA_utl/module.prop"
fi
touch "/data/adb/modules/TA_utl/remove"
}
case "$1" in
--kb)
get_kb
@@ -69,4 +86,8 @@ case "$1" in
check_update
exit
;;
--uninstall)
uninstall
exit
;;
esac