Move app to mobile subproject
@@ -28,6 +28,4 @@ out/
|
||||
#NDK
|
||||
src/main/obj
|
||||
src/main/libs
|
||||
src/main/assets/armeabi-v7a/*
|
||||
src/main/assets/x86/*
|
||||
jni/Application.mk
|
||||
|
||||
@@ -1,35 +1,29 @@
|
||||
[submodule "src/main/jni/shadowsocks-libev"]
|
||||
path = src/main/jni/shadowsocks-libev
|
||||
[submodule "mobile/src/main/jni/shadowsocks-libev"]
|
||||
path = mobile/src/main/jni/shadowsocks-libev
|
||||
url = https://github.com/shadowsocks/shadowsocks-libev
|
||||
[submodule "src/main/jni/badvpn"]
|
||||
path = src/main/jni/badvpn
|
||||
[submodule "mobile/src/main/jni/badvpn"]
|
||||
path = mobile/src/main/jni/badvpn
|
||||
url = https://github.com/shadowsocks/badvpn.git
|
||||
branch = shadowsocks-android
|
||||
[submodule "src/main/jni/libancillary"]
|
||||
path = src/main/jni/libancillary
|
||||
[submodule "mobile/src/main/jni/libancillary"]
|
||||
path = mobile/src/main/jni/libancillary
|
||||
url = https://github.com/shadowsocks/libancillary.git
|
||||
branch = shadowsocks-android
|
||||
[submodule "src/main/jni/libevent"]
|
||||
path = src/main/jni/libevent
|
||||
[submodule "mobile/src/main/jni/libevent"]
|
||||
path = mobile/src/main/jni/libevent
|
||||
url = https://github.com/shadowsocks/libevent.git
|
||||
branch = shadowsocks-android
|
||||
[submodule "src/main/jni/redsocks"]
|
||||
path = src/main/jni/redsocks
|
||||
[submodule "mobile/src/main/jni/redsocks"]
|
||||
path = mobile/src/main/jni/redsocks
|
||||
url = https://github.com/shadowsocks/redsocks.git
|
||||
branch = shadowsocks-android
|
||||
[submodule "src/main/jni/pdnsd"]
|
||||
path = src/main/jni/pdnsd
|
||||
[submodule "mobile/src/main/jni/pdnsd"]
|
||||
path = mobile/src/main/jni/pdnsd
|
||||
url = https://github.com/shadowsocks/pdnsd.git
|
||||
branch = shadowsocks-android
|
||||
[submodule "kcptun/kcptun"]
|
||||
path = kcptun/kcptun
|
||||
url = https://github.com/shadowsocks/kcptun
|
||||
[submodule "kcptun/go"]
|
||||
path = kcptun/go
|
||||
url = https://github.com/shadowsocks/go
|
||||
[submodule "src/main/jni/mbedtls"]
|
||||
path = src/main/jni/mbedtls
|
||||
[submodule "mobile/src/main/jni/mbedtls"]
|
||||
path = mobile/src/main/jni/mbedtls
|
||||
url = https://github.com/ARMmbed/mbedtls
|
||||
[submodule "src/main/jni/pcre"]
|
||||
path = src/main/jni/pcre
|
||||
[submodule "mobile/src/main/jni/pcre"]
|
||||
path = mobile/src/main/jni/pcre
|
||||
url = https://android.googlesource.com/platform/external/pcre
|
||||
|
||||
@@ -50,4 +50,4 @@ install:
|
||||
fi
|
||||
|
||||
script:
|
||||
- $SBTPATH/sbt native-build android:package-debug
|
||||
- $SBTPATH/sbt android:package
|
||||
|
||||
@@ -22,7 +22,6 @@ A [shadowsocks](http://shadowsocks.org) client for Android, written in Scala.
|
||||
|
||||
* Set environment variable `ANDROID_HOME` to `/path/to/android-sdk`
|
||||
* Set environment variable `ANDROID_NDK_HOME` to `/path/to/android-ndk`
|
||||
* Set environment variable `GOROOT_BOOTSTRAP` to `/path/to/go`
|
||||
* Create your key following the instructions at https://developer.android.com/studio/publish/app-signing.html
|
||||
* Create `local.properties` from `local.properties.example` with your own key information
|
||||
* Invoke the building like this
|
||||
@@ -31,7 +30,7 @@ A [shadowsocks](http://shadowsocks.org) client for Android, written in Scala.
|
||||
git submodule update --init
|
||||
|
||||
# Build the App
|
||||
sbt native-build clean android:package-release
|
||||
sbt clean android:package-release
|
||||
```
|
||||
|
||||
### TRANSLATE
|
||||
|
||||
@@ -1,66 +1,22 @@
|
||||
scalaVersion := "2.11.8"
|
||||
dexMaxHeap := "4g"
|
||||
import android.Keys.proguardCache
|
||||
|
||||
enablePlugins(AndroidApp)
|
||||
android.useSupportVectors
|
||||
lazy val commonSettings = Seq(
|
||||
scalaVersion := "2.11.8",
|
||||
dexMaxHeap := "4g",
|
||||
|
||||
name := "shadowsocks"
|
||||
version := "3.4.2"
|
||||
versionCode := Some(174)
|
||||
organization := "com.github.shadowsocks",
|
||||
|
||||
platformTarget := "android-25"
|
||||
platformTarget := "android-25",
|
||||
|
||||
compileOrder := CompileOrder.JavaThenScala
|
||||
javacOptions ++= "-source" :: "1.7" :: "-target" :: "1.7" :: Nil
|
||||
scalacOptions ++= "-target:jvm-1.7" :: "-Xexperimental" :: Nil
|
||||
compileOrder := CompileOrder.JavaThenScala,
|
||||
javacOptions ++= "-source" :: "1.7" :: "-target" :: "1.7" :: Nil,
|
||||
scalacOptions ++= "-target:jvm-1.7" :: "-Xexperimental" :: Nil,
|
||||
|
||||
proguardVersion := "5.3.2"
|
||||
proguardCache := Seq()
|
||||
proguardOptions ++=
|
||||
"-keep class com.github.shadowsocks.System { *; }" ::
|
||||
"-dontwarn com.google.android.gms.internal.**" ::
|
||||
"-dontwarn com.j256.ormlite.**" ::
|
||||
"-dontwarn okio.**" ::
|
||||
"-dontwarn org.xbill.**" ::
|
||||
Nil
|
||||
proguardVersion := "5.3.2",
|
||||
proguardCache := Seq(),
|
||||
|
||||
shrinkResources := true
|
||||
typedResources := false
|
||||
resConfigs := Seq("ja", "ru", "zh-rCN", "zh-rTW")
|
||||
shrinkResources := true,
|
||||
typedResources := false
|
||||
)
|
||||
|
||||
val supportLibsVersion = "25.1.0"
|
||||
val playServicesVersion = "10.0.1"
|
||||
resolvers += Resolver.jcenterRepo
|
||||
libraryDependencies ++=
|
||||
"com.android.support" % "cardview-v7" % supportLibsVersion ::
|
||||
"com.android.support" % "customtabs" % supportLibsVersion ::
|
||||
"com.android.support" % "design" % supportLibsVersion ::
|
||||
"com.android.support" % "gridlayout-v7" % supportLibsVersion ::
|
||||
"com.android.support" % "preference-v14" % supportLibsVersion ::
|
||||
"com.futuremind.recyclerfastscroll" % "fastscroll" % "0.2.5" ::
|
||||
"com.evernote" % "android-job" % "1.1.4" ::
|
||||
"com.github.jorgecastilloprz" % "fabprogresscircle" % "1.01" ::
|
||||
"com.google.android.gms" % "play-services-ads" % playServicesVersion ::
|
||||
"com.google.android.gms" % "play-services-analytics" % playServicesVersion ::
|
||||
"com.google.android.gms" % "play-services-gcm" % playServicesVersion ::
|
||||
"com.j256.ormlite" % "ormlite-android" % "5.0" ::
|
||||
"com.mikepenz" % "crossfader" % "1.5.0" ::
|
||||
"com.mikepenz" % "fastadapter" % "2.1.5" ::
|
||||
"com.mikepenz" % "iconics-core" % "2.8.2" ::
|
||||
"com.mikepenz" % "materialdrawer" % "5.8.1" ::
|
||||
"com.mikepenz" % "materialize" % "1.0.0" ::
|
||||
"com.squareup.okhttp3" % "okhttp" % "3.5.0" ::
|
||||
"com.twofortyfouram" % "android-plugin-api-for-locale" % "1.0.2" ::
|
||||
"dnsjava" % "dnsjava" % "2.1.7" ::
|
||||
"eu.chainfire" % "libsuperuser" % "1.0.0.201608240809" ::
|
||||
"net.glxn.qrgen" % "android" % "2.0" ::
|
||||
Nil
|
||||
|
||||
lazy val nativeBuild = TaskKey[Unit]("native-build", "Build native executables")
|
||||
nativeBuild := {
|
||||
val logger = streams.value.log
|
||||
Process("./build.sh") ! logger match {
|
||||
case 0 => // Success!
|
||||
case n => sys.error(s"Native build script exit code: $n")
|
||||
}
|
||||
}
|
||||
lazy val mobile = project.settings(commonSettings)
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
function try () {
|
||||
"$@" || exit -1
|
||||
}
|
||||
|
||||
pushd src/main
|
||||
# Clean up old binaries (no longer used)
|
||||
rm -rf assets/armeabi-v7a assets/x86 libs/armeabi-v7a libs/x86
|
||||
mkdir -p libs/armeabi-v7a libs/x86
|
||||
popd
|
||||
|
||||
# Build kcptun
|
||||
pushd kcptun
|
||||
try ./make.bash
|
||||
popd
|
||||
@@ -1,69 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
function try () {
|
||||
"$@" || exit -1
|
||||
}
|
||||
|
||||
[ -z "$ANDROID_NDK_HOME" ] && ANDROID_NDK_HOME=~/android-ndk-r12b
|
||||
|
||||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
DEPS=$DIR/.deps
|
||||
ANDROID_ARM_TOOLCHAIN=$DEPS/android-toolchain-16-arm
|
||||
ANDROID_X86_TOOLCHAIN=$DEPS/android-toolchain-16-x86
|
||||
|
||||
ANDROID_ARM_CC=$ANDROID_ARM_TOOLCHAIN/bin/arm-linux-androideabi-gcc
|
||||
ANDROID_ARM_STRIP=$ANDROID_ARM_TOOLCHAIN/bin/arm-linux-androideabi-strip
|
||||
|
||||
ANDROID_X86_CC=$ANDROID_X86_TOOLCHAIN/bin/i686-linux-android-gcc
|
||||
ANDROID_X86_STRIP=$ANDROID_X86_TOOLCHAIN/bin/i686-linux-android-strip
|
||||
|
||||
|
||||
if [ ! -d "$DEPS" ]; then
|
||||
mkdir -p $DEPS
|
||||
fi
|
||||
|
||||
if [ ! -d "$ANDROID_ARM_TOOLCHAIN" ]; then
|
||||
echo "Make standalone toolchain for ARM arch"
|
||||
$ANDROID_NDK_HOME/build/tools/make_standalone_toolchain.py --arch arm \
|
||||
--api 16 --install-dir $ANDROID_ARM_TOOLCHAIN
|
||||
fi
|
||||
|
||||
if [ ! -d "$ANDROID_X86_TOOLCHAIN" ]; then
|
||||
echo "Make standalone toolchain for X86 arch"
|
||||
$ANDROID_NDK_HOME/build/tools/make_standalone_toolchain.py --arch x86 \
|
||||
--api 16 --install-dir $ANDROID_X86_TOOLCHAIN
|
||||
fi
|
||||
|
||||
if [ ! -d "$DIR/go/bin" ]; then
|
||||
echo "Build the custom go"
|
||||
|
||||
pushd $DIR/go/src
|
||||
try ./make.bash
|
||||
popd
|
||||
fi
|
||||
|
||||
export GOROOT=$DIR/go
|
||||
export GOPATH=$DEPS/gopath
|
||||
export GOBIN=$GOPATH/bin
|
||||
mkdir -p $GOBIN
|
||||
export PATH=$GOROOT/bin:$PATH
|
||||
|
||||
pushd kcptun/client
|
||||
|
||||
echo "Get dependences for kcptun"
|
||||
go get -u github.com/xtaci/kcp-go
|
||||
go get -u github.com/xtaci/smux
|
||||
go get
|
||||
|
||||
echo "Cross compile kcptun for arm"
|
||||
try env CGO_ENABLED=1 CC=$ANDROID_ARM_CC GOOS=android GOARCH=arm GOARM=7 go build -ldflags="-s -w"
|
||||
try $ANDROID_ARM_STRIP client
|
||||
try mv client $DIR/../src/main/libs/armeabi-v7a/libkcptun.so
|
||||
|
||||
echo "Cross compile kcptun for x86"
|
||||
try env CGO_ENABLED=1 CC=$ANDROID_X86_CC GOOS=android GOARCH=386 go build -ldflags="-s -w"
|
||||
try $ANDROID_X86_STRIP client
|
||||
try mv client $DIR/../src/main/libs/x86/libkcptun.so
|
||||
popd
|
||||
|
||||
echo "Successfully build kcptun"
|
||||
@@ -0,0 +1,44 @@
|
||||
enablePlugins(AndroidApp)
|
||||
android.useSupportVectors
|
||||
|
||||
name := "shadowsocks"
|
||||
version := "4.0.0"
|
||||
versionCode := Some(174)
|
||||
|
||||
proguardOptions ++=
|
||||
"-keep class com.github.shadowsocks.System { *; }" ::
|
||||
"-dontwarn com.google.android.gms.internal.**" ::
|
||||
"-dontwarn com.j256.ormlite.**" ::
|
||||
"-dontwarn okio.**" ::
|
||||
"-dontwarn org.xbill.**" ::
|
||||
Nil
|
||||
|
||||
resConfigs := Seq("ja", "ru", "zh-rCN", "zh-rTW")
|
||||
|
||||
val supportLibsVersion = "25.1.0"
|
||||
val playServicesVersion = "10.0.1"
|
||||
resolvers += Resolver.jcenterRepo
|
||||
libraryDependencies ++=
|
||||
"com.android.support" % "cardview-v7" % supportLibsVersion ::
|
||||
"com.android.support" % "customtabs" % supportLibsVersion ::
|
||||
"com.android.support" % "design" % supportLibsVersion ::
|
||||
"com.android.support" % "gridlayout-v7" % supportLibsVersion ::
|
||||
"com.android.support" % "preference-v14" % supportLibsVersion ::
|
||||
"com.futuremind.recyclerfastscroll" % "fastscroll" % "0.2.5" ::
|
||||
"com.evernote" % "android-job" % "1.1.4" ::
|
||||
"com.github.jorgecastilloprz" % "fabprogresscircle" % "1.01" ::
|
||||
"com.google.android.gms" % "play-services-ads" % playServicesVersion ::
|
||||
"com.google.android.gms" % "play-services-analytics" % playServicesVersion ::
|
||||
"com.google.android.gms" % "play-services-gcm" % playServicesVersion ::
|
||||
"com.j256.ormlite" % "ormlite-android" % "5.0" ::
|
||||
"com.mikepenz" % "crossfader" % "1.5.0" ::
|
||||
"com.mikepenz" % "fastadapter" % "2.1.5" ::
|
||||
"com.mikepenz" % "iconics-core" % "2.8.2" ::
|
||||
"com.mikepenz" % "materialdrawer" % "5.8.1" ::
|
||||
"com.mikepenz" % "materialize" % "1.0.0" ::
|
||||
"com.squareup.okhttp3" % "okhttp" % "3.5.0" ::
|
||||
"com.twofortyfouram" % "android-plugin-api-for-locale" % "1.0.2" ::
|
||||
"dnsjava" % "dnsjava" % "2.1.7" ::
|
||||
"eu.chainfire" % "libsuperuser" % "1.0.0.201608240809" ::
|
||||
"net.glxn.qrgen" % "android" % "2.0" ::
|
||||
Nil
|
||||
|
Before Width: | Height: | Size: 34 KiB After Width: | Height: | Size: 34 KiB |
|
Before Width: | Height: | Size: 221 B After Width: | Height: | Size: 221 B |
|
Before Width: | Height: | Size: 806 B After Width: | Height: | Size: 806 B |
|
Before Width: | Height: | Size: 175 B After Width: | Height: | Size: 175 B |
|
Before Width: | Height: | Size: 556 B After Width: | Height: | Size: 556 B |
|
Before Width: | Height: | Size: 257 B After Width: | Height: | Size: 257 B |
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 347 B After Width: | Height: | Size: 347 B |
|
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.7 KiB |
|
Before Width: | Height: | Size: 436 B After Width: | Height: | Size: 436 B |
|
Before Width: | Height: | Size: 277 KiB After Width: | Height: | Size: 277 KiB |
|
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB |
|
Before Width: | Height: | Size: 2.0 KiB After Width: | Height: | Size: 2.0 KiB |
|
Before Width: | Height: | Size: 4.5 KiB After Width: | Height: | Size: 4.5 KiB |
|
Before Width: | Height: | Size: 7.3 KiB After Width: | Height: | Size: 7.3 KiB |
|
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 11 KiB |