From b2d8ad97743140592dd3f945585aaa49680239dc Mon Sep 17 00:00:00 2001 From: juewuy Date: Mon, 13 Jul 2026 15:10:50 +0800 Subject: [PATCH] =?UTF-8?q?~=E9=80=82=E9=85=8D1.14+=E7=89=88=E6=9C=ACsingb?= =?UTF-8?q?ox=E5=86=85=E6=A0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/starts/singbox_modify.sh | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/scripts/starts/singbox_modify.sh b/scripts/starts/singbox_modify.sh index b430ec95..659a28d8 100644 --- a/scripts/starts/singbox_modify.sh +++ b/scripts/starts/singbox_modify.sh @@ -55,6 +55,14 @@ extract_base_jsons() { } generate_basic_jsons() { + #适配1.14+版本 + if [ "$(printf '%s' "$core_v" | cut -d. -f2)" -lt 14 ];then + preferred='"ip_accept_any": true,' + detour_direct='"download_detour": "DIRECT"' + else + preferred='"preferred_by": [ "hosts" ],' + detour_direct='"http_client": "detour_direct"' + fi #生成endpoints.json [ "$ts_service" = ON ] || [ "$wg_service" = ON ] && [ "$zip_type" != upx ] && { . "$CRASHDIR"/configs/gateway.cfg @@ -92,7 +100,7 @@ EOF ], "rules": [ { - "preferred_by": [ "hosts" ], + $preferred "server": "hosts" } ] @@ -158,7 +166,7 @@ generate_dns_related_jsons() { "format": "binary", $srs_path "url": "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@sing-box-ruleset/cn.srs", - "http_client": "detour_direct" + $detour_direct } ] }