mirror of
https://github.com/CherretGit/zaprett-app.git
synced 2025-12-11 14:09:37 +05:00
fix ByeDpiVpnService
This commit is contained in:
@@ -266,24 +266,18 @@ class ByeDpiVpnService : VpnService() {
|
|||||||
.flatMap { arg ->
|
.flatMap { arg ->
|
||||||
if (getHostListMode(sharedPreferences) == "whitelist") {
|
if (getHostListMode(sharedPreferences) == "whitelist") {
|
||||||
when {
|
when {
|
||||||
arg == "\$hostlist" && list.isNotEmpty() -> listOf("-H", list)
|
arg == "\$hostlist" && list.isNotEmpty() -> listOf("--hosts", list)
|
||||||
arg == "\$hostlist" && list.isEmpty() -> emptyList()
|
arg == "\$hostlist" && list.isEmpty() -> emptyList()
|
||||||
arg == "\$ipset" && list.isNotEmpty() -> listOf("-H", list)
|
arg == "\$ipset" && list.isNotEmpty() -> listOf("--ipset", list)
|
||||||
arg == "\$ipset" && list.isEmpty() -> emptyList()
|
arg == "\$ipset" && list.isEmpty() -> emptyList()
|
||||||
else -> listOf(arg)
|
else -> listOf(arg)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (list.isNotEmpty()) {
|
when {
|
||||||
listOf("-H", list, "-An", arg).filter { it != "\$hostlist" }
|
arg == "\$hostlist" && list.isNotEmpty() -> listOf("--hosts", list, "-An", list)
|
||||||
} else {
|
arg == "\$ipset" && ipset.isNotEmpty() -> listOf("--ipset", ipset, "-An", ipset)
|
||||||
listOf("-An", arg).filter { it != "\$hostlist" }
|
arg == "\$hostlist" || arg == "\$ipset" -> emptyList()
|
||||||
}
|
else -> listOf(arg)
|
||||||
if (ipset.isEmpty()) {
|
|
||||||
listOf("-H", list, "-An", arg).filter { it != "\$ipset" }
|
|
||||||
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
listOf("-An", arg).filter { it != "\$ipset" }
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user