Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
712b764a9b | ||
|
|
019f9d30e8 | ||
|
|
26b68876f4 | ||
|
|
a494f56ce8 | ||
|
|
a433822d0a | ||
|
|
60d7d90565 | ||
|
|
d2ba9493c0 | ||
|
|
0eaece7af9 |
+1
-1
@@ -5,7 +5,7 @@ jdk:
|
||||
|
||||
env:
|
||||
global:
|
||||
- NDK_VERSION=r12b
|
||||
- NDK_VERSION=r14
|
||||
- NDK_CCACHE=ccache
|
||||
- GOROOT_BOOTSTRAP=$GOROOT
|
||||
- ANDROID_NDK_HOME=$HOME/.android/android-ndk-${NDK_VERSION}
|
||||
|
||||
@@ -12,15 +12,17 @@ A [shadowsocks](http://shadowsocks.org) client for Android, written in Scala.
|
||||
|
||||
* JDK 1.8
|
||||
* SBT 0.13.0+
|
||||
* Go 1.4+
|
||||
* Android SDK
|
||||
- Build Tools 25+
|
||||
- Android Support Repository and Google Repository (see `build.sbt` for version)
|
||||
* Android NDK r12b+
|
||||
* Android NDK r14+
|
||||
|
||||
### BUILD
|
||||
|
||||
* Set environment variable `ANDROID_HOME` to `/path/to/android-sdk`
|
||||
* Set environment variable `ANDROID_NDK_HOME` to `/path/to/android-ndk`
|
||||
* (optional) Set environment variable `ANDROID_NDK_HOME` to `/path/to/android-ndk` (default: `$ANDROID_HOME/ndk-bundle`)
|
||||
* 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 `mobile/local.properties` from `mobile/local.properties.example` with your own key information
|
||||
* Invoke the building like this
|
||||
@@ -29,7 +31,7 @@ A [shadowsocks](http://shadowsocks.org) client for Android, written in Scala.
|
||||
git submodule update --init --recursive
|
||||
|
||||
# Build the App
|
||||
sbt clean android:package-release
|
||||
sbt clean go-build android:package-release
|
||||
```
|
||||
|
||||
### TRANSLATE
|
||||
|
||||
+2
-2
@@ -2,8 +2,8 @@ enablePlugins(AndroidApp)
|
||||
android.useSupportVectors
|
||||
|
||||
name := "shadowsocks"
|
||||
version := "4.1.0"
|
||||
versionCode := Some(180)
|
||||
version := "4.1.2"
|
||||
versionCode := Some(182)
|
||||
|
||||
proguardOptions ++=
|
||||
"-keep class com.github.shadowsocks.JniHelper { *; }" ::
|
||||
|
||||
@@ -97,7 +97,7 @@ LIBEVENT_SOURCES := \
|
||||
|
||||
LOCAL_MODULE := event
|
||||
LOCAL_SRC_FILES := $(addprefix libevent/, $(LIBEVENT_SOURCES))
|
||||
LOCAL_CFLAGS := -O2 -I$(LOCAL_PATH)/libevent \
|
||||
LOCAL_CFLAGS := -O2 -D_EVENT_HAVE_ARC4RANDOM -I$(LOCAL_PATH)/libevent \
|
||||
-I$(LOCAL_PATH)/libevent/include \
|
||||
|
||||
include $(BUILD_STATIC_LIBRARY)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
APP_ABI := armeabi-v7a x86
|
||||
APP_ABI := armeabi-v7a arm64-v8a x86
|
||||
APP_PLATFORM := android-19
|
||||
APP_STL := stlport_static
|
||||
NDK_TOOLCHAIN_VERSION := clang
|
||||
|
||||
Submodule mobile/src/main/jni/shadowsocks-libev updated: 6a8adfb26f...de0cebb62e
@@ -135,9 +135,9 @@ trait BaseService extends Service {
|
||||
case Some(ip) => util.Arrays.asList(InetAddress.getByName(ip))
|
||||
case _ => Dns.SYSTEM.lookup(hostname)
|
||||
})
|
||||
.connectTimeout(5, TimeUnit.SECONDS)
|
||||
.writeTimeout(5, TimeUnit.SECONDS)
|
||||
.readTimeout(5, TimeUnit.SECONDS)
|
||||
.connectTimeout(10, TimeUnit.SECONDS)
|
||||
.writeTimeout(10, TimeUnit.SECONDS)
|
||||
.readTimeout(30, TimeUnit.SECONDS)
|
||||
.build()
|
||||
val requestBody = new FormBody.Builder()
|
||||
.add("sig", sig)
|
||||
@@ -330,18 +330,6 @@ trait BaseService extends Service {
|
||||
}
|
||||
|
||||
protected final def buildOvertureConfig(file: String): String = {
|
||||
val url = "http://icanhazip.com"
|
||||
val client = new OkHttpClient.Builder()
|
||||
.connectTimeout(10, TimeUnit.SECONDS)
|
||||
.writeTimeout(10, TimeUnit.SECONDS)
|
||||
.readTimeout(30, TimeUnit.SECONDS)
|
||||
.build()
|
||||
val request = new Request.Builder()
|
||||
.url(url)
|
||||
.build()
|
||||
val response = client.newCall(request).execute()
|
||||
val externalIp = if (response.isSuccessful) response.body.string.trim else ""
|
||||
|
||||
val config = new JSONObject()
|
||||
.put("BindAddress", ":" + (profile.localPort + 53))
|
||||
.put("RedirectIPv6Record", true)
|
||||
@@ -354,15 +342,11 @@ trait BaseService extends Service {
|
||||
.put("Name", name)
|
||||
.put("Address", address + ":53")
|
||||
.put("Timeout", 6)
|
||||
.put("EDNSClientSubnet", new JSONObject().put("Policy", "disable"))
|
||||
if (edns) dns
|
||||
.put("Protocol", "tcp")
|
||||
.put("Socks5Address", "127.0.0.1:" + profile.localPort)
|
||||
.put("EDNSClientSubnet", new JSONObject()
|
||||
.put("Policy", "auto")
|
||||
.put("ExternalIP", externalIp))
|
||||
else dns
|
||||
.put("Protocol", "udp")
|
||||
.put("EDNSClientSubnet", new JSONObject().put("Policy", "disable"))
|
||||
else dns.put("Protocol", "udp")
|
||||
dns
|
||||
}
|
||||
profile.route match {
|
||||
|
||||
@@ -28,14 +28,14 @@ object Parser {
|
||||
val TAG = "ShadowParser"
|
||||
private val pattern = "(?i)ss://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]".r
|
||||
private val userInfoPattern = "^(.+?):(.*)$".r
|
||||
private val legacyPattern = "^((.+?):(.*)@(.+?):(\\d+?))$".r
|
||||
private val legacyPattern = "^(.+?):(.*)@(.+?):(\\d+?)$".r
|
||||
|
||||
def findAll(data: CharSequence): Iterator[Profile] =
|
||||
pattern.findAllMatchIn(if (data == null) "" else data).map(m => {
|
||||
val uri = Uri.parse(m.matched)
|
||||
uri.getUserInfo match {
|
||||
case null => new String(Base64.decode(uri.getHost, Base64.NO_PADDING), "UTF-8") match {
|
||||
case legacyPattern(_, method, password, host, port) => // legacy uri
|
||||
case null => val str = new String(Base64.decode(uri.getHost, Base64.NO_PADDING), "UTF-8"); str match {
|
||||
case legacyPattern(method, password, host, port) => // legacy uri
|
||||
val profile = new Profile
|
||||
profile.method = method.toLowerCase
|
||||
profile.password = password
|
||||
|
||||
+1
-1
Submodule mobile/src/overture updated: 5cb3f8c9e1...862ce347e1
Reference in New Issue
Block a user