mirror of
https://github.com/MatsuriDayo/NekoBoxForAndroid.git
synced 2025-12-19 14:40:06 +08:00
update
This commit is contained in:
parent
7b16d9e202
commit
f5e7dd592e
@ -173,7 +173,7 @@ data class ProxyEntity(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun displayType() = when (type) {
|
fun displayType(): String = when (type) {
|
||||||
TYPE_SOCKS -> socksBean!!.protocolName()
|
TYPE_SOCKS -> socksBean!!.protocolName()
|
||||||
TYPE_HTTP -> if (httpBean!!.isTLS()) "HTTPS" else "HTTP"
|
TYPE_HTTP -> if (httpBean!!.isTLS()) "HTTPS" else "HTTP"
|
||||||
TYPE_SS -> "Shadowsocks"
|
TYPE_SS -> "Shadowsocks"
|
||||||
@ -181,7 +181,7 @@ data class ProxyEntity(
|
|||||||
TYPE_TROJAN -> "Trojan"
|
TYPE_TROJAN -> "Trojan"
|
||||||
TYPE_TROJAN_GO -> "Trojan-Go"
|
TYPE_TROJAN_GO -> "Trojan-Go"
|
||||||
TYPE_NAIVE -> "Naïve"
|
TYPE_NAIVE -> "Naïve"
|
||||||
TYPE_HYSTERIA -> "Hysteria"
|
TYPE_HYSTERIA -> "Hysteria" + hysteriaBean!!.protocolVersion
|
||||||
TYPE_SSH -> "SSH"
|
TYPE_SSH -> "SSH"
|
||||||
TYPE_WG -> "WireGuard"
|
TYPE_WG -> "WireGuard"
|
||||||
TYPE_TUIC -> "TUIC"
|
TYPE_TUIC -> "TUIC"
|
||||||
|
|||||||
@ -583,18 +583,20 @@ fun buildSingBoxOutboundTLS(bean: StandardV2RayBean): OutboundTLSOptions? {
|
|||||||
if (bean.sni.isNotBlank()) server_name = bean.sni
|
if (bean.sni.isNotBlank()) server_name = bean.sni
|
||||||
if (bean.alpn.isNotBlank()) alpn = bean.alpn.listByLineOrComma()
|
if (bean.alpn.isNotBlank()) alpn = bean.alpn.listByLineOrComma()
|
||||||
if (bean.certificates.isNotBlank()) certificate = bean.certificates
|
if (bean.certificates.isNotBlank()) certificate = bean.certificates
|
||||||
if (bean.utlsFingerprint.isNotBlank()) {
|
var fp = bean.utlsFingerprint
|
||||||
utls = OutboundUTLSOptions().apply {
|
|
||||||
enabled = true
|
|
||||||
fingerprint = bean.utlsFingerprint
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (bean.realityPubKey.isNotBlank()) {
|
if (bean.realityPubKey.isNotBlank()) {
|
||||||
reality = OutboundRealityOptions().apply {
|
reality = OutboundRealityOptions().apply {
|
||||||
enabled = true
|
enabled = true
|
||||||
public_key = bean.realityPubKey
|
public_key = bean.realityPubKey
|
||||||
short_id = bean.realityShortId
|
short_id = bean.realityShortId
|
||||||
}
|
}
|
||||||
|
if (fp.isNullOrBlank()) fp = "chrome"
|
||||||
|
}
|
||||||
|
if (fp.isNotBlank()) {
|
||||||
|
utls = OutboundUTLSOptions().apply {
|
||||||
|
enabled = true
|
||||||
|
fingerprint = fp
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
package io.nekohasekai.sagernet.ktx
|
package io.nekohasekai.sagernet.ktx
|
||||||
|
|
||||||
|
import io.nekohasekai.sagernet.BuildConfig
|
||||||
import io.nekohasekai.sagernet.fmt.AbstractBean
|
import io.nekohasekai.sagernet.fmt.AbstractBean
|
||||||
import moe.matsuri.nb4a.utils.NGUtil
|
import moe.matsuri.nb4a.utils.NGUtil
|
||||||
import okhttp3.HttpUrl
|
import okhttp3.HttpUrl
|
||||||
@ -62,4 +63,4 @@ fun mkPort(): Int {
|
|||||||
return port
|
return port
|
||||||
}
|
}
|
||||||
|
|
||||||
const val USER_AGENT = "NekoBox/Android/1.0 (Prefer ClashMeta Format)"
|
const val USER_AGENT = "NekoBox/Android/" + BuildConfig.VERSION_NAME + " (Prefer ClashMeta Format)"
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user