mirror of
https://github.com/MatsuriDayo/NekoBoxForAndroid.git
synced 2025-12-19 14:40: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(path)) path = "";
|
||||||
|
|
||||||
if (JavaUtil.isNullOrBlank(security)) {
|
if (JavaUtil.isNullOrBlank(security)) {
|
||||||
if (this instanceof TrojanBean || isVLESS()) {
|
if (this instanceof TrojanBean) {
|
||||||
security = "tls";
|
security = "tls";
|
||||||
} else {
|
} else {
|
||||||
security = "none";
|
security = "none";
|
||||||
|
|||||||
@ -153,7 +153,7 @@ fun StandardV2RayBean.parseDuckSoft(url: HttpUrl) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type = url.queryParameter("type") ?: "tcp"
|
type = url.queryParameter("type") ?: "tcp"
|
||||||
if (type == "h2") type = "http"
|
if (type == "h2" || url.queryParameter("headerType") == "http") type = "http"
|
||||||
|
|
||||||
security = url.queryParameter("security")
|
security = url.queryParameter("security")
|
||||||
if (security.isNullOrBlank()) {
|
if (security.isNullOrBlank()) {
|
||||||
@ -163,6 +163,9 @@ fun StandardV2RayBean.parseDuckSoft(url: HttpUrl) {
|
|||||||
when (security) {
|
when (security) {
|
||||||
"tls", "reality" -> {
|
"tls", "reality" -> {
|
||||||
security = "tls"
|
security = "tls"
|
||||||
|
url.queryParameter("allowInsecure")?.let {
|
||||||
|
allowInsecure = it == "1" || it == "true"
|
||||||
|
}
|
||||||
url.queryParameter("sni")?.let {
|
url.queryParameter("sni")?.let {
|
||||||
sni = it
|
sni = it
|
||||||
}
|
}
|
||||||
@ -185,16 +188,6 @@ fun StandardV2RayBean.parseDuckSoft(url: HttpUrl) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
when (type) {
|
when (type) {
|
||||||
"tcp" -> {
|
|
||||||
// v2rayNG
|
|
||||||
if (url.queryParameter("headerType") == "http") {
|
|
||||||
url.queryParameter("host")?.let {
|
|
||||||
type = "http"
|
|
||||||
host = it
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
"http" -> {
|
"http" -> {
|
||||||
url.queryParameter("host")?.let {
|
url.queryParameter("host")?.let {
|
||||||
host = it
|
host = it
|
||||||
|
|||||||
@ -251,7 +251,7 @@ object RawUpdater : GroupUpdater() {
|
|||||||
setTLS(proxy["tls"]?.toString() == "true")
|
setTLS(proxy["tls"]?.toString() == "true")
|
||||||
sni = proxy["sni"]?.toString()
|
sni = proxy["sni"]?.toString()
|
||||||
name = proxy["name"]?.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 {
|
"vless" -> VMessBean().apply {
|
||||||
alterId = -1 // make it VLESS
|
alterId = -1 // make it VLESS
|
||||||
packetEncoding = 2 // clash meta default XUDP
|
packetEncoding = 2 // clash meta default XUDP
|
||||||
security = "tls"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
"trojan" -> TrojanBean().apply {
|
"trojan" -> TrojanBean().apply {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user