Bug fix
This commit is contained in:
1 parent
e5d498ea6e
commit
84e7ee4ef3
3 files changed
+8
-6
No files matched your search
@@ -3,7 +3,6 @@ package com.v2ray.ang.dto
|
||||
import com.v2ray.ang.AppConfig.TAG_BLOCKED
|
||||
import com.v2ray.ang.AppConfig.TAG_DIRECT
|
||||
import com.v2ray.ang.AppConfig.TAG_PROXY
|
||||
import com.v2ray.ang.util.JsonUtil
|
||||
import com.v2ray.ang.util.Utils
|
||||
|
||||
data class ProfileItem(
|
||||
@@ -67,9 +66,10 @@ data class ProfileItem(
|
||||
return Utils.getIpv6Address(server) + ":" + serverPort
|
||||
}
|
||||
|
||||
fun getKeyProperty(): String {
|
||||
subscriptionId = ""
|
||||
addedTime = 0L
|
||||
return JsonUtil.toJson(this)
|
||||
fun getKeyProperty(): ProfileItem {
|
||||
val copy = this.copy()
|
||||
copy.subscriptionId = ""
|
||||
copy.addedTime = 0L
|
||||
return copy
|
||||
}
|
||||
}
|
||||
@@ -209,6 +209,7 @@ object AngConfigManager {
|
||||
|
||||
var count = 0
|
||||
servers.lines()
|
||||
.distinct()
|
||||
.forEach { str ->
|
||||
if (Utils.isValidSubUrl(str)) {
|
||||
count += importUrlAsSubscription(str)
|
||||
@@ -246,6 +247,7 @@ object AngConfigManager {
|
||||
val subItem = MmkvManager.decodeSubscription(subid)
|
||||
var count = 0
|
||||
servers.lines()
|
||||
.distinct()
|
||||
.reversed()
|
||||
.forEach {
|
||||
val resId = parseConfig(it, subid, subItem, removedSelectedServer)
|
||||
|
||||
@@ -266,7 +266,7 @@ class MainViewModel(application: Application) : AndroidViewModel(application) {
|
||||
serversCacheCopy.forEachIndexed { index2, it2 ->
|
||||
if (index2 > index) {
|
||||
val outbound2 = it2.second.getKeyProperty()
|
||||
if (outbound == outbound2 && !deleteServer.contains(it2.first)) {
|
||||
if (outbound.equals(outbound2) && !deleteServer.contains(it2.first)) {
|
||||
deleteServer.add(it2.first)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user