mirror of
https://github.com/MatsuriDayo/NekoBoxForAndroid.git
synced 2025-12-19 14:40:06 +08:00
fix: v2rayfmt
This commit is contained in:
parent
9b055391ee
commit
478f826c6f
@ -155,6 +155,9 @@ fun StandardV2RayBean.parseDuckSoft(url: HttpUrl) {
|
||||
url.queryParameter("sni")?.let {
|
||||
sni = it
|
||||
}
|
||||
url.queryParameter("host")?.let {
|
||||
if (sni.isNullOrBlank()) sni = it
|
||||
}
|
||||
url.queryParameter("alpn")?.let {
|
||||
alpn = it.replace(",", "\n")
|
||||
}
|
||||
@ -169,6 +172,7 @@ fun StandardV2RayBean.parseDuckSoft(url: HttpUrl) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
when (type) {
|
||||
"tcp" -> {
|
||||
// v2rayNG
|
||||
@ -307,6 +311,7 @@ fun parseV2RayN(link: String): VMessBean {
|
||||
throw Exception("invalid VmessQRCode")
|
||||
}
|
||||
|
||||
bean.name = vmessQRCode.ps
|
||||
bean.serverAddress = vmessQRCode.add
|
||||
bean.serverPort = vmessQRCode.port.toIntOrNull()
|
||||
bean.encryption = vmessQRCode.scy
|
||||
@ -325,13 +330,14 @@ fun parseV2RayN(link: String): VMessBean {
|
||||
}
|
||||
}
|
||||
when (vmessQRCode.tls) {
|
||||
"tls", "reality" -> bean.security = "tls"
|
||||
}
|
||||
|
||||
bean.name = vmessQRCode.ps
|
||||
"tls", "reality" -> {
|
||||
bean.security = "tls"
|
||||
bean.sni = vmessQRCode.sni
|
||||
if (bean.sni.isNullOrBlank()) bean.sni = bean.host
|
||||
bean.alpn = vmessQRCode.alpn.replace(",", "\n")
|
||||
bean.utlsFingerprint = vmessQRCode.fp
|
||||
}
|
||||
}
|
||||
|
||||
return bean
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user