Commit 66fe67ae authored by Max Lv's avatar Max Lv

fix build error

parent 04a8b49a
...@@ -17,7 +17,6 @@ install: ...@@ -17,7 +17,6 @@ install:
- echo "y" | android update sdk --filter tools,platform-tools,build-tools-21.0.1,android-21,extra-google-m2repository --no-ui --no-https -a - echo "y" | android update sdk --filter tools,platform-tools,build-tools-21.0.1,android-21,extra-google-m2repository --no-ui --no-https -a
- echo "y" | android update sdk --filter extra-android-m2repository --no-ui --no-https -a - echo "y" | android update sdk --filter extra-android-m2repository --no-ui --no-https -a
script: script:
- ./build-ndk.sh
- cp local.properties.travis local.properties - cp local.properties.travis local.properties
- sbt android:package-release - sbt android:package-release
- exit 0 - exit 0
...@@ -29,9 +29,6 @@ Help to translate shadowsocks: http://crowdin.net/project/shadowsocks/invite ...@@ -29,9 +29,6 @@ Help to translate shadowsocks: http://crowdin.net/project/shadowsocks/invite
```bash ```bash
git submodule update --init git submodule update --init
# Build native binaries
./build-ndk.sh
# Build the App # Build the App
sbt clean android:package-release sbt clean android:package-release
``` ```
...@@ -40,7 +37,8 @@ Help to translate shadowsocks: http://crowdin.net/project/shadowsocks/invite ...@@ -40,7 +37,8 @@ Help to translate shadowsocks: http://crowdin.net/project/shadowsocks/invite
* Install Android SDK and NDK by run `brew install android-ndk android-sdk` * Install Android SDK and NDK by run `brew install android-ndk android-sdk`
* Add `export ANDROID_HOME=/usr/local/Cellar/android-sdk/$version` to your .bashrc , then reopen the shell to load it. * Add `export ANDROID_HOME=/usr/local/Cellar/android-sdk/$version` to your .bashrc , then reopen the shell to load it.
* Run `echo "y" | android update sdk --filter tools,platform-tools,build-tools-19.0.3,android-19,extra-google-m2repository,extra-android-m2repository --no-ui --no-https -a` * echo "y" | android update sdk --filter tools,platform-tools,build-tools-21.0.1,android-21,extra-google-m2repository --no-ui --no-https -a
* echo "y" | android update sdk --filter extra-android-m2repository --no-ui --no-https -a
* Create your key following the instructions at http://developer.android.com/guide/publishing/app-signing.html#cert * Create your key following the instructions at http://developer.android.com/guide/publishing/app-signing.html#cert
* Put your key in ~/.keystore * Put your key in ~/.keystore
* Create `local.properties` from `local.properties.example` with your own key information . * Create `local.properties` from `local.properties.example` with your own key information .
...@@ -49,9 +47,6 @@ Help to translate shadowsocks: http://crowdin.net/project/shadowsocks/invite ...@@ -49,9 +47,6 @@ Help to translate shadowsocks: http://crowdin.net/project/shadowsocks/invite
```bash ```bash
git submodule update --init git submodule update --init
# Build native binaries
./build-ndk.sh
# Build the apk # Build the apk
sbt clean android:package-release sbt clean android:package-release
``` ```
......
...@@ -10,6 +10,8 @@ name := "shadowsocks" ...@@ -10,6 +10,8 @@ name := "shadowsocks"
compileOrder in Compile := CompileOrder.JavaThenScala compileOrder in Compile := CompileOrder.JavaThenScala
ndkJavah in Android := List()
resolvers += "JRAF" at "http://JRAF.org/static/maven/2" resolvers += "JRAF" at "http://JRAF.org/static/maven/2"
resolvers += "madeye private releases" at "http://madeye-maven-repository.googlecode.com/git/" resolvers += "madeye private releases" at "http://madeye-maven-repository.googlecode.com/git/"
......
...@@ -37,7 +37,7 @@ LIBEVENT_SOURCES := \ ...@@ -37,7 +37,7 @@ LIBEVENT_SOURCES := \
LOCAL_MODULE := event LOCAL_MODULE := event
LOCAL_SRC_FILES := $(addprefix libevent/, $(LIBEVENT_SOURCES)) LOCAL_SRC_FILES := $(addprefix libevent/, $(LIBEVENT_SOURCES))
LOCAL_CFLAGS := -O2 -g -I$(LOCAL_PATH)/libevent \ LOCAL_CFLAGS := -O2 -I$(LOCAL_PATH)/libevent \
-I$(LOCAL_PATH)/libevent/include \ -I$(LOCAL_PATH)/libevent/include \
-I$(LOCAL_PATH)/openssl/include -I$(LOCAL_PATH)/openssl/include
...@@ -122,7 +122,7 @@ LOCAL_STATIC_LIBRARIES := libevent ...@@ -122,7 +122,7 @@ LOCAL_STATIC_LIBRARIES := libevent
LOCAL_MODULE := redsocks-jni LOCAL_MODULE := redsocks-jni
LOCAL_SRC_FILES := $(addprefix redsocks/, $(REDSOCKS_SOURCES)) main-jni.cpp LOCAL_SRC_FILES := $(addprefix redsocks/, $(REDSOCKS_SOURCES)) main-jni.cpp
LOCAL_CFLAGS := -O2 -std=gnu99 -g -I$(LOCAL_PATH)/redsocks \ LOCAL_CFLAGS := -O2 -std=gnu99 -DREDSOCKS_JNI -I$(LOCAL_PATH)/redsocks \
-I$(LOCAL_PATH)/libevent/include \ -I$(LOCAL_PATH)/libevent/include \
-I$(LOCAL_PATH)/libevent -I$(LOCAL_PATH)/libevent
......
...@@ -175,13 +175,14 @@ class ShadowsocksNatService extends Service with BaseService { ...@@ -175,13 +175,14 @@ class ShadowsocksNatService extends Service with BaseService {
def startRedsocksDaemon() { def startRedsocksDaemon() {
val conf = ConfigUtils.REDSOCKS.format(config.localPort) val conf = ConfigUtils.REDSOCKS.format(config.localPort)
val args = "redsocks -p %sredsocks.pid -c %sredsocks.conf" val cmd = "redsocks -p %sredsocks.pid -c %sredsocks.conf"
.format(Path.BASE, Path.BASE) .format(Path.BASE, Path.BASE)
ConfigUtils.printToFile(new File(Path.BASE + "redsocks.conf"))(p => { ConfigUtils.printToFile(new File(Path.BASE + "redsocks.conf"))(p => {
p.println(conf) p.println(conf)
}) })
val cmd = Path.BASE + args if (BuildConfig.DEBUG) Log.d(TAG, cmd)
Console.runCommand(cmd)
Core.redsocks(cmd.split(" "))
} }
/** Called when the activity is first created. */ /** Called when the activity is first created. */
......
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