Ask for ROOT only when it's needed

This commit is contained in:
Mygod
2015-12-06 20:04:41 +08:00
parent ac98caa4b4
commit 93084f0ed0
13 changed files with 82 additions and 112 deletions
@@ -55,8 +55,6 @@ import org.apache.commons.net.util.SubnetUtils
import scala.collection.JavaConversions._
import scala.collection.mutable.ArrayBuffer
import scala.concurrent.ExecutionContext.Implicits.global
import scala.concurrent.Future
class ShadowsocksVpnService extends VpnService with BaseService {
val TAG = "ShadowsocksVpnService"
@@ -122,7 +120,7 @@ class ShadowsocksVpnService extends VpnService with BaseService {
vpnThread = null
}
notification.destroy()
if (notification != null) notification.destroy()
// channge the state
changeState(State.STOPPING)
@@ -213,7 +211,7 @@ class ShadowsocksVpnService extends VpnService with BaseService {
changeState(State.CONNECTING)
Future {
ThrowableFuture {
if (config.proxy == "198.199.101.152") {
val holder = ShadowsocksApplication.containerHolder
try {