Skip to content
This repository has been archived by the owner on Nov 14, 2024. It is now read-only.

Commit

Permalink
Fix invalid VPN DNS (#3593)
Browse files Browse the repository at this point in the history
  • Loading branch information
HeXis-YS authored and AnGgIt86 committed Sep 28, 2024
1 parent 2adbbe8 commit 74f0585
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions app/src/main/kotlin/com/neko/v2ray/service/V2RayVpnService.kt
Original file line number Diff line number Diff line change
Expand Up @@ -138,16 +138,12 @@ class V2RayVpnService : VpnService(), ServiceControl {
}
}

if (settingsStorage?.decodeBool(AppConfig.PREF_LOCAL_DNS_ENABLED) == true) {
builder.addDnsServer(PRIVATE_VLAN4_ROUTER)
} else {
Utils.getVpnDnsServers()
.forEach {
if (Utils.isPureIpAddress(it)) {
builder.addDnsServer(it)
}
Utils.getVpnDnsServers()
.forEach {
if (Utils.isPureIpAddress(it)) {
builder.addDnsServer(it)
}
}
}

builder.setSession(V2RayServiceManager.currentConfig?.remarks.orEmpty())

Expand Down

0 comments on commit 74f0585

Please sign in to comment.