Skip to content

Commit 5637c46

Browse files
committed
global mode improvements
1 parent 40eb9f2 commit 5637c46

1 file changed

Lines changed: 3 additions & 11 deletions

File tree

app/src/main/java/io/nekohasekai/sagernet/fmt/ConfigBuilder.kt

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -524,15 +524,6 @@ fun buildConfig(
524524
if (!forTest && DataStore.globalMode) {
525525
// 全局模式下的规则处理
526526

527-
// DNS查询规则:DNS查询也通过代理
528-
// if (enableDnsRouting && !useFakeDns) {
529-
if (enableDnsRouting) {
530-
route.rules.add(Rule_DefaultOptions().apply {
531-
protocol = listOf("dns")
532-
outbound = TAG_PROXY
533-
})
534-
}
535-
536527
// 绕过内部网络(如果启用)
537528
if (DataStore.bypassLan) {
538529
route.rules.add(Rule_DefaultOptions().apply {
@@ -543,7 +534,7 @@ fun buildConfig(
543534
"10.0.0.0/8",
544535
"192.168.0.0/16",
545536
"169.254.0.0/16",
546-
"::/128",
537+
"::1/128",
547538
"fc00::/7",
548539
"fe80::/10"
549540
)
@@ -560,6 +551,8 @@ fun buildConfig(
560551
inbound = listOf(TAG_MIXED)
561552
outbound = TAG_PROXY
562553
})
554+
555+
route.final_ = TAG_PROXY
563556
} else {
564557
// 应用用户规则
565558
for (rule in extraRules) {
@@ -917,4 +910,3 @@ fun buildConfig(
917910
}
918911

919912
}
920-

0 commit comments

Comments
 (0)