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
import com.github.shadowsocks.utils.Action
import com.github.shadowsocks.utils.DirectBoot
import com.github.shadowsocks.utils.Key
import com.google.android.material.snackbar.Snackbar
import com.takisoft.preferencex.EditTextPreference
import com.takisoft.preferencex.PreferenceFragmentCompat
......@@ -92,8 +93,9 @@ class ProfileConfigFragment : PreferenceFragmentCompat(),
DataStore.dirty = true
pluginConfigure.isEnabled = newValue.isNotEmpty()
pluginConfigure.text = pluginConfiguration.selectedOptions.toString()
if (PluginManager.fetchPlugins()[newValue]?.trusted == false)
(activity as MainActivity).snackbar().setText(R.string.plugin_untrusted).show()
if (PluginManager.fetchPlugins()[newValue]?.trusted == false) {
Snackbar.make(view!!, R.string.plugin_untrusted, Snackbar.LENGTH_LONG).show()
}
true
}
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