Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions V2rayNG/app/src/main/java/com/v2ray/ang/AppConfig.kt
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ object AppConfig {
const val TAG_DIRECT = "direct"
const val TAG_BLOCKED = "block"
const val TAG_FRAGMENT = "fragment"
const val TAG_DNS = "dns-module"
const val TAG_DOMESTIC_DNS = "domestic-dns"

/** Network-related constants. */
const val UPLINK = "uplink"
Expand Down
1 change: 1 addition & 0 deletions V2rayNG/app/src/main/java/com/v2ray/ang/dto/V2rayConfig.kt
Original file line number Diff line number Diff line change
Expand Up @@ -490,6 +490,7 @@ data class V2rayConfig(
var expectIPs: List<String>? = null,
val clientIp: String? = null,
val skipFallback: Boolean? = null,
val tag: String? = null,
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -574,18 +574,8 @@ object V2rayConfigManager {
address = domesticDns.first(),
domains = directDomain,
expectIPs = if (isCnRoutingMode) geoipCn else null,
skipFallback = true
)
)
}

if (Utils.isPureIpAddress(domesticDns.first())) {
v2rayConfig.routing.rules.add(
0, RulesBean(
outboundTag = AppConfig.TAG_DIRECT,
port = "53",
ip = arrayListOf(domesticDns.first()),
domain = null
skipFallback = true,
tag = AppConfig.TAG_DOMESTIC_DNS
)
)
}
Expand Down Expand Up @@ -626,20 +616,26 @@ object V2rayConfigManager {
// DNS dns
v2rayConfig.dns = V2rayConfig.DnsBean(
servers = servers,
hosts = hosts
hosts = hosts,
tag = AppConfig.TAG_DNS
)

// DNS routing
if (Utils.isPureIpAddress(remoteDns.first())) {
v2rayConfig.routing.rules.add(
0, RulesBean(
outboundTag = AppConfig.TAG_PROXY,
port = "53",
ip = arrayListOf(remoteDns.first()),
domain = null
)
v2rayConfig.routing.rules.add(
0, RulesBean(
outboundTag = AppConfig.TAG_PROXY,
inboundTag = arrayListOf(AppConfig.TAG_DNS),
domain = null
)
}
)

v2rayConfig.routing.rules.add(
0, RulesBean(
outboundTag = AppConfig.TAG_DIRECT,
inboundTag = arrayListOf(AppConfig.TAG_DOMESTIC_DNS),
domain = null
)
)
} catch (e: Exception) {
Log.e(AppConfig.TAG, "Failed to configure DNS", e)
return false
Expand Down
3 changes: 3 additions & 0 deletions V2rayNG/app/src/main/java/com/v2ray/ang/ui/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,9 @@ class MainActivity : BaseActivity(), NavigationView.OnNavigationItemSelectedList
}

R.id.intelligent_selection_all -> {
if (MmkvManager.decodeSettingsString(AppConfig.PREF_OUTBOUND_DOMAIN_RESOLVE_METHOD, "1") != "0") {
toast(getString(R.string.pre_resolving_domain))
}
mainViewModel.createIntelligentSelectionAll()
true
}
Expand Down
1 change: 1 addition & 0 deletions V2rayNG/app/src/main/res/values-ar/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -377,5 +377,6 @@
<item>Least Ping</item>
<item>Least Load</item>
</string-array>
<string name="pre_resolving_domain">Pre-resolving domain…</string>

</resources>
1 change: 1 addition & 0 deletions V2rayNG/app/src/main/res/values-bn/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -382,5 +382,6 @@
<item>Least Ping</item>
<item>Least Load</item>
</string-array>
<string name="pre_resolving_domain">Pre-resolving domain…</string>

</resources>
1 change: 1 addition & 0 deletions V2rayNG/app/src/main/res/values-bqi-rIR/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -392,5 +392,6 @@
<item>کم ترین پینگ</item>
<item>کم ترین بار(لود)</item>
</string-array>
<string name="pre_resolving_domain">Pre-resolving domain…</string>

</resources>
1 change: 1 addition & 0 deletions V2rayNG/app/src/main/res/values-fa/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -391,5 +391,6 @@
<item>کمترین پینگ</item>
<item>کمترین بار(لود)</item>
</string-array>
<string name="pre_resolving_domain">Pre-resolving domain…</string>

</resources>
1 change: 1 addition & 0 deletions V2rayNG/app/src/main/res/values-ru/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -391,5 +391,6 @@
<item>Наименьшая задержка</item>
<item>Наименьшая нагрузка</item>
</string-array>
<string name="pre_resolving_domain">Pre-resolving domain…</string>

</resources>
1 change: 1 addition & 0 deletions V2rayNG/app/src/main/res/values-vi/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -379,5 +379,6 @@
<item>Least Ping</item>
<item>Least Load</item>
</string-array>
<string name="pre_resolving_domain">Pre-resolving domain…</string>

</resources>
1 change: 1 addition & 0 deletions V2rayNG/app/src/main/res/values-zh-rCN/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -383,5 +383,6 @@
<item>最低延迟</item>
<item>最稳定</item>
</string-array>
<string name="pre_resolving_domain">预解析域名中…</string>

</resources>
1 change: 1 addition & 0 deletions V2rayNG/app/src/main/res/values-zh-rTW/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -383,5 +383,6 @@
<item>Least Ping</item>
<item>Least Load</item>
</string-array>
<string name="pre_resolving_domain">Pre-resolving domain…</string>

</resources>
1 change: 1 addition & 0 deletions V2rayNG/app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -395,5 +395,6 @@
<item>Least Ping</item>
<item>Least Load</item>
</string-array>
<string name="pre_resolving_domain">Pre-resolving domain…</string>

</resources>