From 79f802381f48838f2da46311fc12666a99dd717d Mon Sep 17 00:00:00 2001 From: Olia Lisa Date: Sat, 23 May 2026 15:22:04 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=BD=AC=E6=8D=A2=E8=84=9A?= =?UTF-8?q?=E6=9C=AC=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- transform_Indescribable.sh | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/transform_Indescribable.sh b/transform_Indescribable.sh index 9116f6b..d2e4a24 100644 --- a/transform_Indescribable.sh +++ b/transform_Indescribable.sh @@ -1,6 +1,5 @@ #!/bin/bash - FILE="$(pwd)/Indescribable" if [[ ! -f "$FILE" ]]; then @@ -8,7 +7,12 @@ if [[ ! -f "$FILE" ]]; then exit 1 fi -# 原地处理: 替换每行第一个 %3A 为 : 后, base64 编码,写回同一文件 -sed 's/%3A/:/' "$FILE" | base64 -w 0 > "${FILE}.tmp" && mv "${FILE}.tmp" "$FILE" +# 1. 解码 base64 +# 2. 仅对 tuic 开头的行替换第一个 %3A 为 : +# 3. 重新 base64 编码(单行,-w 0) +base64 -d "$FILE" \ + | sed '/^tuic/s/%3A/:/' \ + | base64 -w 0 > "${FILE}.tmp" \ + && mv "${FILE}.tmp" "$FILE" echo "[成功] 文件 '$FILE' 已成功转换并保存。" \ No newline at end of file