Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8407fc5825 | ||
|
|
a3e49dcc3d |
@@ -458,12 +458,10 @@ object V2rayConfigUtil {
|
|||||||
rulesIP.outboundTag = tag
|
rulesIP.outboundTag = tag
|
||||||
rulesIP.ip = ArrayList<String>()
|
rulesIP.ip = ArrayList<String>()
|
||||||
|
|
||||||
userRule.trim().replace("\n", "")
|
userRule.split(",").map { it.trim() }.forEach {
|
||||||
.split(",")
|
|
||||||
.forEach {
|
|
||||||
if (Utils.isIpAddress(it) || it.startsWith("geoip:")) {
|
if (Utils.isIpAddress(it) || it.startsWith("geoip:")) {
|
||||||
rulesIP.ip?.add(it)
|
rulesIP.ip?.add(it)
|
||||||
} else if (it.isNotBlank() || it.isNotEmpty())
|
} else if (it.isNotEmpty())
|
||||||
// if (Utils.isValidUrl(it)
|
// if (Utils.isValidUrl(it)
|
||||||
// || it.startsWith("geosite:")
|
// || it.startsWith("geosite:")
|
||||||
// || it.startsWith("regexp:")
|
// || it.startsWith("regexp:")
|
||||||
@@ -487,9 +485,8 @@ object V2rayConfigUtil {
|
|||||||
|
|
||||||
private fun userRule2Domian(userRule: String): ArrayList<String> {
|
private fun userRule2Domian(userRule: String): ArrayList<String> {
|
||||||
val domain = ArrayList<String>()
|
val domain = ArrayList<String>()
|
||||||
userRule.trim().replace("\n", "").split(",").forEach {
|
userRule.split(",").map { it.trim() }.forEach {
|
||||||
if ((it.startsWith("geosite:") || it.startsWith("domain:")) &&
|
if (it.startsWith("geosite:") || it.startsWith("domain:")) {
|
||||||
it.isNotBlank() && it.isNotEmpty()) {
|
|
||||||
domain.add(it)
|
domain.add(it)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user