Commit d0ca6667 authored by Max Lv's avatar Max Lv

update buildconfig

parent ba644cdf
......@@ -18,7 +18,7 @@ script:
- wget https://raw.github.com/paulp/sbt-extras/master/sbt
- chmod u+x ./sbt
- cp local.sbt.example local.sbt
- ./sbt android:package-debug
- ./sbt clean android:package-debug
after_success:
- ./sbt deploy
env:
......
import org.scalasbt.androidplugin.AndroidKeys._
keyalias in Android := "travis"
buildConfigDebug in Android := true
......@@ -142,7 +142,7 @@ class ShadowVpnService extends VpnService {
BASE +
"shadowsocks.pid")
.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)
}
}
......@@ -310,7 +310,7 @@ class ShadowVpnService extends VpnService {
+ "--loglevel 3 "
+ "--pid %stun2socks.pid")
.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)
}
......
......@@ -177,7 +177,7 @@ class ShadowsocksService extends Service {
"shadowsocks.pid")
.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)
}
}.start()
......@@ -314,7 +314,7 @@ class ShadowsocksService extends Service {
val bitmap = Bitmap.createBitmap(icon.getIntrinsicWidth * 4,
icon.getIntrinsicHeight * 4, Bitmap.Config.ARGB_8888)
val r = rate.toString
val size = bitmap.getHeight / 3
val size = bitmap.getHeight / 4
val canvas = new Canvas(bitmap)
val paint = new Paint()
paint.setColor(Color.WHITE)
......
......@@ -130,7 +130,7 @@ object Extra {
val isGFWList = settings.getBoolean(Key.isGFWList, false)
val isBypassApps = settings.getBoolean(Key.isBypassApps, false)
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 _ => "127.0.0.1"
}
......@@ -298,7 +298,7 @@ object Utils {
if (!addr.isLoopbackAddress && !addr.isLinkLocalAddress) {
val sAddr = addr.getHostAddress.toUpperCase
if (InetAddressUtils.isIPv6Address(sAddr)) {
Log.d(TAG, "IPv6 address detected")
if (BuildConfig.DEBUG) Log.d(TAG, "IPv6 address detected")
return true
}
}
......@@ -409,18 +409,6 @@ object Utils {
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 = {
if (hasRedirectSupport == -1) initHasRedirectSupported()
hasRedirectSupport == 1
......@@ -495,7 +483,7 @@ object Utils {
}
def runCommand(command: String, timeout: Int): Boolean = {
Log.d(TAG, command)
if (BuildConfig.DEBUG) Log.d(TAG, command)
runScript(command, null, timeout, asroot = false)
true
}
......@@ -509,7 +497,7 @@ object Utils {
Log.e(TAG, "Cannot get ROOT permission: " + root_shell)
return false
}
Log.d(TAG, command)
if (BuildConfig.DEBUG) Log.d(TAG, command)
runScript(command, null, timeout, asroot = 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