Skip to content
This repository has been archived by the owner on Nov 14, 2024. It is now read-only.

Commit

Permalink
Repair joinToString with space problem
Browse files Browse the repository at this point in the history
  • Loading branch information
2dust authored and AnGgIt86 committed Sep 28, 2024
1 parent dab99e6 commit 2adbbe8
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 14 deletions.
6 changes: 3 additions & 3 deletions app/src/main/kotlin/com/neko/v2ray/dto/V2rayConfig.kt
Original file line number Diff line number Diff line change
Expand Up @@ -512,8 +512,8 @@ data class V2rayConfig(
val tcpSetting = streamSettings?.tcpSettings ?: return null
listOf(
tcpSetting.header.type,
tcpSetting.header.request?.headers?.Host?.joinToString().orEmpty(),
tcpSetting.header.request?.path?.joinToString().orEmpty()
tcpSetting.header.request?.headers?.Host?.joinToString(",").orEmpty(),
tcpSetting.header.request?.path?.joinToString(",").orEmpty()
)
}

Expand Down Expand Up @@ -557,7 +557,7 @@ data class V2rayConfig(
val h2Setting = streamSettings?.httpSettings ?: return null
listOf(
"",
h2Setting.host.joinToString(),
h2Setting.host.joinToString(","),
h2Setting.path
)
}
Expand Down
6 changes: 3 additions & 3 deletions app/src/main/kotlin/com/neko/v2ray/ui/RoutingEditActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,10 @@ class RoutingEditActivity : BaseActivity() {

private fun bindingServer(rulesetItem: RulesetItem): Boolean {
binding.etRemarks.text = Utils.getEditable(rulesetItem.remarks)
binding.etDomain.text = Utils.getEditable(rulesetItem.domain?.joinToString())
binding.etIp.text = Utils.getEditable(rulesetItem.ip?.joinToString())
binding.etDomain.text = Utils.getEditable(rulesetItem.domain?.joinToString(","))
binding.etIp.text = Utils.getEditable(rulesetItem.ip?.joinToString(","))
binding.etPort.text = Utils.getEditable(rulesetItem.port)
binding.etProtocol.text = Utils.getEditable(rulesetItem.protocol?.joinToString())
binding.etProtocol.text = Utils.getEditable(rulesetItem.protocol?.joinToString(","))
binding.etNetwork.text = Utils.getEditable(rulesetItem.network)
val outbound = Utils.arrayFind(outbound_tag, rulesetItem.outboundTag)
binding.spOutboundTag.setSelection(outbound)
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/kotlin/com/neko/v2ray/ui/ServerActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ class ServerActivity : BaseActivity() {
Utils.getEditable("${WIREGUARD_LOCAL_ADDRESS_V4},${WIREGUARD_LOCAL_ADDRESS_V6}")
} else {
val list = outbound.settings?.address as List<*>
et_local_address?.text = Utils.getEditable(list.joinToString())
et_local_address?.text = Utils.getEditable(list.joinToString(","))
}
if (outbound.settings?.mtu == null) {
et_local_mtu?.text = Utils.getEditable(WIREGUARD_LOCAL_MTU)
Expand Down Expand Up @@ -373,7 +373,7 @@ class ServerActivity : BaseActivity() {
tlsSetting.alpn?.let {
val alpnIndex = Utils.arrayFind(
alpns,
Utils.removeWhiteSpace(tlsSetting.alpn.joinToString()).orEmpty()
Utils.removeWhiteSpace(tlsSetting.alpn.joinToString(",")).orEmpty()
)
sp_stream_alpn?.setSelection(alpnIndex)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ object Hysteria2Fmt {
dicQuery["sni"] = tlsSetting.serverName
}
if (!tlsSetting.alpn.isNullOrEmpty() && tlsSetting.alpn.isNotEmpty()) {
dicQuery["alpn"] = Utils.removeWhiteSpace(tlsSetting.alpn.joinToString()).orEmpty()
dicQuery["alpn"] = Utils.removeWhiteSpace(tlsSetting.alpn.joinToString(",")).orEmpty()
}
}

Expand Down
2 changes: 1 addition & 1 deletion app/src/main/kotlin/com/neko/v2ray/util/fmt/TrojanFmt.kt
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ object TrojanFmt {
}
if (!tlsSetting.alpn.isNullOrEmpty() && tlsSetting.alpn.isNotEmpty()) {
dicQuery["alpn"] =
Utils.removeWhiteSpace(tlsSetting.alpn.joinToString()).orEmpty()
Utils.removeWhiteSpace(tlsSetting.alpn.joinToString(",")).orEmpty()
}
if (!TextUtils.isEmpty(tlsSetting.fingerprint)) {
dicQuery["fp"] = tlsSetting.fingerprint.orEmpty()
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/kotlin/com/neko/v2ray/util/fmt/VlessFmt.kt
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ object VlessFmt {
}
if (!tlsSetting.alpn.isNullOrEmpty() && tlsSetting.alpn.isNotEmpty()) {
dicQuery["alpn"] =
Utils.removeWhiteSpace(tlsSetting.alpn.joinToString()).orEmpty()
Utils.removeWhiteSpace(tlsSetting.alpn.joinToString(",")).orEmpty()
}
if (!TextUtils.isEmpty(tlsSetting.fingerprint)) {
dicQuery["fp"] = tlsSetting.fingerprint.orEmpty()
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/kotlin/com/neko/v2ray/util/fmt/VmessFmt.kt
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ object VmessFmt {
vmessQRCode.tls = streamSetting.security
vmessQRCode.sni = streamSetting.tlsSettings?.serverName.orEmpty()
vmessQRCode.alpn =
Utils.removeWhiteSpace(streamSetting.tlsSettings?.alpn?.joinToString()).orEmpty()
Utils.removeWhiteSpace(streamSetting.tlsSettings?.alpn?.joinToString(",")).orEmpty()
vmessQRCode.fp = streamSetting.tlsSettings?.fingerprint.orEmpty()
outbound.getTransportSettingDetails()?.let { transportDetails ->
vmessQRCode.type = transportDetails[0]
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/kotlin/com/neko/v2ray/util/fmt/WireguardFmt.kt
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,12 @@ object WireguardFmt {
Utils.urlEncode(outbound.settings?.peers?.get(0)?.publicKey.toString())
if (outbound.settings?.reserved != null) {
dicQuery["reserved"] = Utils.urlEncode(
Utils.removeWhiteSpace(outbound.settings?.reserved?.joinToString())
Utils.removeWhiteSpace(outbound.settings?.reserved?.joinToString(","))
.toString()
)
}
dicQuery["address"] = Utils.urlEncode(
Utils.removeWhiteSpace((outbound.settings?.address as List<*>).joinToString())
Utils.removeWhiteSpace((outbound.settings?.address as List<*>).joinToString(","))
.toString()
)
if (outbound.settings?.mtu != null) {
Expand Down

0 comments on commit 2adbbe8

Please sign in to comment.