基于官方手册少量修改,可用于最新sing-box for android 1.11.0,仅供参考。建议搭配sing-box-subscribe使用。
{
"log": {
"level": "info",
"timestamp": true
},
"dns": {
"servers": [
{
"tag": "google",
"address": "https://dns.google/dns-query",
"address_resolver": "resolver"
},
{
"tag": "local",
"address": "https://dns.alidns.com/dns-query",
"address_resolver": "resolver",
"detour": "direct"
},
{
"tag": "resolver",
"address": "114.114.114.114",
"detour": "direct"
}
],
"rules": [
{
"outbound": "any",
"server": "resolver"
},
{
"clash_mode": "Direct",
"server": "local"
},
{
"clash_mode": "Global",
"server": "google"
},
{
"rule_set": "geosite-geolocation-cn",
"server": "local"
},
{
"type": "logical",
"mode": "and",
"rules": [
{
"rule_set": "geosite-geolocation-!cn",
"invert": true
},
{
"rule_set": "geoip-cn"
}
],
"server": "google",
"client_subnet": "1.0.8.0/24"
}
]
},
"inbounds": [
{
"type": "tun",
"address": [
"172.18.0.1/30",
"fdfe:dcba:9876::1/126"
],
"auto_route": true,
"strict_route": true
}
],
"outbounds": [
{
"type": "selector",
"tag": "select",
"outbounds": [
"auto",
"{all}"
]
},
{
"type": "urltest",
"tag": "auto",
"outbounds": [
"{all}"
]
},
{
"type": "direct",
"tag": "direct"
}
],
"route": {
"rules": [
{
"action": "sniff"
},
{
"protocol": "dns",
"action": "hijack-dns"
},
{
"ip_is_private": true,
"outbound": "direct"
},
{
"clash_mode": "Direct",
"outbound": "direct"
},
{
"clash_mode": "Global",
"outbound": "select"
},
{
"type": "logical",
"mode": "or",
"rules": [
{
"port": 853
},
{
"network": "udp",
"port": 443
},
{
"protocol": "stun"
}
],
"action": "reject"
},
{
"rule_set": [
"geoip-cn",
"geosite-geolocation-cn"
],
"outbound": "direct"
}
],
"rule_set": [
{
"type": "remote",
"tag": "geoip-cn",
"format": "binary",
"url": "https://ghproxy.net/https://raw.githubusercontent.com/lyc8503/sing-box-rules/rule-set-geoip/geoip-cn.srs",
"download_detour": "direct"
},
{
"type": "remote",
"tag": "geosite-geolocation-cn",
"format": "binary",
"url": "https://ghproxy.net/https://raw.githubusercontent.com/lyc8503/sing-box-rules/rule-set-geosite/geosite-geolocation-cn.srs",
"download_detour": "direct"
},
{
"type": "remote",
"tag": "geosite-geolocation-!cn",
"format": "binary",
"url": "https://ghproxy.net/https://raw.githubusercontent.com/lyc8503/sing-box-rules/rule-set-geosite/geosite-geolocation-!cn.srs",
"download_detour": "direct"
}
],
"auto_detect_interface": true,
"override_android_vpn": true
},
"experimental": {
"cache_file": {
"enabled": true,
"store_rdrc": true
},
"clash_api": {
"external_controller": "127.0.0.1:9090"
}
}
}