~适配1.14+版本singbox内核

This commit is contained in:
juewuy
2026-07-13 15:10:50 +08:00
parent a3f2aa9b96
commit b2d8ad9774

View File

@@ -55,6 +55,14 @@ extract_base_jsons() {
} }
generate_basic_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 #生成endpoints.json
[ "$ts_service" = ON ] || [ "$wg_service" = ON ] && [ "$zip_type" != upx ] && { [ "$ts_service" = ON ] || [ "$wg_service" = ON ] && [ "$zip_type" != upx ] && {
. "$CRASHDIR"/configs/gateway.cfg . "$CRASHDIR"/configs/gateway.cfg
@@ -92,7 +100,7 @@ EOF
], ],
"rules": [ "rules": [
{ {
"preferred_by": [ "hosts" ], $preferred
"server": "hosts" "server": "hosts"
} }
] ]
@@ -158,7 +166,7 @@ generate_dns_related_jsons() {
"format": "binary", "format": "binary",
$srs_path $srs_path
"url": "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@sing-box-ruleset/cn.srs", "url": "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@sing-box-ruleset/cn.srs",
"http_client": "detour_direct" $detour_direct
} }
] ]
} }