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