Skip to content

Commit 7c40d07

Browse files
committed
Bug fix
1 parent c61595e commit 7c40d07

File tree

4 files changed

+9
-7
lines changed

4 files changed

+9
-7
lines changed

V2rayNG/app/src/main/kotlin/com/v2ray/ang/service/V2RayServiceManager.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ object V2RayServiceManager {
5151
set(value) {
5252
field = value
5353
Seq.setContext(value?.get()?.getService()?.applicationContext)
54-
Libv2ray.initV2Env(Utils.userAssetPath(value?.get()?.getService()))//, Utils.getDeviceIdForXUDPBaseKey())
54+
Libv2ray.initV2Env(Utils.userAssetPath(value?.get()?.getService()), Utils.getDeviceIdForXUDPBaseKey())
5555
}
5656
var currentConfig: ServerConfig? = null
5757

V2rayNG/app/src/main/kotlin/com/v2ray/ang/service/V2RayTestService.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class V2RayTestService : Service() {
2424
override fun onCreate() {
2525
super.onCreate()
2626
Seq.setContext(this)
27-
Libv2ray.initV2Env(Utils.userAssetPath(this)) //Utils.getDeviceIdForXUDPBaseKey())
27+
Libv2ray.initV2Env(Utils.userAssetPath(this), Utils.getDeviceIdForXUDPBaseKey())
2828
}
2929

3030
override fun onStartCommand(intent: Intent?, flags: Int, startId: Int): Int {

V2rayNG/app/src/main/kotlin/com/v2ray/ang/service/V2RayVpnService.kt

+4
Original file line numberDiff line numberDiff line change
@@ -138,12 +138,16 @@ class V2RayVpnService : VpnService(), ServiceControl {
138138
}
139139
}
140140

141+
// if (settingsStorage?.decodeBool(AppConfig.PREF_LOCAL_DNS_ENABLED) == true) {
142+
// builder.addDnsServer(PRIVATE_VLAN4_ROUTER)
143+
// } else {
141144
Utils.getVpnDnsServers()
142145
.forEach {
143146
if (Utils.isPureIpAddress(it)) {
144147
builder.addDnsServer(it)
145148
}
146149
}
150+
// }
147151

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

V2rayNG/app/src/main/kotlin/com/v2ray/ang/ui/RoutingEditActivity.kt

+3-5
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,10 @@ package com.v2ray.ang.ui
22

33
import android.os.Bundle
44
import android.text.TextUtils
5-
import android.util.Log
65
import android.view.Menu
76
import android.view.MenuItem
87
import androidx.appcompat.app.AlertDialog
98
import androidx.lifecycle.lifecycleScope
10-
import com.google.gson.Gson
119
import com.v2ray.ang.R
1210
import com.v2ray.ang.databinding.ActivityRoutingEditBinding
1311
import com.v2ray.ang.dto.RulesetItem
@@ -61,9 +59,9 @@ class RoutingEditActivity : BaseActivity() {
6159
val rulesetItem = SettingsManager.getRoutingRuleset(position) ?: RulesetItem()
6260

6361
rulesetItem.remarks = binding.etRemarks.text.toString()
64-
binding.etDomain.text.toString().let { rulesetItem.domain = if (it.isEmpty()) null else it.split(',') }
65-
binding.etIp.text.toString().let { rulesetItem.ip = if (it.isEmpty()) null else it.split(',') }
66-
binding.etProtocol.text.toString().let { rulesetItem.protocol = if (it.isEmpty()) null else it.split(',') }
62+
binding.etDomain.text.toString().let { rulesetItem.domain = if (it.isEmpty()) null else it.split(",").map { itt -> itt.trim() }.filter { itt -> itt.isNotEmpty() } }
63+
binding.etIp.text.toString().let { rulesetItem.ip = if (it.isEmpty()) null else it.split(",").map { itt -> itt.trim() }.filter { itt -> itt.isNotEmpty() } }
64+
binding.etProtocol.text.toString().let { rulesetItem.protocol = if (it.isEmpty()) null else it.split(",").map { itt -> itt.trim() }.filter { itt -> itt.isNotEmpty() } }
6765
binding.etPort.text.toString().let { rulesetItem.port = it.ifEmpty { null } }
6866
binding.etNetwork.text.toString().let { rulesetItem.network = it.ifEmpty { null } }
6967
rulesetItem.outboundTag = outbound_tag[binding.spOutboundTag.selectedItemPosition]

0 commit comments

Comments
 (0)