Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
arm64v8a committed Oct 15, 2023
1 parent 7b16d9e commit f5e7dd5
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -173,15 +173,15 @@ data class ProxyEntity(
}
}

fun displayType() = when (type) {
fun displayType(): String = when (type) {
TYPE_SOCKS -> socksBean!!.protocolName()
TYPE_HTTP -> if (httpBean!!.isTLS()) "HTTPS" else "HTTP"
TYPE_SS -> "Shadowsocks"
TYPE_VMESS -> if (vmessBean!!.isVLESS) "VLESS" else "VMess"
TYPE_TROJAN -> "Trojan"
TYPE_TROJAN_GO -> "Trojan-Go"
TYPE_NAIVE -> "Naïve"
TYPE_HYSTERIA -> "Hysteria"
TYPE_HYSTERIA -> "Hysteria" + hysteriaBean!!.protocolVersion
TYPE_SSH -> "SSH"
TYPE_WG -> "WireGuard"
TYPE_TUIC -> "TUIC"
Expand Down
14 changes: 8 additions & 6 deletions app/src/main/java/io/nekohasekai/sagernet/fmt/v2ray/V2RayFmt.kt
Original file line number Diff line number Diff line change
Expand Up @@ -583,18 +583,20 @@ fun buildSingBoxOutboundTLS(bean: StandardV2RayBean): OutboundTLSOptions? {
if (bean.sni.isNotBlank()) server_name = bean.sni
if (bean.alpn.isNotBlank()) alpn = bean.alpn.listByLineOrComma()
if (bean.certificates.isNotBlank()) certificate = bean.certificates
if (bean.utlsFingerprint.isNotBlank()) {
utls = OutboundUTLSOptions().apply {
enabled = true
fingerprint = bean.utlsFingerprint
}
}
var fp = bean.utlsFingerprint
if (bean.realityPubKey.isNotBlank()) {
reality = OutboundRealityOptions().apply {
enabled = true
public_key = bean.realityPubKey
short_id = bean.realityShortId
}
if (fp.isNullOrBlank()) fp = "chrome"
}
if (fp.isNotBlank()) {
utls = OutboundUTLSOptions().apply {
enabled = true
fingerprint = fp
}
}
}
}
Expand Down
3 changes: 2 additions & 1 deletion app/src/main/java/io/nekohasekai/sagernet/ktx/Nets.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

package io.nekohasekai.sagernet.ktx

import io.nekohasekai.sagernet.BuildConfig
import io.nekohasekai.sagernet.fmt.AbstractBean
import moe.matsuri.nb4a.utils.NGUtil
import okhttp3.HttpUrl
Expand Down Expand Up @@ -62,4 +63,4 @@ fun mkPort(): Int {
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)"

0 comments on commit f5e7dd5

Please sign in to comment.