update travis
This commit is contained in:
+51
@@ -0,0 +1,51 @@
|
||||
/* Shadowsocks - A shadowsocks client for Android
|
||||
* Copyright (C) 2012 <max.c.lv@gmail.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*
|
||||
* ___====-_ _-====___
|
||||
* _--^^^#####// \\#####^^^--_
|
||||
* _-^##########// ( ) \\##########^-_
|
||||
* -############// |\^^/| \\############-
|
||||
* _/############// (@::@) \\############\_
|
||||
* /#############(( \\// ))#############\
|
||||
* -###############\\ (oo) //###############-
|
||||
* -#################\\ / VV \ //#################-
|
||||
* -###################\\/ \//###################-
|
||||
* _#/|##########/\######( /\ )######/\##########|\#_
|
||||
* |/ |#/\#/\#/\/ \#/\##\ | | /##/\#/ \/\#/\#/\#| \|
|
||||
* ` |/ V V ` V \#\| | | |/#/ V ' V V \| '
|
||||
* ` ` ` ` / | | | | \ ' ' ' '
|
||||
* ( | | | | )
|
||||
* __\ | | | | /__
|
||||
* (vvv(VVV)(VVV)vvv)
|
||||
*
|
||||
* HERE BE DRAGONS
|
||||
*
|
||||
*/
|
||||
|
||||
package com.github.shadowsocks;
|
||||
|
||||
public class Core {
|
||||
static {
|
||||
java.lang.System.loadLibrary("ss-local-jni");
|
||||
java.lang.System.loadLibrary("tun2socks-jni");
|
||||
java.lang.System.loadLibrary("pdnsd-jni");
|
||||
}
|
||||
|
||||
public static native void sslocal(String[] cmd);
|
||||
public static native void tun2socks(String[] cmd);
|
||||
public static native void pdnsd(String[] cmd);
|
||||
}
|
||||
@@ -119,12 +119,13 @@ class ShadowsocksNatService extends Service with BaseService {
|
||||
}
|
||||
|
||||
val args = (Path.BASE +
|
||||
"ss-local -b 127.0.0.1 -s '%s' -p '%d' -l '%d' -k ''%s' -m '%s' -f " +
|
||||
"ss-local -b 127.0.0.1 -s %s -p %d -l %d -k %s -m %s -f " +
|
||||
Path.BASE + "ss-local.pid")
|
||||
.format(config.proxy, config.remotePort, config.localPort, config.sitekey, config.encMethod)
|
||||
val cmd = if (config.isGFWList && isACLEnabled) args + " --acl " + Path.BASE + "chn.acl" else args
|
||||
if (BuildConfig.DEBUG) Log.d(TAG, cmd)
|
||||
Console.runCommand(cmd)
|
||||
|
||||
Core.sslocal(cmd.split(" "))
|
||||
}
|
||||
|
||||
def startDnsDaemon() {
|
||||
|
||||
@@ -82,11 +82,11 @@ class ShadowsocksVpnService extends VpnService with BaseService {
|
||||
|
||||
def startShadowsocksDaemon() {
|
||||
val cmd: String = (Path.BASE +
|
||||
"ss-local -b 127.0.0.1 -s '%s' -p '%d' -l '%d' -k '%s' -m '%s' -u -f " +
|
||||
"ss-local -b 127.0.0.1 -s %s -p %d -l %d -k %s -m %s -u -f " +
|
||||
Path.BASE + "ss-local.pid")
|
||||
.format(config.proxy, config.remotePort, config.localPort, config.sitekey, config.encMethod)
|
||||
if (BuildConfig.DEBUG) Log.d(TAG, cmd)
|
||||
System.exec(cmd)
|
||||
Core.sslocal(cmd.split(" "))
|
||||
}
|
||||
|
||||
def startDnsDaemon() {
|
||||
@@ -101,7 +101,7 @@ class ShadowsocksVpnService extends VpnService with BaseService {
|
||||
})
|
||||
val cmd = Path.BASE + "pdnsd -c " + Path.BASE + "pdnsd.conf"
|
||||
if (BuildConfig.DEBUG) Log.d(TAG, cmd)
|
||||
System.exec(cmd)
|
||||
Core.pdnsd(cmd.split(" "))
|
||||
}
|
||||
|
||||
def getVersionName: String = {
|
||||
@@ -202,10 +202,9 @@ class ShadowsocksVpnService extends VpnService with BaseService {
|
||||
else
|
||||
cmd += " --dnsgw %s:8153".format(PRIVATE_VLAN.format("1"))
|
||||
|
||||
if (BuildConfig.DEBUG)
|
||||
Log.d(TAG, cmd)
|
||||
if (BuildConfig.DEBUG) Log.d(TAG, cmd)
|
||||
|
||||
System.exec(cmd)
|
||||
Core.tun2socks(cmd.split(" "))
|
||||
}
|
||||
|
||||
/** Called when the activity is first created. */
|
||||
@@ -260,11 +259,8 @@ class ShadowsocksVpnService extends VpnService with BaseService {
|
||||
val ab = new ArrayBuffer[String]
|
||||
|
||||
ab.append("kill -9 `cat " + Path.BASE + "ss-local.pid`")
|
||||
ab.append("killall -9 ss-local")
|
||||
ab.append("kill -9 `cat " + Path.BASE + "tun2socks.pid`")
|
||||
ab.append("killall -9 tun2socks")
|
||||
ab.append("kill -15 `cat " + Path.BASE + "pdnsd.pid`")
|
||||
ab.append("killall -15 pdnsd")
|
||||
|
||||
Console.runCommand(ab.toArray)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user