Shamrock: 修复被动WS缺失链接

Signed-off-by: WhiteChi <whitechi73@outlook.com>
This commit is contained in:
WhiteChi 2023-11-01 23:59:47 +08:00
parent 86b29b982c
commit c67b49790f
3 changed files with 10 additions and 5 deletions

View File

@ -257,7 +257,7 @@ private fun APIInfoCard(
hint = "请输入被动地址",
error = "输入的地址不合法",
checker = {
it.startsWith("ws://") || it.startsWith("wss://") || it.isBlank()
true
},
confirm = {
if (it.startsWith("ws://") || it.startsWith("wss://") || it.isBlank()) {

View File

@ -52,13 +52,18 @@ internal object ShamrockConfig {
it.port = wsPort
}
Config.passiveWebSocket = intent.getStringExtra("ws_addr")?.split(",", "|", "")?.filter { address ->
val newPassiveWebSocketList = intent.getStringExtra("ws_addr")?.split(",", "|", "")?.filter { address ->
Config.passiveWebSocket?.any {
it.address == address
} != true
}?.map {
ConnectionConfig(address = it)
}?.toMutableList()
if (Config.passiveWebSocket == null) {
Config.passiveWebSocket = newPassiveWebSocketList
} else {
Config.passiveWebSocket?.addAll(newPassiveWebSocketList ?: emptyList())
}
putString( "key_store", intent.getStringExtra("key_store")) // 证书路径
putString( "ssl_pwd", intent.getStringExtra("ssl_pwd")) // 证书密码

View File

@ -30,9 +30,9 @@ val GlobalJson = Json {
val GlobalJson5 = Json5 {
prettyPrint = true
indentationWidth = 2
useSingleQuotes = true
quoteMemberNames = true
encodeDefaults = true
//useSingleQuotes = true
//quoteMemberNames = true
//encodeDefaults = true
}
val String.asJson: JsonElement