Use Shell.Interactive interactively and removes iptables submodule

The following action will take only one SU request with this commit:

* Start service in NAT mode;
* Reset in NAT mode;
* Flush DNS.

And stopping service in NAT mode doesn't need SU request any more.
This commit is contained in:
Mygod
2016-07-13 09:42:18 +08:00
committed by Max Lv
parent 09220ee335
commit 76f7306a93
10 changed files with 64 additions and 205 deletions
@@ -82,7 +82,7 @@ class ShadowsocksVpnService extends VpnService with BaseService {
stopRunner(true)
}
override def stopRunner(stopService: Boolean) {
override def stopRunner(stopService: Boolean, msg: String = null) {
if (vpnThread != null) {
vpnThread.stopThread()
@@ -105,7 +105,7 @@ class ShadowsocksVpnService extends VpnService with BaseService {
conn = null
}
super.stopRunner(stopService)
super.stopRunner(stopService, msg)
}
def killProcesses() {
@@ -165,10 +165,7 @@ class ShadowsocksVpnService extends VpnService with BaseService {
resolved = true
}
if (!resolved) {
changeState(State.STOPPED, getString(R.string.invalid_server))
stopRunner(true)
} else if (handleConnection) {
if (!resolved) stopRunner(true, getString(R.string.invalid_server)) else if (handleConnection) {
changeState(State.CONNECTED)
notification = new ShadowsocksNotification(this, profile.name)
} else {