From cf3e360be024fdae0e93d3fe8c698569794faad8 Mon Sep 17 00:00:00 2001 From: taamarin <71506581+taamarin@users.noreply.github.com> Date: Thu, 4 Sep 2025 02:29:40 +0700 Subject: [PATCH] feat: support Base64 subscription(clash/momo) file in box.tool --- box/scripts/box.tool | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/box/scripts/box.tool b/box/scripts/box.tool index 823b5cf..00693d0 100755 --- a/box/scripts/box.tool +++ b/box/scripts/box.tool @@ -441,6 +441,14 @@ upsubs() { elif ${yq} '.. | select(tag == "!!str")' "${update_file_name}" | grep -qE "vless://|vmess://|ss://|hysteria://|trojan://"; then mv "${update_file_name}" "${clash_provide_config}" + elif grep -qE '^[A-Za-z0-9+/=[:space:]]+$' "$update_file_name"; then + if busybox base64 -d "$update_file_name" >/dev/null 2>&1; then + log Debug "File is valid Base64" + mv "${update_file_name}" "${clash_provide_config}" + else + log Error "File is not valid Base64" + return 1 + fi else log Error "${update_file_name} update subscription failed" return 1