update v2rayN share link

This commit is contained in:
arm64v8a 2023-03-22 22:09:29 +09:00
parent 225b60f8ac
commit be5962df8b
2 changed files with 20 additions and 5 deletions

View File

@ -31,8 +31,11 @@ enum class PluginEntry(
TUIC( TUIC(
"tuic-plugin", "tuic-plugin",
SagerNet.application.getString(R.string.action_tuic), SagerNet.application.getString(R.string.action_tuic),
"io.nekohasekai.sagernet.plugin.tuic", "moe.matsuri.exe.tuic", DownloadSource(
DownloadSource(fdroid = false) playStore = false,
fdroid = false,
downloadLink = "https://github.com/MatsuriDayo/plugins/releases?q=tuic"
)
), ),
; ;

View File

@ -158,6 +158,12 @@ fun StandardV2RayBean.parseDuckSoft(url: HttpUrl) {
url.queryParameter("cert")?.let { url.queryParameter("cert")?.let {
certificates = it certificates = it
} }
url.queryParameter("pbk")?.let {
realityPubKey = it
}
url.queryParameter("sid")?.let {
realityShortId = it
}
} }
} }
when (type) { when (type) {
@ -293,7 +299,7 @@ fun parseV2RayN(link: String): VMessBean {
bean.encryption = vmessQRCode.scy bean.encryption = vmessQRCode.scy
bean.uuid = vmessQRCode.id bean.uuid = vmessQRCode.id
bean.alterId = vmessQRCode.aid.toIntOrNull() bean.alterId = vmessQRCode.aid.toIntOrNull()
bean.type = vmessQRCode.type bean.type = vmessQRCode.net
bean.host = vmessQRCode.host bean.host = vmessQRCode.host
bean.path = vmessQRCode.path bean.path = vmessQRCode.path
val headerType = vmessQRCode.type val headerType = vmessQRCode.type
@ -305,10 +311,11 @@ fun parseV2RayN(link: String): VMessBean {
} }
} }
} }
when (vmessQRCode.tls) {
"tls", "reality" -> bean.security = "tls"
}
bean.name = vmessQRCode.ps bean.name = vmessQRCode.ps
bean.security = vmessQRCode.tls
if (bean.security == "reality") bean.security = "tls"
bean.sni = vmessQRCode.sni bean.sni = vmessQRCode.sni
bean.alpn = vmessQRCode.alpn.replace(",", "\n") bean.alpn = vmessQRCode.alpn.replace(",", "\n")
bean.utlsFingerprint = vmessQRCode.fp bean.utlsFingerprint = vmessQRCode.fp
@ -454,6 +461,11 @@ fun StandardV2RayBean.toUriVMessVLESSTrojan(isTrojan: Boolean): String {
if (utlsFingerprint.isNotBlank()) { if (utlsFingerprint.isNotBlank()) {
builder.addQueryParameter("fp", utlsFingerprint) builder.addQueryParameter("fp", utlsFingerprint)
} }
if (realityPubKey.isNotBlank()) {
builder.setQueryParameter("security", "reality")
builder.addQueryParameter("pbk", realityPubKey)
builder.addQueryParameter("sid", realityShortId)
}
} }
} }
} }