From 2218251b0314d21be5342c0eba4283ca229469df Mon Sep 17 00:00:00 2001 From: 2dust <31833384+2dust@users.noreply.github.com> Date: Thu, 7 Nov 2024 20:32:08 +0800 Subject: [PATCH] Bug fix https://github.com/2dust/v2rayNG/issues/3895 --- .../kotlin/com/v2ray/ang/ui/ServerActivity.kt | 35 ++++++++++++++----- 1 file changed, 26 insertions(+), 9 deletions(-) diff --git a/V2rayNG/app/src/main/kotlin/com/v2ray/ang/ui/ServerActivity.kt b/V2rayNG/app/src/main/kotlin/com/v2ray/ang/ui/ServerActivity.kt index b841e7c0..57f25648 100644 --- a/V2rayNG/app/src/main/kotlin/com/v2ray/ang/ui/ServerActivity.kt +++ b/V2rayNG/app/src/main/kotlin/com/v2ray/ang/ui/ServerActivity.kt @@ -153,15 +153,32 @@ class ServerActivity : BaseActivity() { sp_header_type_title?.text = if (networks[position] == "grpc") getString(R.string.server_lab_mode_type) else getString(R.string.server_lab_head_type) - config?.headerType?.let { it -> - sp_header_type?.setSelection(Utils.arrayFind(types, it)) - } - config?.host?.let { it -> - et_request_host?.text = Utils.getEditable(it) - } - config?.path?.let { it -> - et_path?.text = Utils.getEditable(it) - } + sp_header_type?.setSelection( + Utils.arrayFind( + types, + when (networks[position]) { + "grpc" -> config?.mode + else -> config?.headerType + }.orEmpty() + ) + ) + + et_request_host?.text = Utils.getEditable( + when (networks[position]) { + "quic" -> config?.quicSecurity + "grpc" -> config?.authority + else -> config?.host + }.orEmpty() + ) + et_path?.text = Utils.getEditable( + when (networks[position]) { + "kcp" -> config?.seed + "quic" -> config?.quicKey + "grpc" -> config?.serviceName + else -> config?.path + }.orEmpty() + ) + tv_request_host?.text = Utils.getEditable( getString( when (networks[position]) {