Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bf207eb9b8 | ||
|
|
7e8dad5c76 | ||
|
|
185e7608ae | ||
|
|
d844fc2457 | ||
|
|
a1bdfa5bd9 | ||
|
|
6c7f62c237 | ||
|
|
383e9404ec | ||
|
|
16d2cd9a29 | ||
|
|
9ee2345fd6 | ||
|
|
567543d00e | ||
|
|
7c2b717141 | ||
|
|
08d5d56e46 | ||
|
|
e22b145023 | ||
|
|
a10889bb5b | ||
|
|
800e85dc0d | ||
|
|
e778a313ba | ||
|
|
a3519fbdc8 | ||
|
|
486288a513 | ||
|
|
0111bd5471 | ||
|
|
66fe67ae21 | ||
|
|
04a8b49abc | ||
|
|
3561c7f317 | ||
|
|
694534be58 | ||
|
|
efb614030f | ||
|
|
8f41ea291f | ||
|
|
27ba7d64f4 | ||
|
|
8fb5d7f8c6 | ||
|
|
014692cb84 | ||
|
|
948db260b6 | ||
|
|
b7c3c7d269 | ||
|
|
897b222aa8 | ||
|
|
9a724cd063 | ||
|
|
b15a4604f2 | ||
|
|
2e3a2c9544 | ||
|
|
d6ed052338 | ||
|
|
4b99f8e3d6 | ||
|
|
475cfe3269 | ||
|
|
102387077f | ||
|
|
72824eb8f4 | ||
|
|
1f40be1ad3 | ||
|
|
c12ec62d8b | ||
|
|
e38ed2d069 | ||
|
|
2e05e3cda8 | ||
|
|
92ffb357a6 | ||
|
|
4beff01a3f | ||
|
|
7627952234 | ||
|
|
425d4a42e8 | ||
|
|
194d978143 | ||
|
|
f6841848a3 | ||
|
|
52cb15069c | ||
|
|
70ed2189b1 | ||
|
|
aeee9c2fac | ||
|
|
70dc8e9995 | ||
|
|
558a39ec14 | ||
|
|
5f95cccce4 | ||
|
|
55f25d3272 | ||
|
|
93273cbc44 | ||
|
|
c0514ee169 | ||
|
|
06d736b22d | ||
|
|
e34d5675eb | ||
|
|
94c7ffb788 | ||
|
|
0647ef4c6d | ||
|
|
97c6ff95cd |
+1
-4
@@ -1,7 +1,6 @@
|
|||||||
classes
|
classes
|
||||||
bin
|
bin
|
||||||
gen
|
gen
|
||||||
obj
|
|
||||||
target
|
target
|
||||||
local.properties
|
local.properties
|
||||||
.classpath
|
.classpath
|
||||||
@@ -24,12 +23,10 @@ local.sbt
|
|||||||
out/
|
out/
|
||||||
|
|
||||||
#NDK
|
#NDK
|
||||||
|
src/main/obj
|
||||||
src/main/libs
|
src/main/libs
|
||||||
src/main/assets/armeabi
|
src/main/assets/armeabi
|
||||||
src/main/assets/armeabi-v7a
|
src/main/assets/armeabi-v7a
|
||||||
src/main/assets/x86
|
src/main/assets/x86
|
||||||
src/main/assets/api-16/
|
src/main/assets/api-16/
|
||||||
src/main/jni
|
|
||||||
jni/Application.mk
|
jni/Application.mk
|
||||||
obj
|
|
||||||
libs
|
|
||||||
|
|||||||
+3
-3
@@ -1,3 +1,3 @@
|
|||||||
[submodule "jni/shadowsocks"]
|
[submodule "src/main/jni/shadowsocks"]
|
||||||
path = jni/shadowsocks
|
path = src/main/jni/shadowsocks
|
||||||
url = https://github.com/madeye/shadowsocks-libev.git
|
url = https://github.com/madeye/shadowsocks-libev
|
||||||
|
|||||||
+7
-11
@@ -3,25 +3,21 @@ scala:
|
|||||||
- 2.10.4
|
- 2.10.4
|
||||||
before_install:
|
before_install:
|
||||||
- sudo apt-get update
|
- sudo apt-get update
|
||||||
- sudo apt-get install libc6-dev-i386
|
install:
|
||||||
- sudo apt-get install lib32ncurses5-dev
|
- sudo apt-get install -y libc6-dev-i386 lib32ncurses5-dev libx11-dev g++-multilib lib32z1-dev ccache
|
||||||
- sudo apt-get install libx11-dev
|
|
||||||
- sudo apt-get install g++-multilib
|
|
||||||
- sudo apt-get install lib32z1-dev
|
|
||||||
- sudo apt-get install ccache
|
|
||||||
- export NDK_CCACHE=ccache
|
- export NDK_CCACHE=ccache
|
||||||
- export ARCH=`uname -m`
|
- export ARCH=`uname -m`
|
||||||
- wget http://dl.google.com/android/android-sdk_r23-linux.tgz
|
- wget http://dl.google.com/android/android-sdk_r23.0.2-linux.tgz
|
||||||
- tar xf android-sdk_r23-linux.tgz
|
- tar xf android-sdk_r23.0.2-linux.tgz
|
||||||
- wget http://dl.google.com/android/ndk/android-ndk-r9d-linux-${ARCH}.tar.bz2
|
- wget http://dl.google.com/android/ndk/android-ndk-r9d-linux-${ARCH}.tar.bz2
|
||||||
- tar xf android-ndk-r9d-linux-${ARCH}.tar.bz2
|
- tar xf android-ndk-r9d-linux-${ARCH}.tar.bz2
|
||||||
- export ANDROID_NDK=`pwd`/android-ndk-r9d
|
- export ANDROID_NDK_HOME=`pwd`/android-ndk-r9d
|
||||||
- export ANDROID_HOME=`pwd`/android-sdk-linux
|
- export ANDROID_HOME=`pwd`/android-sdk-linux
|
||||||
- export PATH=${PATH}:${ANDROID_NDK_HOME}:${ANDROID_HOME}/tools:${ANDROID_HOME}/platform-tools
|
- export PATH=${PATH}:${ANDROID_NDK_HOME}:${ANDROID_HOME}/tools:${ANDROID_HOME}/platform-tools
|
||||||
- echo "y" | android update sdk --filter tools,platform-tools,build-tools-20.0.0,android-19,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
|
||||||
|
- ./build.sh
|
||||||
- sbt android:package-release
|
- sbt android:package-release
|
||||||
- exit 0
|
- exit 0
|
||||||
|
|||||||
@@ -28,10 +28,10 @@ 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 native binaries
|
||||||
|
./build.sh
|
||||||
|
|
||||||
# Build the App
|
# Build the App
|
||||||
sbt clean android:package-release
|
sbt clean android:package-release
|
||||||
```
|
```
|
||||||
@@ -39,8 +39,9 @@ Help to translate shadowsocks: http://crowdin.net/project/shadowsocks/invite
|
|||||||
#### BUILD on Mac OS X (with HomeBrew)
|
#### BUILD on Mac OS X (with HomeBrew)
|
||||||
|
|
||||||
* 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 loat 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 .
|
||||||
@@ -50,8 +51,8 @@ Help to translate shadowsocks: http://crowdin.net/project/shadowsocks/invite
|
|||||||
git submodule update --init
|
git submodule update --init
|
||||||
|
|
||||||
# Build native binaries
|
# Build native binaries
|
||||||
./build-ndk.sh
|
./build.sh
|
||||||
|
|
||||||
# Build the apk
|
# Build the apk
|
||||||
sbt clean android:package-release
|
sbt clean android:package-release
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -1,14 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
ndk-build clean
|
|
||||||
ndk-build
|
|
||||||
rm -rf src/main/assets/armeabi-v7a
|
|
||||||
rm -rf src/main/assets/x86
|
|
||||||
mkdir -p src/main/assets/armeabi-v7a
|
|
||||||
mkdir -p src/main/assets/x86
|
|
||||||
for app in pdnsd redsocks
|
|
||||||
do
|
|
||||||
mv libs/armeabi-v7a/$app src/main/assets/armeabi-v7a/
|
|
||||||
mv libs/x86/$app src/main/assets/x86/
|
|
||||||
done
|
|
||||||
|
|
||||||
@@ -4,12 +4,16 @@ import android.Dependencies.{apklib,aar}
|
|||||||
|
|
||||||
android.Plugin.androidBuild
|
android.Plugin.androidBuild
|
||||||
|
|
||||||
platformTarget in Android := "android-19"
|
platformTarget in Android := "android-21"
|
||||||
|
|
||||||
name := "shadowsocks"
|
name := "shadowsocks"
|
||||||
|
|
||||||
compileOrder in Compile := CompileOrder.JavaThenScala
|
compileOrder in Compile := CompileOrder.JavaThenScala
|
||||||
|
|
||||||
|
ndkJavah in Android := List()
|
||||||
|
|
||||||
|
ndkBuild 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/"
|
||||||
|
|||||||
@@ -0,0 +1,24 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
function try () {
|
||||||
|
"$@" || exit -1
|
||||||
|
}
|
||||||
|
|
||||||
|
try pushd src/main
|
||||||
|
|
||||||
|
# Build
|
||||||
|
try $ANDROID_NDK_HOME/ndk-build clean
|
||||||
|
try $ANDROID_NDK_HOME/ndk-build
|
||||||
|
|
||||||
|
# copy executables
|
||||||
|
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
|
||||||
|
do
|
||||||
|
try mv libs/armeabi-v7a/$app assets/armeabi-v7a/
|
||||||
|
try mv libs/x86/$app assets/x86/
|
||||||
|
done
|
||||||
|
|
||||||
|
try popd
|
||||||
@@ -1,84 +0,0 @@
|
|||||||
#include <jni.h>
|
|
||||||
#include <string.h>
|
|
||||||
#include <unistd.h>
|
|
||||||
|
|
||||||
typedef unsigned short char16_t;
|
|
||||||
|
|
||||||
class String8 {
|
|
||||||
public:
|
|
||||||
String8() {
|
|
||||||
mString = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
~String8() {
|
|
||||||
if (mString) {
|
|
||||||
free(mString);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void set(const char16_t* o, size_t numChars) {
|
|
||||||
if (mString) {
|
|
||||||
free(mString);
|
|
||||||
}
|
|
||||||
mString = (char*) malloc(numChars + 1);
|
|
||||||
if (!mString) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
for (size_t i = 0; i < numChars; i++) {
|
|
||||||
mString[i] = (char) o[i];
|
|
||||||
}
|
|
||||||
mString[numChars] = '\0';
|
|
||||||
}
|
|
||||||
|
|
||||||
const char* string() {
|
|
||||||
return mString;
|
|
||||||
}
|
|
||||||
private:
|
|
||||||
char* mString;
|
|
||||||
};
|
|
||||||
|
|
||||||
extern "C" {
|
|
||||||
|
|
||||||
int main(int argc, char* args[]);
|
|
||||||
|
|
||||||
#if defined(PDNSD_JNI)
|
|
||||||
jint Java_com_github_shadowsocks_Core_pdnsd(JNIEnv *env, jobject thiz, jobjectArray argv) {
|
|
||||||
#elif defined(SSLOCAL_JNI)
|
|
||||||
jint Java_com_github_shadowsocks_Core_sslocal(JNIEnv *env, jobject thiz, jobjectArray argv) {
|
|
||||||
#elif defined(SSTUNNEL_JNI)
|
|
||||||
jint Java_com_github_shadowsocks_Core_sstunnel(JNIEnv *env, jobject thiz, jobjectArray argv) {
|
|
||||||
#elif defined(TUN2SOCKS_JNI)
|
|
||||||
jint Java_com_github_shadowsocks_Core_tun2socks(JNIEnv *env, jobject thiz, jobjectArray argv) {
|
|
||||||
#else
|
|
||||||
#error "invalid header"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
int argc = argv ? env->GetArrayLength(argv) : 0;
|
|
||||||
char **args = NULL;
|
|
||||||
String8 tmp_8;
|
|
||||||
|
|
||||||
if (argc > 0) {
|
|
||||||
args = (char **)malloc((argc+1)*sizeof(char *));
|
|
||||||
for (int i = 0; i < argc; ++i) {
|
|
||||||
jstring arg = reinterpret_cast<jstring>(env->GetObjectArrayElement(argv, i));
|
|
||||||
const jchar *str = env->GetStringCritical(arg, 0);
|
|
||||||
tmp_8.set(str, env->GetStringLength(arg));
|
|
||||||
env->ReleaseStringCritical(arg, str);
|
|
||||||
args[i] = strdup(tmp_8.string());
|
|
||||||
}
|
|
||||||
args[argc] = NULL;
|
|
||||||
|
|
||||||
pid_t pid;
|
|
||||||
pid = fork();
|
|
||||||
if (pid == 0) {
|
|
||||||
int ret = main(argc, args);
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (args != NULL) free(args);
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
Submodule jni/shadowsocks deleted from 06f1a57c9b
+4
-2
@@ -1,5 +1,7 @@
|
|||||||
resolvers += Resolver.url("scalasbt releases", new URL("http://scalasbt.artifactoryonline.com/scalasbt/sbt-plugin-snapshots"))(Resolver.ivyStylePatterns)
|
resolvers += Resolver.url("scalasbt releases", new URL("http://scalasbt.artifactoryonline.com/scalasbt/sbt-plugin-snapshots"))(Resolver.ivyStylePatterns)
|
||||||
|
|
||||||
addSbtPlugin("com.hanhuy.sbt" % "android-sdk-plugin" % "1.2.20")
|
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")
|
||||||
|
|||||||
@@ -1,14 +1,12 @@
|
|||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
package="com.github.shadowsocks"
|
package="com.github.shadowsocks"
|
||||||
android:versionCode="71"
|
android:versionCode="86"
|
||||||
android:versionName="2.2.3">
|
android:versionName="2.4.6">
|
||||||
|
|
||||||
<uses-permission android:name="android.permission.INTERNET"/>
|
<uses-permission android:name="android.permission.INTERNET"/>
|
||||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
|
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
|
||||||
<uses-permission android:name="android.permission.WAKE_LOCK"/>
|
|
||||||
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
|
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
|
||||||
<uses-permission android:name="android.permission.ACCESS_SUPERUSER"/>
|
<uses-permission android:name="android.permission.ACCESS_SUPERUSER"/>
|
||||||
<uses-permission android:name="android.permission.WRITE_SETTINGS"/>
|
|
||||||
|
|
||||||
<uses-feature
|
<uses-feature
|
||||||
android:name="android.hardware.touchscreen"
|
android:name="android.hardware.touchscreen"
|
||||||
@@ -16,7 +14,7 @@
|
|||||||
|
|
||||||
<uses-sdk
|
<uses-sdk
|
||||||
android:minSdkVersion="16"
|
android:minSdkVersion="16"
|
||||||
android:targetSdkVersion="19"/>
|
android:targetSdkVersion="21"/>
|
||||||
|
|
||||||
<application
|
<application
|
||||||
android:allowBackup="true"
|
android:allowBackup="true"
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ public class Config implements Parcelable {
|
|||||||
public String profileName = "Untitled";
|
public String profileName = "Untitled";
|
||||||
public String proxy = "127.0.0.1";
|
public String proxy = "127.0.0.1";
|
||||||
public String sitekey = "null";
|
public String sitekey = "null";
|
||||||
|
public String route = "all";
|
||||||
|
|
||||||
public String encMethod = "rc4";
|
public String encMethod = "rc4";
|
||||||
public String proxiedAppString = "";
|
public String proxiedAppString = "";
|
||||||
@@ -33,7 +34,7 @@ public class Config implements Parcelable {
|
|||||||
|
|
||||||
public Config(boolean isGlobalProxy, boolean isGFWList, boolean isBypassApps,
|
public Config(boolean isGlobalProxy, boolean isGFWList, boolean isBypassApps,
|
||||||
boolean isTrafficStat, boolean isUdpDns, String profileName, String proxy, String sitekey,
|
boolean isTrafficStat, boolean isUdpDns, String profileName, String proxy, String sitekey,
|
||||||
String encMethod, String proxiedAppString, int remotePort, int localPort) {
|
String encMethod, String proxiedAppString, String route, int remotePort, int localPort) {
|
||||||
this.isGlobalProxy = isGlobalProxy;
|
this.isGlobalProxy = isGlobalProxy;
|
||||||
this.isGFWList = isGFWList;
|
this.isGFWList = isGFWList;
|
||||||
this.isBypassApps = isBypassApps;
|
this.isBypassApps = isBypassApps;
|
||||||
@@ -44,6 +45,7 @@ public class Config implements Parcelable {
|
|||||||
this.sitekey = sitekey;
|
this.sitekey = sitekey;
|
||||||
this.encMethod = encMethod;
|
this.encMethod = encMethod;
|
||||||
this.proxiedAppString = proxiedAppString;
|
this.proxiedAppString = proxiedAppString;
|
||||||
|
this.route = route;
|
||||||
this.remotePort = remotePort;
|
this.remotePort = remotePort;
|
||||||
this.localPort = localPort;
|
this.localPort = localPort;
|
||||||
}
|
}
|
||||||
@@ -63,6 +65,7 @@ public class Config implements Parcelable {
|
|||||||
sitekey = in.readString();
|
sitekey = in.readString();
|
||||||
encMethod = in.readString();
|
encMethod = in.readString();
|
||||||
proxiedAppString = in.readString();
|
proxiedAppString = in.readString();
|
||||||
|
route = in.readString();
|
||||||
remotePort = in.readInt();
|
remotePort = in.readInt();
|
||||||
localPort = in.readInt();
|
localPort = in.readInt();
|
||||||
}
|
}
|
||||||
@@ -82,6 +85,7 @@ public class Config implements Parcelable {
|
|||||||
out.writeString(sitekey);
|
out.writeString(sitekey);
|
||||||
out.writeString(encMethod);
|
out.writeString(encMethod);
|
||||||
out.writeString(proxiedAppString);
|
out.writeString(proxiedAppString);
|
||||||
|
out.writeString(route);
|
||||||
out.writeInt(remotePort);
|
out.writeInt(remotePort);
|
||||||
out.writeInt(localPort);
|
out.writeInt(localPort);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,53 +0,0 @@
|
|||||||
/* 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("ss-tunnel-jni");
|
|
||||||
java.lang.System.loadLibrary("tun2socks-jni");
|
|
||||||
java.lang.System.loadLibrary("pdnsd-jni");
|
|
||||||
}
|
|
||||||
|
|
||||||
public static native void sslocal(String[] cmd);
|
|
||||||
public static native void sstunnel(String[] cmd);
|
|
||||||
public static native void tun2socks(String[] cmd);
|
|
||||||
public static native void pdnsd(String[] cmd);
|
|
||||||
}
|
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2012-2013 Jorrit "Chainfire" Jongma
|
* Copyright (C) 2012-2014 Jorrit "Chainfire" Jongma
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2012-2013 Jorrit "Chainfire" Jongma
|
* Copyright (C) 2012-2014 Jorrit "Chainfire" Jongma
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@@ -18,6 +18,7 @@ package eu.chainfire.libsuperuser;
|
|||||||
|
|
||||||
import android.os.Looper;
|
import android.os.Looper;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
|
||||||
import com.github.shadowsocks.BuildConfig;
|
import com.github.shadowsocks.BuildConfig;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -0,0 +1,59 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2012-2014 Jorrit "Chainfire" Jongma
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package eu.chainfire.libsuperuser;
|
||||||
|
|
||||||
|
import android.content.BroadcastReceiver;
|
||||||
|
import android.content.Context;
|
||||||
|
import android.content.Intent;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* Base receiver to extend to catch notifications when overlays should be
|
||||||
|
* hidden.
|
||||||
|
* </p>
|
||||||
|
* <p>
|
||||||
|
* Tapjacking protection in SuperSU prevents some dialogs from receiving user
|
||||||
|
* input when overlays are present. For security reasons this notification is
|
||||||
|
* only sent to apps that have previously been granted root access, so even if
|
||||||
|
* your app does not <em>require</em> root, you still need to <em>request</em>
|
||||||
|
* it, and the user must grant it.
|
||||||
|
* </p>
|
||||||
|
* <p>
|
||||||
|
* Note that the word overlay as used here should be interpreted as "any view or
|
||||||
|
* window possibly obscuring SuperSU dialogs".
|
||||||
|
* </p>
|
||||||
|
*/
|
||||||
|
public abstract class HideOverlaysReceiver extends BroadcastReceiver {
|
||||||
|
public static final String ACTION_HIDE_OVERLAYS = "eu.chainfire.supersu.action.HIDE_OVERLAYS";
|
||||||
|
public static final String CATEGORY_HIDE_OVERLAYS = Intent.CATEGORY_INFO;
|
||||||
|
public static final String EXTRA_HIDE_OVERLAYS = "eu.chainfire.supersu.extra.HIDE";
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public final void onReceive(Context context, Intent intent) {
|
||||||
|
if (intent.hasExtra(EXTRA_HIDE_OVERLAYS)) {
|
||||||
|
onHideOverlays(intent.getBooleanExtra(EXTRA_HIDE_OVERLAYS, false));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Called when overlays <em>should</em> be hidden or <em>may</em> be shown
|
||||||
|
* again.
|
||||||
|
*
|
||||||
|
* @param hide Should overlays be hidden?
|
||||||
|
*/
|
||||||
|
public abstract void onHideOverlays(boolean hide);
|
||||||
|
}
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2012-2013 Jorrit "Chainfire" Jongma
|
* Copyright (C) 2012-2014 Jorrit "Chainfire" Jongma
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2012-2013 Jorrit "Chainfire" Jongma
|
* Copyright (C) 2012-2014 Jorrit "Chainfire" Jongma
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2012-2013 Jorrit "Chainfire" Jongma
|
* Copyright (C) 2012-2014 Jorrit "Chainfire" Jongma
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|||||||
@@ -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
|
||||||
|
|
||||||
@@ -121,15 +121,15 @@ REDSOCKS_SOURCES := base.c dnstc.c http-connect.c \
|
|||||||
LOCAL_STATIC_LIBRARIES := libevent
|
LOCAL_STATIC_LIBRARIES := libevent
|
||||||
|
|
||||||
LOCAL_MODULE := redsocks
|
LOCAL_MODULE := redsocks
|
||||||
LOCAL_SRC_FILES := $(addprefix redsocks/, $(REDSOCKS_SOURCES))
|
LOCAL_SRC_FILES := $(addprefix redsocks/, $(REDSOCKS_SOURCES))
|
||||||
LOCAL_CFLAGS := -O2 -std=gnu99 -g -I$(LOCAL_PATH)/redsocks \
|
LOCAL_CFLAGS := -O2 -std=gnu99 -I$(LOCAL_PATH)/redsocks \
|
||||||
-I$(LOCAL_PATH)/libevent/include \
|
-I$(LOCAL_PATH)/libevent/include \
|
||||||
-I$(LOCAL_PATH)/libevent
|
-I$(LOCAL_PATH)/libevent
|
||||||
|
|
||||||
include $(BUILD_EXECUTABLE)
|
include $(BUILD_EXECUTABLE)
|
||||||
|
|
||||||
########################################################
|
########################################################
|
||||||
## pdnsd
|
## pdnsd library
|
||||||
########################################################
|
########################################################
|
||||||
|
|
||||||
include $(CLEAR_VARS)
|
include $(CLEAR_VARS)
|
||||||
@@ -142,20 +142,6 @@ LOCAL_CFLAGS := -Wall -O2 -I$(LOCAL_PATH)/pdnsd
|
|||||||
|
|
||||||
include $(BUILD_EXECUTABLE)
|
include $(BUILD_EXECUTABLE)
|
||||||
|
|
||||||
########################################################
|
|
||||||
## pdnsd library
|
|
||||||
########################################################
|
|
||||||
|
|
||||||
include $(CLEAR_VARS)
|
|
||||||
|
|
||||||
PDNSD_SOURCES := $(wildcard $(LOCAL_PATH)/pdnsd/src/*.c) main-jni.cpp
|
|
||||||
|
|
||||||
LOCAL_MODULE := pdnsd-jni
|
|
||||||
LOCAL_SRC_FILES := $(PDNSD_SOURCES:$(LOCAL_PATH)/%=%)
|
|
||||||
LOCAL_CFLAGS := -Wall -O2 -DPDNSD_JNI -I$(LOCAL_PATH)/pdnsd
|
|
||||||
|
|
||||||
include $(BUILD_SHARED_LIBRARY)
|
|
||||||
|
|
||||||
########################################################
|
########################################################
|
||||||
## shadowsocks local library
|
## shadowsocks local library
|
||||||
########################################################
|
########################################################
|
||||||
@@ -164,9 +150,9 @@ include $(CLEAR_VARS)
|
|||||||
|
|
||||||
SHADOWSOCKS_SOURCES := local.c cache.c udprelay.c encrypt.c utils.c json.c jconf.c acl.c
|
SHADOWSOCKS_SOURCES := local.c cache.c udprelay.c encrypt.c utils.c json.c jconf.c acl.c
|
||||||
|
|
||||||
LOCAL_MODULE := ss-local-jni
|
LOCAL_MODULE := ss-local
|
||||||
LOCAL_SRC_FILES := $(addprefix shadowsocks/src/, $(SHADOWSOCKS_SOURCES)) main-jni.cpp
|
LOCAL_SRC_FILES := $(addprefix shadowsocks/src/, $(SHADOWSOCKS_SOURCES))
|
||||||
LOCAL_CFLAGS := -Wall -O2 -fno-strict-aliasing -DUDPRELAY_LOCAL -DSSLOCAL_JNI \
|
LOCAL_CFLAGS := -Wall -O2 -fno-strict-aliasing -DUDPRELAY_LOCAL \
|
||||||
-DUSE_CRYPTO_OPENSSL -DANDROID -DHAVE_CONFIG_H \
|
-DUSE_CRYPTO_OPENSSL -DANDROID -DHAVE_CONFIG_H \
|
||||||
-I$(LOCAL_PATH)/libev/ \
|
-I$(LOCAL_PATH)/libev/ \
|
||||||
-I$(LOCAL_PATH)/openssl/include \
|
-I$(LOCAL_PATH)/openssl/include \
|
||||||
@@ -177,39 +163,18 @@ LOCAL_STATIC_LIBRARIES := libev libcrypto libipset libcork
|
|||||||
|
|
||||||
LOCAL_LDLIBS := -llog
|
LOCAL_LDLIBS := -llog
|
||||||
|
|
||||||
include $(BUILD_SHARED_LIBRARY)
|
include $(BUILD_EXECUTABLE)
|
||||||
|
|
||||||
########################################################
|
########################################################
|
||||||
## shadowsocks tunnel
|
## shadowsocks tunnel
|
||||||
########################################################
|
########################################################
|
||||||
|
|
||||||
# include $(CLEAR_VARS)
|
|
||||||
#
|
|
||||||
# SHADOWSOCKS_SOURCES := tunnel.c cache.c udprelay.c encrypt.c utils.c json.c jconf.c
|
|
||||||
#
|
|
||||||
# LOCAL_MODULE := ss-tunnel
|
|
||||||
# LOCAL_SRC_FILES := $(addprefix shadowsocks/src/, $(SHADOWSOCKS_SOURCES))
|
|
||||||
# LOCAL_CFLAGS := -Wall -O2 -fno-strict-aliasing -DUDPRELAY_LOCAL -DUDPRELAY_TUNNEL \
|
|
||||||
# -DUSE_CRYPTO_OPENSSL -DANDROID -DHAVE_CONFIG_H \
|
|
||||||
# -I$(LOCAL_PATH)/libev/ \
|
|
||||||
# -I$(LOCAL_PATH)/openssl/include
|
|
||||||
#
|
|
||||||
# LOCAL_STATIC_LIBRARIES := libev libcrypto
|
|
||||||
#
|
|
||||||
# LOCAL_LDLIBS := -llog
|
|
||||||
#
|
|
||||||
# include $(BUILD_EXECUTABLE)
|
|
||||||
|
|
||||||
########################################################
|
|
||||||
## shadowsocks tunnel library
|
|
||||||
########################################################
|
|
||||||
|
|
||||||
include $(CLEAR_VARS)
|
include $(CLEAR_VARS)
|
||||||
|
|
||||||
SHADOWSOCKS_SOURCES := tunnel.c cache.c udprelay.c encrypt.c utils.c json.c jconf.c
|
SHADOWSOCKS_SOURCES := tunnel.c cache.c udprelay.c encrypt.c utils.c json.c jconf.c
|
||||||
|
|
||||||
LOCAL_MODULE := ss-tunnel-jni
|
LOCAL_MODULE := ss-tunnel
|
||||||
LOCAL_SRC_FILES := $(addprefix shadowsocks/src/, $(SHADOWSOCKS_SOURCES)) main-jni.cpp
|
LOCAL_SRC_FILES := $(addprefix shadowsocks/src/, $(SHADOWSOCKS_SOURCES))
|
||||||
LOCAL_CFLAGS := -Wall -O2 -fno-strict-aliasing -DUDPRELAY_LOCAL -DUDPRELAY_TUNNEL \
|
LOCAL_CFLAGS := -Wall -O2 -fno-strict-aliasing -DUDPRELAY_LOCAL -DUDPRELAY_TUNNEL \
|
||||||
-DUSE_CRYPTO_OPENSSL -DANDROID -DHAVE_CONFIG_H -DSSTUNNEL_JNI \
|
-DUSE_CRYPTO_OPENSSL -DANDROID -DHAVE_CONFIG_H -DSSTUNNEL_JNI \
|
||||||
-I$(LOCAL_PATH)/libev/ \
|
-I$(LOCAL_PATH)/libev/ \
|
||||||
@@ -219,7 +184,7 @@ LOCAL_STATIC_LIBRARIES := libev libcrypto
|
|||||||
|
|
||||||
LOCAL_LDLIBS := -llog
|
LOCAL_LDLIBS := -llog
|
||||||
|
|
||||||
include $(BUILD_SHARED_LIBRARY)
|
include $(BUILD_EXECUTABLE)
|
||||||
|
|
||||||
########################################################
|
########################################################
|
||||||
## system
|
## system
|
||||||
@@ -239,7 +204,7 @@ LOCAL_STATIC_LIBRARIES := cpufeatures
|
|||||||
include $(BUILD_SHARED_LIBRARY)
|
include $(BUILD_SHARED_LIBRARY)
|
||||||
|
|
||||||
########################################################
|
########################################################
|
||||||
## tun2socks-library
|
## tun2socks
|
||||||
########################################################
|
########################################################
|
||||||
|
|
||||||
include $(CLEAR_VARS)
|
include $(CLEAR_VARS)
|
||||||
@@ -249,7 +214,7 @@ LOCAL_CFLAGS += -DBADVPN_THREADWORK_USE_PTHREAD -DBADVPN_LINUX -DBADVPN_BREACTOR
|
|||||||
LOCAL_CFLAGS += -DBADVPN_USE_SELFPIPE -DBADVPN_USE_EPOLL
|
LOCAL_CFLAGS += -DBADVPN_USE_SELFPIPE -DBADVPN_USE_EPOLL
|
||||||
LOCAL_CFLAGS += -DBADVPN_LITTLE_ENDIAN -DBADVPN_THREAD_SAFE
|
LOCAL_CFLAGS += -DBADVPN_LITTLE_ENDIAN -DBADVPN_THREAD_SAFE
|
||||||
LOCAL_CFLAGS += -DNDEBUG -DANDROID
|
LOCAL_CFLAGS += -DNDEBUG -DANDROID
|
||||||
LOCAL_CFLAGS += -DTUN2SOCKS_JNI
|
# LOCAL_CFLAGS += -DTUN2SOCKS_JNI
|
||||||
|
|
||||||
LOCAL_C_INCLUDES:= \
|
LOCAL_C_INCLUDES:= \
|
||||||
$(LOCAL_PATH)/badvpn/lwip/src/include/ipv4 \
|
$(LOCAL_PATH)/badvpn/lwip/src/include/ipv4 \
|
||||||
@@ -319,13 +284,13 @@ TUN2SOCKS_SOURCES := \
|
|||||||
tun2socks/SocksUdpGwClient.c \
|
tun2socks/SocksUdpGwClient.c \
|
||||||
udpgw_client/UdpGwClient.c
|
udpgw_client/UdpGwClient.c
|
||||||
|
|
||||||
LOCAL_MODULE := tun2socks-jni
|
LOCAL_MODULE := tun2socks
|
||||||
|
|
||||||
LOCAL_LDLIBS := -ldl -llog
|
LOCAL_LDLIBS := -ldl -llog
|
||||||
|
|
||||||
LOCAL_SRC_FILES := $(addprefix badvpn/, $(TUN2SOCKS_SOURCES)) main-jni.cpp
|
LOCAL_SRC_FILES := $(addprefix badvpn/, $(TUN2SOCKS_SOURCES))
|
||||||
|
|
||||||
include $(BUILD_SHARED_LIBRARY)
|
include $(BUILD_EXECUTABLE)
|
||||||
|
|
||||||
# OpenSSL
|
# OpenSSL
|
||||||
openssl_subdirs := $(addprefix $(LOCAL_PATH)/openssl/,$(addsuffix /Android.mk, \
|
openssl_subdirs := $(addprefix $(LOCAL_PATH)/openssl/,$(addsuffix /Android.mk, \
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
APP_ABI := armeabi-v7a x86
|
APP_ABI := armeabi-v7a x86
|
||||||
APP_PLATFORM := android-16
|
APP_PLATFORM := android-16
|
||||||
APP_STL := stlport_static
|
APP_STL := stlport_static
|
||||||
NDK_TOOLCHAIN_VERSION := 4.8
|
NDK_TOOLCHAIN_VERSION := 4.9
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user