Commit 5372cf89 authored by Mygod's avatar Mygod

Fix crash when plugin untrusted

parent a44e28a8
...@@ -47,6 +47,7 @@ import com.github.shadowsocks.preference.PluginConfigurationDialogFragment ...@@ -47,6 +47,7 @@ import com.github.shadowsocks.preference.PluginConfigurationDialogFragment
import com.github.shadowsocks.utils.Action import com.github.shadowsocks.utils.Action
import com.github.shadowsocks.utils.DirectBoot import com.github.shadowsocks.utils.DirectBoot
import com.github.shadowsocks.utils.Key import com.github.shadowsocks.utils.Key
import com.google.android.material.snackbar.Snackbar
import com.takisoft.preferencex.EditTextPreference import com.takisoft.preferencex.EditTextPreference
import com.takisoft.preferencex.PreferenceFragmentCompat import com.takisoft.preferencex.PreferenceFragmentCompat
...@@ -92,8 +93,9 @@ class ProfileConfigFragment : PreferenceFragmentCompat(), ...@@ -92,8 +93,9 @@ class ProfileConfigFragment : PreferenceFragmentCompat(),
DataStore.dirty = true DataStore.dirty = true
pluginConfigure.isEnabled = newValue.isNotEmpty() pluginConfigure.isEnabled = newValue.isNotEmpty()
pluginConfigure.text = pluginConfiguration.selectedOptions.toString() pluginConfigure.text = pluginConfiguration.selectedOptions.toString()
if (PluginManager.fetchPlugins()[newValue]?.trusted == false) if (PluginManager.fetchPlugins()[newValue]?.trusted == false) {
(activity as MainActivity).snackbar().setText(R.string.plugin_untrusted).show() Snackbar.make(view!!, R.string.plugin_untrusted, Snackbar.LENGTH_LONG).show()
}
true true
} }
pluginConfigure.onPreferenceChangeListener = this pluginConfigure.onPreferenceChangeListener = this
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment