fix: resolve some configuration parsing issues

This commit is contained in:
Restia-Ashbell 2025-04-13 19:51:29 +08:00 committed by armv9
parent 98c3534ae5
commit 0ffa4d0bdd
3 changed files with 6 additions and 14 deletions

View File

@ -81,7 +81,7 @@ public abstract class StandardV2RayBean extends AbstractBean {
if (JavaUtil.isNullOrBlank(path)) path = "";
if (JavaUtil.isNullOrBlank(security)) {
if (this instanceof TrojanBean || isVLESS()) {
if (this instanceof TrojanBean) {
security = "tls";
} else {
security = "none";

View File

@ -153,7 +153,7 @@ fun StandardV2RayBean.parseDuckSoft(url: HttpUrl) {
}
type = url.queryParameter("type") ?: "tcp"
if (type == "h2") type = "http"
if (type == "h2" || url.queryParameter("headerType") == "http") type = "http"
security = url.queryParameter("security")
if (security.isNullOrBlank()) {
@ -163,6 +163,9 @@ fun StandardV2RayBean.parseDuckSoft(url: HttpUrl) {
when (security) {
"tls", "reality" -> {
security = "tls"
url.queryParameter("allowInsecure")?.let {
allowInsecure = it == "1" || it == "true"
}
url.queryParameter("sni")?.let {
sni = it
}
@ -185,16 +188,6 @@ fun StandardV2RayBean.parseDuckSoft(url: HttpUrl) {
}
when (type) {
"tcp" -> {
// v2rayNG
if (url.queryParameter("headerType") == "http") {
url.queryParameter("host")?.let {
type = "http"
host = it
}
}
}
"http" -> {
url.queryParameter("host")?.let {
host = it

View File

@ -251,7 +251,7 @@ object RawUpdater : GroupUpdater() {
setTLS(proxy["tls"]?.toString() == "true")
sni = proxy["sni"]?.toString()
name = proxy["name"]?.toString()
allowInsecure = proxy["name"]?.toString() == "true"
allowInsecure = proxy["skip-cert-verify"]?.toString() == "true"
})
}
@ -296,7 +296,6 @@ object RawUpdater : GroupUpdater() {
"vless" -> VMessBean().apply {
alterId = -1 // make it VLESS
packetEncoding = 2 // clash meta default XUDP
security = "tls"
}
"trojan" -> TrojanBean().apply {