Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0a400ef5f9 | ||
|
|
cda3650c43 | ||
|
|
b1c19f8f03 | ||
|
|
f7d422da2b | ||
|
|
10725c39cb | ||
|
|
4b5c94022b | ||
|
|
6afc3f80be | ||
|
|
a02d19bba0 | ||
|
|
984e75ae99 | ||
|
|
3cc1a1602e | ||
|
|
72305c5f60 | ||
|
|
4303c1cd0c | ||
|
|
5dad89b71e | ||
|
|
109d4728f4 | ||
|
|
53b9c1f4af | ||
|
|
23fc7e9134 | ||
|
|
e73fc9f881 | ||
|
|
941393cab4 | ||
|
|
a6e87cf666 | ||
|
|
81295e4a51 |
+34
-23
@@ -1,19 +1,16 @@
|
||||
language: scala
|
||||
language: android
|
||||
|
||||
jdk:
|
||||
- oraclejdk8
|
||||
|
||||
sudo: false
|
||||
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- gcc-multilib
|
||||
- g++-multilib
|
||||
- libstdc++6:i386
|
||||
- libgcc1:i386
|
||||
- zlib1g:i386
|
||||
- libncurses5:i386
|
||||
env:
|
||||
global:
|
||||
- NDK_VERSION=r12b
|
||||
- NDK_CCACHE=ccache
|
||||
- GOROOT_BOOTSTRAP=$GOROOT
|
||||
- ANDROID_NDK_HOME=$HOME/.android/android-ndk-${NDK_VERSION}
|
||||
- SBTPATH=$HOME/.sbt
|
||||
- PATH=${ANDROID_NDK_HOME}:${ANDROID_HOME}/tools:${ANDROID_HOME}/platform-tools:${PATH}
|
||||
|
||||
scala:
|
||||
- 2.11.8
|
||||
@@ -24,18 +21,32 @@ before_cache:
|
||||
|
||||
cache:
|
||||
directories:
|
||||
- $HOME/.ivy2/cache
|
||||
- $HOME/.sbt/boot
|
||||
- $HOME/.ivy2
|
||||
- $HOME/.sbt
|
||||
|
||||
android:
|
||||
components:
|
||||
- tools
|
||||
- build-tools-24.0.1
|
||||
- extra-google-m2repository
|
||||
|
||||
install:
|
||||
- ./travis-ci/setup.sh
|
||||
- export NDK_CCACHE=ccache
|
||||
- export ARCH=`uname -m`
|
||||
- export GOROOT_BOOTSTRAP=$HOME/.android/go
|
||||
- export ANDROID_NDK_HOME=$HOME/.android/android-ndk-r12b
|
||||
- export ANDROID_HOME=$HOME/.android/android-sdk-linux
|
||||
- export PATH=${ANDROID_NDK_HOME}:${ANDROID_HOME}/tools:${ANDROID_HOME}/platform-tools:${PATH}
|
||||
- cp local.properties.travis local.properties
|
||||
- >
|
||||
if [ ! -d "$ANDROID_NDK_HOME" ]; then
|
||||
mkdir -p $ANDROID_NDK_HOME;
|
||||
pushd $HOME/.android;
|
||||
export ARCH=`uname -m`;
|
||||
wget -q http://dl.google.com/android/repository/android-ndk-${NDK_VERSION}-linux-${ARCH}.zip;
|
||||
unzip -q android-ndk-${NDK_VERSION}-linux-${ARCH}.zip;
|
||||
popd;
|
||||
fi
|
||||
- >
|
||||
if [ ! -f "$SBTPATH/sbt" ]; then
|
||||
pushd $SBTPATH;
|
||||
wget -q https://raw.githubusercontent.com/paulp/sbt-extras/master/sbt;
|
||||
chmod a+x sbt;
|
||||
popd;
|
||||
fi
|
||||
|
||||
script:
|
||||
- sbt native-build android:package-release
|
||||
- $SBTPATH/sbt native-build android:package-debug
|
||||
|
||||
@@ -12,8 +12,10 @@ A [shadowsocks](http://shadowsocks.org) client for Android, written in Scala.
|
||||
|
||||
* JDK 1.8
|
||||
* SBT 0.13.0+
|
||||
* GO 1.4+
|
||||
* Android SDK r25+
|
||||
* Go 1.4+
|
||||
* Android SDK
|
||||
- Build Tools 24+ (as required by [`sbt-android`](https://github.com/scala-android/sbt-android))
|
||||
- Google Repository (see `build.sbt` for version)
|
||||
* Android NDK r12b+
|
||||
|
||||
### BUILD
|
||||
@@ -46,7 +48,7 @@ A [shadowsocks](http://shadowsocks.org) client for Android, written in Scala.
|
||||
|
||||
### LICENSE
|
||||
|
||||
Copyright (C) 2016 by Max Lv <<max.c.lv@gmail.com>> <br/>
|
||||
Copyright (C) 2016 by Max Lv <<max.c.lv@gmail.com>>
|
||||
Copyright (C) 2016 by Mygod Studio <<mygodstudio@gmail.com>>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
|
||||
@@ -37,16 +37,16 @@ libraryDependencies ++= Seq(
|
||||
"com.github.kevinsawicki" % "http-request" % "6.0",
|
||||
"eu.chainfire" % "libsuperuser" % "1.0.0.201607041850",
|
||||
"net.glxn.qrgen" % "android" % "2.0",
|
||||
"com.google.android.gms" % "play-services-ads" % "9.2.1",
|
||||
"com.google.android.gms" % "play-services-analytics" % "9.2.1",
|
||||
"com.android.support" % "design" % "24.1.0",
|
||||
"com.android.support" % "gridlayout-v7" % "24.1.0",
|
||||
"com.android.support" % "cardview-v7" % "24.1.0",
|
||||
"com.google.android.gms" % "play-services-ads" % "9.4.0",
|
||||
"com.google.android.gms" % "play-services-analytics" % "9.4.0",
|
||||
"com.android.support" % "design" % "24.1.1",
|
||||
"com.android.support" % "gridlayout-v7" % "24.1.1",
|
||||
"com.android.support" % "cardview-v7" % "24.1.1",
|
||||
"com.github.jorgecastilloprz" % "fabprogresscircle" % "1.01",
|
||||
"com.j256.ormlite" % "ormlite-android" % "4.48",
|
||||
"com.j256.ormlite" % "ormlite-android" % "5.0",
|
||||
"com.twofortyfouram" % "android-plugin-api-for-locale" % "1.0.2",
|
||||
"com.github.clans" % "fab" % "1.6.4",
|
||||
"me.dm7.barcodescanner" % "zxing" % "1.8.4"
|
||||
"me.dm7.barcodescanner" % "zxing" % "1.9"
|
||||
)
|
||||
|
||||
proguardVersion in Android := "5.2.1"
|
||||
@@ -55,12 +55,8 @@ proguardCache in Android := Seq()
|
||||
|
||||
proguardOptions in Android ++= Seq(
|
||||
"-keep class com.github.shadowsocks.System { *; }",
|
||||
"-dontwarn com.google.android.gms.**",
|
||||
"-keep class com.google.android.gms.**",
|
||||
"-dontnote com.google.android.gms.internal.**",
|
||||
"-dontnote com.j256.ormlite.**",
|
||||
"-dontnote me.dm7.barcodescannerview.**",
|
||||
"-dontnote org.xbill.**",
|
||||
"-dontwarn com.google.android.gms.internal.**",
|
||||
"-dontwarn com.j256.ormlite.**",
|
||||
"-dontwarn org.xbill.**")
|
||||
|
||||
lazy val nativeBuild = TaskKey[Unit]("native-build", "Build native executables")
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
#!/bin/bash
|
||||
cd ${1}
|
||||
travis-artifacts upload --path ${2} --target-path nightly
|
||||
+3
-1
@@ -43,7 +43,9 @@ if [ ! -d "$DIR/go/bin" ]; then
|
||||
fi
|
||||
|
||||
export GOROOT=$DIR/go
|
||||
export GOPATH=$DEPS
|
||||
export GOPATH=$HOME
|
||||
export GOBIN=$GOPATH/bin
|
||||
mkdir $GOBIN
|
||||
export PATH=$GOROOT/bin:$PATH
|
||||
|
||||
pushd kcptun/client
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
key.alias: travis
|
||||
key.store: travis.keystore
|
||||
key.store.password: travis
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
addSbtPlugin("org.scala-android" % "sbt-android" % "1.6.10")
|
||||
addSbtPlugin("org.scala-android" % "sbt-android" % "1.6.12")
|
||||
|
||||
addSbtPlugin("com.timushev.sbt" % "sbt-updates" % "0.1.10")
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools" package="com.github.shadowsocks"
|
||||
android:versionCode="144"
|
||||
android:versionName="3.0.2">
|
||||
android:versionCode="145"
|
||||
android:versionName="3.0.3">
|
||||
|
||||
<uses-permission android:name="android.permission.INTERNET"/>
|
||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
|
||||
|
||||
Submodule src/main/jni/shadowsocks-libev updated: 915047e957...6f65fedbbd
@@ -1,10 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent" android:layout_height="wrap_content">
|
||||
<TextView android:text="@string/stat" android:textSize="16sp"
|
||||
android:textColor="?android:attr/textColorPrimary" android:ellipsize="marquee"
|
||||
android:layout_width="wrap_content" android:layout_height="wrap_content"/>
|
||||
<TextView android:id="@+id/connection_test" android:gravity="end"
|
||||
android:textSize="14sp" android:textColor="?android:attr/textColorSecondary"
|
||||
android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="1"/>
|
||||
</LinearLayout>
|
||||
@@ -10,13 +10,31 @@
|
||||
<LinearLayout android:id="@+id/stat" android:elevation="4dp" android:visibility="gone"
|
||||
android:layout_width="match_parent" android:layout_height="wrap_content"
|
||||
android:minHeight="?android:attr/listPreferredItemHeight" android:gravity="center_vertical"
|
||||
android:paddingStart="16dip" android:paddingEnd="88dip" android:focusable="true"
|
||||
android:paddingLeft="16dip" android:paddingRight="88dip"
|
||||
android:paddingStart="16dip" android:paddingEnd="16dip" android:focusable="true"
|
||||
android:paddingLeft="16dip" android:paddingRight="16dip"
|
||||
android:paddingTop="16dip" android:paddingBottom="16dip"
|
||||
android:background="@drawable/background_stat" android:orientation="vertical">
|
||||
<include layout="@layout/layout_main_stat_title"/>
|
||||
<LinearLayout android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
<TextView android:text="@string/stat"
|
||||
android:textSize="16sp"
|
||||
android:textColor="?android:attr/textColorPrimary"
|
||||
android:ellipsize="marquee"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"/>
|
||||
<TextView android:id="@+id/connection_test"
|
||||
android:gravity="end"
|
||||
android:textSize="14sp"
|
||||
android:textColor="?android:attr/textColorSecondary"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"/>
|
||||
</LinearLayout>
|
||||
<android.support.v7.widget.GridLayout android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" app:columnCount="4">
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingEnd="72dip"
|
||||
android:paddingRight="72dip"
|
||||
app:columnCount="4">
|
||||
<TextView app:layout_column="0" style="@style/TextAppearance.AppCompat.Body2"
|
||||
android:ellipsize="marquee" android:text="@string/sent"
|
||||
android:layout_width="wrap_content" android:layout_height="wrap_content"
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical"
|
||||
android:layout_width="match_parent" android:layout_height="wrap_content">
|
||||
<TextView android:text="@string/stat" android:textSize="16sp"
|
||||
android:textColor="?android:attr/textColorPrimary" android:ellipsize="marquee"
|
||||
android:layout_width="match_parent" android:layout_height="wrap_content"/>
|
||||
<TextView android:id="@+id/connection_test"
|
||||
android:textSize="14sp" android:textColor="?android:attr/textColorSecondary"
|
||||
android:layout_width="match_parent" android:layout_height="wrap_content"/>
|
||||
</LinearLayout>
|
||||
@@ -116,12 +116,13 @@ class ShadowsocksNatService extends BaseService {
|
||||
}
|
||||
|
||||
def startKcptunDaemon() {
|
||||
if (profile.kcpcli == null) profile.kcpcli = ""
|
||||
|
||||
val cmd = new ArrayBuffer[String]
|
||||
cmd += (getApplicationInfo.dataDir + "/kcptun"
|
||||
, "-r", profile.host + ":" + profile.kcpPort
|
||||
, "-l", "127.0.0.1:" + (profile.localPort + 90)
|
||||
, profile.kcpcli)
|
||||
, profile.kcpcli.trim)
|
||||
|
||||
if (BuildConfig.DEBUG) Log.d(TAG, cmd.mkString(" "))
|
||||
|
||||
|
||||
@@ -36,10 +36,8 @@ object ShadowsocksSettings {
|
||||
}
|
||||
|
||||
def updateSummaryEditTextPreference(pref: Preference, value: String) {
|
||||
if (value != null) {
|
||||
pref.setSummary(value)
|
||||
pref.asInstanceOf[SummaryEditTextPreference].setText(value)
|
||||
}
|
||||
pref.setSummary(value)
|
||||
pref.asInstanceOf[SummaryEditTextPreference].setText(value)
|
||||
}
|
||||
|
||||
def updateSwitchPreference(pref: Preference, value: Boolean) {
|
||||
|
||||
@@ -25,24 +25,26 @@ final class ShadowsocksTileService extends TileService with ServiceBoundContext
|
||||
def trafficUpdated(txRate: Long, rxRate: Long, txTotal: Long, rxTotal: Long) = ()
|
||||
def stateChanged(state: Int, msg: String) {
|
||||
val tile = getQsTile
|
||||
state match {
|
||||
case State.STOPPED =>
|
||||
tile.setIcon(iconIdle)
|
||||
tile.setLabel(getString(R.string.app_name))
|
||||
tile.setState(Tile.STATE_INACTIVE)
|
||||
case State.CONNECTED =>
|
||||
tile.setIcon(iconConnected)
|
||||
tile.setLabel(app.currentProfile match {
|
||||
case Some(profile) => profile.name
|
||||
case None => getString(R.string.app_name)
|
||||
})
|
||||
tile.setState(Tile.STATE_ACTIVE)
|
||||
case _ =>
|
||||
tile.setIcon(iconBusy)
|
||||
tile.setLabel(getString(R.string.app_name))
|
||||
tile.setState(Tile.STATE_UNAVAILABLE)
|
||||
if (tile != null) {
|
||||
state match {
|
||||
case State.STOPPED =>
|
||||
tile.setIcon(iconIdle)
|
||||
tile.setLabel(getString(R.string.app_name))
|
||||
tile.setState(Tile.STATE_INACTIVE)
|
||||
case State.CONNECTED =>
|
||||
tile.setIcon(iconConnected)
|
||||
tile.setLabel(app.currentProfile match {
|
||||
case Some(profile) => profile.name
|
||||
case None => getString(R.string.app_name)
|
||||
})
|
||||
tile.setState(Tile.STATE_ACTIVE)
|
||||
case _ =>
|
||||
tile.setIcon(iconBusy)
|
||||
tile.setLabel(getString(R.string.app_name))
|
||||
tile.setState(Tile.STATE_UNAVAILABLE)
|
||||
}
|
||||
tile.updateTile
|
||||
}
|
||||
tile.updateTile
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -204,12 +204,14 @@ class ShadowsocksVpnService extends VpnService with BaseService {
|
||||
}
|
||||
|
||||
def startKcptunDaemon() {
|
||||
if (profile.kcpcli == null) profile.kcpcli = ""
|
||||
|
||||
val cmd = new ArrayBuffer[String]
|
||||
cmd += (getApplicationInfo.dataDir + "/kcptun"
|
||||
, "-r", profile.host + ":" + profile.kcpPort
|
||||
, "-l", "127.0.0.1:" + (profile.localPort + 90)
|
||||
, "--path", getApplicationInfo.dataDir + "/protect_path"
|
||||
, profile.kcpcli)
|
||||
, profile.kcpcli.trim)
|
||||
|
||||
if (BuildConfig.DEBUG)
|
||||
Log.d(TAG, cmd.mkString(" "))
|
||||
|
||||
@@ -64,7 +64,7 @@ object DBHelper {
|
||||
}
|
||||
|
||||
class DBHelper(val context: Context)
|
||||
extends OrmLiteSqliteOpenHelper(context, DBHelper.PROFILE, null, 18) {
|
||||
extends OrmLiteSqliteOpenHelper(context, DBHelper.PROFILE, null, 19) {
|
||||
import DBHelper._
|
||||
|
||||
lazy val profileDao: Dao[Profile, Int] = getDao(classOf[Profile])
|
||||
@@ -83,10 +83,11 @@ class DBHelper(val context: Context)
|
||||
}
|
||||
if (oldVersion < 8) {
|
||||
profileDao.executeRawNoArgs("ALTER TABLE `profile` ADD COLUMN udpdns SMALLINT;")
|
||||
profileDao.executeRawNoArgs("ALTER TABLE `profile` ADD COLUMN route VARCHAR;")
|
||||
}
|
||||
if (oldVersion < 9) {
|
||||
profileDao.executeRawNoArgs("ALTER TABLE `profile` ADD COLUMN route VARCHAR;")
|
||||
profileDao.executeRawNoArgs("ALTER TABLE `profile` ADD COLUMN route VARCHAR DEFAULT 'all';")
|
||||
} else if (oldVersion < 19) {
|
||||
profileDao.executeRawNoArgs("UPDATE `profile` SET route = 'all' WHERE route IS NULL;")
|
||||
}
|
||||
if (oldVersion < 10) {
|
||||
profileDao.executeRawNoArgs("ALTER TABLE `profile` ADD COLUMN auth SMALLINT;")
|
||||
@@ -128,11 +129,13 @@ class DBHelper(val context: Context)
|
||||
|
||||
if (oldVersion < 17) {
|
||||
profileDao.executeRawNoArgs("ALTER TABLE `profile` ADD COLUMN kcp SMALLINT;")
|
||||
profileDao.executeRawNoArgs("ALTER TABLE `profile` ADD COLUMN kcpcli VARCHAR;")
|
||||
profileDao.executeRawNoArgs("ALTER TABLE `profile` ADD COLUMN kcpcli VARCHAR DEFAULT '';")
|
||||
}
|
||||
|
||||
if (oldVersion < 18) {
|
||||
profileDao.executeRawNoArgs("ALTER TABLE `profile` ADD COLUMN kcpPort INTEGER;")
|
||||
profileDao.executeRawNoArgs("ALTER TABLE `profile` ADD COLUMN kcpPort INTEGER DEFAULT 8399;")
|
||||
} else if (oldVersion < 19) {
|
||||
profileDao.executeRawNoArgs("UPDATE `profile` SET kcpPort = 8399 WHERE kcpPort = 0;")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,6 +41,7 @@ package com.github.shadowsocks.preferences
|
||||
|
||||
import android.content.Context
|
||||
import android.preference.EditTextPreference
|
||||
import android.text.TextUtils
|
||||
import android.util.AttributeSet
|
||||
|
||||
class SummaryEditTextPreference(context: Context, attrs: AttributeSet, defStyle: Int)
|
||||
@@ -57,7 +58,7 @@ class SummaryEditTextPreference(context: Context, attrs: AttributeSet, defStyle:
|
||||
}
|
||||
|
||||
override def setSummary(summary: CharSequence) {
|
||||
if (summary.toString.isEmpty) {
|
||||
if (TextUtils.isEmpty(summary)) {
|
||||
super.setSummary(mDefaultSummary)
|
||||
} else {
|
||||
super.setSummary(summary)
|
||||
|
||||
@@ -1,34 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
export ARCH=`uname -m`
|
||||
export GOROOT_BOOTSTRAP=$HOME/.android/go
|
||||
export ANDROID_NDK_HOME=$HOME/.android/android-ndk-r12b
|
||||
export ANDROID_HOME=$HOME/.android/android-sdk-linux
|
||||
export PATH=${ANDROID_NDK_HOME}:${ANDROID_HOME}/tools:${ANDROID_HOME}/platform-tools:${PATH}
|
||||
|
||||
if [ ! -d "$ANDROID_HOME" ]; then
|
||||
mkdir -p $ANDROID_HOME
|
||||
pushd $HOME/.android
|
||||
wget -q http://dl.google.com/android/android-sdk_r24.4.1-linux.tgz
|
||||
tar xf android-sdk_r24.4.1-linux.tgz
|
||||
popd
|
||||
fi
|
||||
|
||||
if [ ! -d "$ANDROID_NDK_HOME" ]; then
|
||||
mkdir -p $ANDROID_NDK_HOME
|
||||
pushd $HOME/.android
|
||||
wget -q http://dl.google.com/android/repository/android-ndk-r12b-linux-${ARCH}.zip
|
||||
unzip -q android-ndk-r12b-linux-${ARCH}.zip
|
||||
popd
|
||||
fi
|
||||
|
||||
if [ ! -d "$GOROOT_BOOTSTRAP" ]; then
|
||||
mkdir -p $GOROOT_BOOTSTRAP
|
||||
pushd $HOME/.android
|
||||
wget https://storage.googleapis.com/golang/go1.6.3.linux-amd64.tar.gz
|
||||
tar xf go1.6.3.linux-amd64.tar.gz
|
||||
popd
|
||||
fi
|
||||
|
||||
( sleep 5 && while [ 1 ]; do sleep 1; echo y; done ) | android update sdk --filter tools,platform-tools,build-tools-24.0.0,android-23,android-24,extra-google-m2repository --no-ui -a
|
||||
( sleep 5 && while [ 1 ]; do sleep 1; echo y; done ) | android update sdk --filter extra-android-m2repository --no-ui -a
|
||||
Binary file not shown.
Reference in New Issue
Block a user