This commit is contained in:
Max Lv
2014-07-25 18:13:51 +08:00
parent 028c5a6463
commit 4e22d26e84
4 changed files with 22 additions and 21 deletions
@@ -309,6 +309,11 @@ class ShadowsocksNatService extends Service with BaseService {
}
}
override def onStartCommand(intent: Intent, flags: Int, startId: Int): Int = {
Service.START_NOT_STICKY
}
def killProcesses() {
Console.runRootCommand(Utils.getIptables + " -t nat -F OUTPUT")
@@ -328,10 +333,6 @@ class ShadowsocksNatService extends Service with BaseService {
Console.runCommand(ab.toArray)
}
override def onStartCommand(intent: Intent, flags: Int, startId: Int): Int = {
Service.START_STICKY
}
def flushDNS() {
Console.runRootCommand(Array("ndc resolver flushdefaultif", "ndc resolver flushif wlan0"))
}
@@ -453,9 +454,7 @@ class ShadowsocksNatService extends Service with BaseService {
filter.addAction(Action.CLOSE)
receiver = new BroadcastReceiver() {
def onReceive(p1: Context, p2: Intent) {
spawn {
stopRunner()
}
stopRunner()
}
}
registerReceiver(receiver, filter)
@@ -580,7 +579,6 @@ class ShadowsocksNatService extends Service with BaseService {
override def stopBackgroundService() {
stopRunner()
stopSelf()
}
override def getTag = TAG