From dc13f3bdf9f9ab72b3b7219d7c400c5911918c41 Mon Sep 17 00:00:00 2001 From: Max Lv Date: Thu, 16 Jul 2020 15:36:20 +0800 Subject: [PATCH] Remove the VPN plugin options --- src/plugin/ss_plugin.rs | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/src/plugin/ss_plugin.rs b/src/plugin/ss_plugin.rs index fca4a1a03096..a605a52bc448 100644 --- a/src/plugin/ss_plugin.rs +++ b/src/plugin/ss_plugin.rs @@ -21,14 +21,18 @@ pub fn plugin_cmd(plugin: &PluginConfig, remote: &ServerAddr, local: &SocketAddr .stdin(Stdio::null()); if let Some(ref opt) = plugin.plugin_opt { - cmd.env("SS_PLUGIN_OPTIONS", opt); - #[cfg(target_os = "android")] - { - // Add VPN flags to the commandline as well - if opt.contains(";V") { - cmd.arg("-V"); - } - } + if cfg!(target_os = "android") + { + let mut tmp = opt.clone(); + // Add VPN flags to the commandline as well + if tmp.contains(";V") { + cmd.arg("-V"); + tmp = tmp.replace(";V", "") + } + cmd.env("SS_PLUGIN_OPTIONS", tmp); + } else { + cmd.env("SS_PLUGIN_OPTIONS", opt); + } } cmd