Skip to content

Commit

Permalink
Run tun2socks in seprate process for now
Browse files Browse the repository at this point in the history
  • Loading branch information
madeye committed Nov 24, 2014
1 parent 16d2cd9 commit 383e940
Show file tree
Hide file tree
Showing 11 changed files with 298 additions and 318 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ local.sbt
out/

#NDK
src/main/obj
src/main/libs
src/main/assets/armeabi
src/main/assets/armeabi-v7a
Expand Down
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,6 @@ install:
- echo "y" | android update sdk --filter extra-android-m2repository --no-ui --no-https -a
script:
- cp local.properties.travis local.properties
- ./build.sh
- sbt android:package-release
- exit 0
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ Help to translate shadowsocks: http://crowdin.net/project/shadowsocks/invite

```bash
git submodule update --init

# Build native binaries
./build.sh

# Build the App
sbt clean android:package-release
Expand All @@ -47,6 +50,9 @@ Help to translate shadowsocks: http://crowdin.net/project/shadowsocks/invite
```bash
git submodule update --init

# Build native binaries
./build.sh

# Build the apk
sbt clean android:package-release
```
Expand Down
2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ rm -rf assets/armeabi-v7a
rm -rf assets/x86
mkdir -p assets/armeabi-v7a
mkdir -p assets/x86
for app in pdnsd redsocks ss-local ss-tunnel tun2socks
for app in pdnsd redsocks ss-local ss-tunnel
do
try mv libs/armeabi-v7a/$app assets/armeabi-v7a/
try mv libs/x86/$app assets/x86/
Expand Down
4 changes: 3 additions & 1 deletion project/plugins.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@ resolvers += Resolver.url("scalasbt releases", new URL("http://scalasbt.artifact

addSbtPlugin("com.hanhuy.sbt" % "android-sdk-plugin" % "1.3.10")

addSbtPlugin("com.github.mpeltonen" % "sbt-idea" % "1.6.0")
resolvers += Resolver.sbtPluginRepo("snapshots")

addSbtPlugin("com.hanhuy.sbt" % "sbt-idea" % "1.7.0-SNAPSHOT")
5 changes: 2 additions & 3 deletions src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.github.shadowsocks"
android:versionCode="84"
android:versionName="2.4.4">
android:versionCode="85"
android:versionName="2.4.5">

<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
Expand All @@ -18,7 +18,6 @@

<application
android:allowBackup="true"
android:debuggable="true"
android:name=".ShadowsocksApplication"
android:hardwareAccelerated="true"
android:icon="@drawable/ic_launcher"
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/github/shadowsocks/Tun2Socks.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@

public class Tun2Socks {
static {
java.lang.System.loadLibrary("tun2socks-jni");
java.lang.System.loadLibrary("tun2socks");
}

public static native void start(String[] cmd);
Expand Down
6 changes: 3 additions & 3 deletions src/main/jni/Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ LOCAL_CFLAGS += -DBADVPN_THREADWORK_USE_PTHREAD -DBADVPN_LINUX -DBADVPN_BREACTOR
LOCAL_CFLAGS += -DBADVPN_USE_SELFPIPE -DBADVPN_USE_EPOLL
LOCAL_CFLAGS += -DBADVPN_LITTLE_ENDIAN -DBADVPN_THREAD_SAFE
LOCAL_CFLAGS += -DNDEBUG -DANDROID
#LOCAL_CFLAGS += -DTUN2SOCKS_JNI
LOCAL_CFLAGS += -DTUN2SOCKS_JNI

LOCAL_C_INCLUDES:= \
$(LOCAL_PATH)/badvpn/lwip/src/include/ipv4 \
Expand Down Expand Up @@ -288,9 +288,9 @@ LOCAL_MODULE := tun2socks

LOCAL_LDLIBS := -ldl -llog

LOCAL_SRC_FILES := $(addprefix badvpn/, $(TUN2SOCKS_SOURCES))
LOCAL_SRC_FILES := $(addprefix badvpn/, $(TUN2SOCKS_SOURCES)) tun2socks-jni.cpp

include $(BUILD_EXECUTABLE)
include $(BUILD_SHARED_LIBRARY)

# OpenSSL
openssl_subdirs := $(addprefix $(LOCAL_PATH)/openssl/,$(addsuffix /Android.mk, \
Expand Down
Loading

0 comments on commit 383e940

Please sign in to comment.