From 9605f980e0ef06c78c14f14f05b8aec55c0db93e Mon Sep 17 00:00:00 2001 From: Teddysun Date: Thu, 27 May 2021 12:59:26 +0900 Subject: [PATCH] Add support for gRPC protocol Signed-off-by: Teddysun --- .../com/github/shadowsocks/plugin/v2ray/ConfigFragment.kt | 6 +++++- app/src/main/res/values/arrays.xml | 2 ++ 2 files changed, 7 insertions(+), 1 deletion(-) 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 57afe9c..8e77657 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 @@ -50,6 +50,8 @@ class ConfigFragment : PreferenceFragmentCompat(), Preference.OnPreferenceChange "websocket-http" -> Pair(null, false) "websocket-tls" -> Pair(null, true) "quic-tls" -> Pair("quic", false) + "grpc" -> Pair("grpc", false) + "grpc-tls" -> Pair("grpc", true) else -> { check(false) Pair(null, false) @@ -70,7 +72,9 @@ class ConfigFragment : PreferenceFragmentCompat(), Preference.OnPreferenceChange fun onInitializePluginOptions(options: PluginOptions) { mode.value = when { options["mode"] ?: "websocket" == "quic" -> "quic-tls" - "tls" in options -> "websocket-tls" + options["mode"] == "websocket-tls" -> "websocket-tls" + options["mode"] == "grpc" -> "grpc" + options["mode"] == "grpc-tls" -> "grpc-tls" else -> "websocket-http" }.also { onPreferenceChange(null, it) } host.text = options["host"] ?: "cloudfront.com" diff --git a/app/src/main/res/values/arrays.xml b/app/src/main/res/values/arrays.xml index 1c20449..1a9b60f 100644 --- a/app/src/main/res/values/arrays.xml +++ b/app/src/main/res/values/arrays.xml @@ -4,6 +4,8 @@ websocket-http websocket-tls quic-tls + grpc + grpc-tls debug