mirror of
https://github.com/MatsuriDayo/NekoBoxForAndroid.git
synced 2025-12-18 22:20:06 +08:00
fix: resolve some configuration parsing issues
This commit is contained in:
parent
98c3534ae5
commit
0ffa4d0bdd
@ -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";
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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 {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user