Commit d0ca6667 authored by Max Lv's avatar Max Lv

update buildconfig

parent ba644cdf
...@@ -18,7 +18,7 @@ script: ...@@ -18,7 +18,7 @@ script:
- wget https://raw.github.com/paulp/sbt-extras/master/sbt - wget https://raw.github.com/paulp/sbt-extras/master/sbt
- chmod u+x ./sbt - chmod u+x ./sbt
- cp local.sbt.example local.sbt - cp local.sbt.example local.sbt
- ./sbt android:package-debug - ./sbt clean android:package-debug
after_success: after_success:
- ./sbt deploy - ./sbt deploy
env: env:
......
import org.scalasbt.androidplugin.AndroidKeys._ import org.scalasbt.androidplugin.AndroidKeys._
keyalias in Android := "travis" keyalias in Android := "travis"
buildConfigDebug in Android := true
...@@ -142,7 +142,7 @@ class ShadowVpnService extends VpnService { ...@@ -142,7 +142,7 @@ class ShadowVpnService extends VpnService {
BASE + BASE +
"shadowsocks.pid") "shadowsocks.pid")
.format(config.proxy, config.remotePort, config.localPort, config.sitekey, config.encMethod) .format(config.proxy, config.remotePort, config.localPort, config.sitekey, config.encMethod)
Log.d(TAG, cmd) if (BuildConfig.DEBUG) Log.d(TAG, cmd)
System.exec(cmd) System.exec(cmd)
} }
} }
...@@ -310,7 +310,7 @@ class ShadowVpnService extends VpnService { ...@@ -310,7 +310,7 @@ class ShadowVpnService extends VpnService {
+ "--loglevel 3 " + "--loglevel 3 "
+ "--pid %stun2socks.pid") + "--pid %stun2socks.pid")
.format(localAddress.format("2"), localAddress.format("1"), config.localPort, fd, VPN_MTU, BASE) .format(localAddress.format("2"), localAddress.format("1"), config.localPort, fd, VPN_MTU, BASE)
Log.d(TAG, cmd) if (BuildConfig.DEBUG) Log.d(TAG, cmd)
System.exec(cmd) System.exec(cmd)
} }
......
...@@ -177,7 +177,7 @@ class ShadowsocksService extends Service { ...@@ -177,7 +177,7 @@ class ShadowsocksService extends Service {
"shadowsocks.pid") "shadowsocks.pid")
.format(config.proxy, config.remotePort, config.localPort, config.sitekey, .format(config.proxy, config.remotePort, config.localPort, config.sitekey,
config.encMethod) config.encMethod)
Log.d(TAG, cmd) if (BuildConfig.DEBUG) Log.d(TAG, cmd)
System.exec(cmd) System.exec(cmd)
} }
}.start() }.start()
...@@ -314,7 +314,7 @@ class ShadowsocksService extends Service { ...@@ -314,7 +314,7 @@ class ShadowsocksService extends Service {
val bitmap = Bitmap.createBitmap(icon.getIntrinsicWidth * 4, val bitmap = Bitmap.createBitmap(icon.getIntrinsicWidth * 4,
icon.getIntrinsicHeight * 4, Bitmap.Config.ARGB_8888) icon.getIntrinsicHeight * 4, Bitmap.Config.ARGB_8888)
val r = rate.toString val r = rate.toString
val size = bitmap.getHeight / 3 val size = bitmap.getHeight / 4
val canvas = new Canvas(bitmap) val canvas = new Canvas(bitmap)
val paint = new Paint() val paint = new Paint()
paint.setColor(Color.WHITE) paint.setColor(Color.WHITE)
......
...@@ -130,7 +130,7 @@ object Extra { ...@@ -130,7 +130,7 @@ object Extra {
val isGFWList = settings.getBoolean(Key.isGFWList, false) val isGFWList = settings.getBoolean(Key.isGFWList, false)
val isBypassApps = settings.getBoolean(Key.isBypassApps, false) val isBypassApps = settings.getBoolean(Key.isBypassApps, false)
val proxy = settings.getString(Key.proxy, "127.0.0.1") match { val proxy = settings.getString(Key.proxy, "127.0.0.1") match {
case "198.199.101.152" => "ss.maxcdn.info" case "198.199.101.152" => if (!BuildConfig.DEBUG) "ss.maxcdn.info" else "198.199.101.152"
case s: String => s case s: String => s
case _ => "127.0.0.1" case _ => "127.0.0.1"
} }
...@@ -298,7 +298,7 @@ object Utils { ...@@ -298,7 +298,7 @@ object Utils {
if (!addr.isLoopbackAddress && !addr.isLinkLocalAddress) { if (!addr.isLoopbackAddress && !addr.isLinkLocalAddress) {
val sAddr = addr.getHostAddress.toUpperCase val sAddr = addr.getHostAddress.toUpperCase
if (InetAddressUtils.isIPv6Address(sAddr)) { if (InetAddressUtils.isIPv6Address(sAddr)) {
Log.d(TAG, "IPv6 address detected") if (BuildConfig.DEBUG) Log.d(TAG, "IPv6 address detected")
return true return true
} }
} }
...@@ -409,18 +409,6 @@ object Utils { ...@@ -409,18 +409,6 @@ object Utils {
icon icon
} }
def getDataPath(ctx: Context): String = {
if (data_path == null) {
if (Environment.MEDIA_MOUNTED == Environment.getExternalStorageState) {
data_path = Environment.getExternalStorageDirectory.getAbsolutePath
} else {
data_path = ctx.getFilesDir.getAbsolutePath
}
Log.d(TAG, "Python Data Path: " + data_path)
}
data_path
}
def getHasRedirectSupport: Boolean = { def getHasRedirectSupport: Boolean = {
if (hasRedirectSupport == -1) initHasRedirectSupported() if (hasRedirectSupport == -1) initHasRedirectSupported()
hasRedirectSupport == 1 hasRedirectSupport == 1
...@@ -495,7 +483,7 @@ object Utils { ...@@ -495,7 +483,7 @@ object Utils {
} }
def runCommand(command: String, timeout: Int): Boolean = { def runCommand(command: String, timeout: Int): Boolean = {
Log.d(TAG, command) if (BuildConfig.DEBUG) Log.d(TAG, command)
runScript(command, null, timeout, asroot = false) runScript(command, null, timeout, asroot = false)
true true
} }
...@@ -509,7 +497,7 @@ object Utils { ...@@ -509,7 +497,7 @@ object Utils {
Log.e(TAG, "Cannot get ROOT permission: " + root_shell) Log.e(TAG, "Cannot get ROOT permission: " + root_shell)
return false return false
} }
Log.d(TAG, command) if (BuildConfig.DEBUG) Log.d(TAG, command)
runScript(command, null, timeout, asroot = true) runScript(command, null, timeout, asroot = true)
true true
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment