Commit c96dde86 authored by Max Lv's avatar Max Lv

use runCommand instead

parent 78108e12
...@@ -140,8 +140,7 @@ class ShadowVpnService extends VpnService { ...@@ -140,8 +140,7 @@ class ShadowVpnService extends VpnService {
def startShadowsocksDaemon() { def startShadowsocksDaemon() {
val cmd: String = (BASE + val cmd: String = (BASE +
"shadowsocks -b 127.0.0.1 -s \"%s\" -p \"%d\" -l \"%d\" -k \"%s\" -m \"%s\" -f " + "shadowsocks -b 127.0.0.1 -s \"%s\" -p \"%d\" -l \"%d\" -k \"%s\" -m \"%s\" -f " +
BASE + BASE + "shadowsocks.pid")
"shadowsocks.pid")
.format(config.proxy, config.remotePort, config.localPort, config.sitekey, config.encMethod) .format(config.proxy, config.remotePort, config.localPort, config.sitekey, config.encMethod)
if (BuildConfig.DEBUG) Log.d(TAG, cmd) if (BuildConfig.DEBUG) Log.d(TAG, cmd)
System.exec(cmd) System.exec(cmd)
......
...@@ -158,10 +158,9 @@ class ShadowsocksService extends Service { ...@@ -158,10 +158,9 @@ class ShadowsocksService extends Service {
val cmd: String = (BASE + val cmd: String = (BASE +
"shadowsocks -b 127.0.0.1 -s \"%s\" -p \"%d\" -l \"%d\" -k \"%s\" -m \"%s\" -f " + "shadowsocks -b 127.0.0.1 -s \"%s\" -p \"%d\" -l \"%d\" -k \"%s\" -m \"%s\" -f " +
BASE + "shadowsocks.pid") BASE + "shadowsocks.pid")
.format(config.proxy, config.remotePort, config.localPort, config.sitekey, .format(config.proxy, config.remotePort, config.localPort, config.sitekey, config.encMethod)
config.encMethod)
if (BuildConfig.DEBUG) Log.d(TAG, cmd) if (BuildConfig.DEBUG) Log.d(TAG, cmd)
System.exec(cmd) Utils.runCommand(cmd)
} }
def startDnsDaemon() { def startDnsDaemon() {
......
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