Use app.* instead of ShadowsocksApplication.*

Because typing ShadowsocksApplication is quite troublesome.
This commit is contained in:
Mygod
2016-05-24 11:37:33 +08:00
parent c695847403
commit 28ea9dd807
20 changed files with 132 additions and 113 deletions
@@ -50,6 +50,7 @@ import android.os._
import android.util.{Log, SparseArray}
import com.github.shadowsocks.aidl.Config
import com.github.shadowsocks.utils._
import com.github.shadowsocks.ShadowsocksApplication.app
import scala.collection.JavaConversions._
import scala.collection.mutable.ArrayBuffer
@@ -355,13 +356,13 @@ class ShadowsocksNatService extends BaseService {
}
super.startRunner(config)
ShadowsocksApplication.track(TAG, "start")
app.track(TAG, "start")
changeState(State.CONNECTING)
Utils.ThrowableFuture {
if (config.proxy == "198.199.101.152") {
val holder = ShadowsocksApplication.containerHolder
val holder = app.containerHolder
try {
this.config = ConfigUtils.getPublicConfig(getBaseContext, holder.getContainer, config)
} catch {
@@ -412,7 +413,7 @@ class ShadowsocksNatService extends BaseService {
if (notification != null) notification.destroy()
ShadowsocksApplication.track(TAG, "stop")
app.track(TAG, "stop")
// reset NAT
killProcesses()