Fix an issue that stat_path is null

This commit is contained in:
Max Lv
2016-01-30 11:00:25 +08:00
parent 95e214ef11
commit 2840a75c92
7 changed files with 49 additions and 46 deletions
@@ -66,7 +66,7 @@ object ConfigUtils {
"""
|global {
| perm_cache = 2048;
| cache_dir = "/data/data/com.github.shadowsocks";
| cache_dir = "%s";
| server_ip = %s;
| server_port = %d;
| query_method = tcp_only;
@@ -100,7 +100,7 @@ object ConfigUtils {
"""
|global {
| perm_cache = 2048;
| cache_dir = "/data/data/com.github.shadowsocks";
| cache_dir = "%s";
| server_ip = %s;
| server_port = %d;
| query_method = tcp_only;
@@ -143,7 +143,7 @@ object ConfigUtils {
"""
|global {
| perm_cache = 2048;
| cache_dir = "/data/data/com.github.shadowsocks";
| cache_dir = "%s";
| server_ip = %s;
| server_port = %d;
| query_method = tcp_only;
@@ -43,13 +43,14 @@ import java.io.{File, IOException}
import java.nio.{ByteBuffer, ByteOrder}
import java.util.concurrent.Executors
import android.content.Context
import android.net.{LocalServerSocket, LocalSocket, LocalSocketAddress}
import android.util.Log
class TrafficMonitorThread() extends Thread {
class TrafficMonitorThread(context: Context) extends Thread {
val TAG = "TrafficMonitorThread"
val PATH = "/data/data/com.github.shadowsocks/stat_path"
lazy val PATH = context.getApplicationInfo.dataDir + "/stat_path"
@volatile var serverSocket: LocalServerSocket = null
@volatile var isRunning: Boolean = true