Rule start with ext and contains geoip added to the ips
https://github.com/2dust/v2rayNG/issues/3060
This commit is contained in:
@@ -2,7 +2,7 @@ package com.v2ray.ang.util
|
||||
|
||||
import android.content.Context
|
||||
import android.text.TextUtils
|
||||
import com.google.gson.*
|
||||
import com.google.gson.Gson
|
||||
import com.tencent.mmkv.MMKV
|
||||
import com.v2ray.ang.AppConfig
|
||||
import com.v2ray.ang.AppConfig.PROTOCOL_FREEDOM
|
||||
@@ -10,9 +10,9 @@ import com.v2ray.ang.AppConfig.TAG_DIRECT
|
||||
import com.v2ray.ang.AppConfig.TAG_FRAGMENT
|
||||
import com.v2ray.ang.AppConfig.WIREGUARD_LOCAL_ADDRESS_V4
|
||||
import com.v2ray.ang.AppConfig.WIREGUARD_LOCAL_ADDRESS_V6
|
||||
import com.v2ray.ang.dto.V2rayConfig
|
||||
import com.v2ray.ang.dto.EConfigType
|
||||
import com.v2ray.ang.dto.ERoutingMode
|
||||
import com.v2ray.ang.dto.V2rayConfig
|
||||
import com.v2ray.ang.dto.V2rayConfig.Companion.DEFAULT_NETWORK
|
||||
import com.v2ray.ang.dto.V2rayConfig.Companion.HTTP
|
||||
|
||||
@@ -286,15 +286,11 @@ object V2rayConfigUtil {
|
||||
rulesIP.ip = ArrayList()
|
||||
|
||||
userRule.split(",").map { it.trim() }.forEach {
|
||||
if (Utils.isIpAddress(it) || it.startsWith("geoip:")) {
|
||||
if (it.startsWith("ext:") && it.contains("geoip")) {
|
||||
rulesIP.ip?.add(it)
|
||||
} else if (it.isNotEmpty())
|
||||
// if (Utils.isValidUrl(it)
|
||||
// || it.startsWith("geosite:")
|
||||
// || it.startsWith("regexp:")
|
||||
// || it.startsWith("domain:")
|
||||
// || it.startsWith("full:"))
|
||||
{
|
||||
} else if (Utils.isIpAddress(it) || it.startsWith("geoip:")) {
|
||||
rulesIP.ip?.add(it)
|
||||
} else if (it.isNotEmpty()) {
|
||||
rulesDomain.domain?.add(it)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user