From f933348310a99559d7730baf0a95dfcc1d608602 Mon Sep 17 00:00:00 2001 From: Teddysun Date: Fri, 28 May 2021 07:59:41 +0900 Subject: [PATCH] Add support for gRPC protocol Fixed a initialize plugin option problem Signed-off-by: Teddysun --- .../com/github/shadowsocks/plugin/v2ray/ConfigFragment.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/com/github/shadowsocks/plugin/v2ray/ConfigFragment.kt b/app/src/main/java/com/github/shadowsocks/plugin/v2ray/ConfigFragment.kt index 8e77657..499ddbb 100644 --- a/app/src/main/java/com/github/shadowsocks/plugin/v2ray/ConfigFragment.kt +++ b/app/src/main/java/com/github/shadowsocks/plugin/v2ray/ConfigFragment.kt @@ -72,9 +72,9 @@ class ConfigFragment : PreferenceFragmentCompat(), Preference.OnPreferenceChange fun onInitializePluginOptions(options: PluginOptions) { mode.value = when { options["mode"] ?: "websocket" == "quic" -> "quic-tls" - options["mode"] == "websocket-tls" -> "websocket-tls" - options["mode"] == "grpc" -> "grpc" - options["mode"] == "grpc-tls" -> "grpc-tls" + options["mode"] == null && "tls" in options -> "websocket-tls" + options["mode"] == "grpc" && "tls" !in options -> "grpc" + options["mode"] == "grpc" && "tls" in options -> "grpc-tls" else -> "websocket-http" }.also { onPreferenceChange(null, it) } host.text = options["host"] ?: "cloudfront.com"