Skip to content

Commit

Permalink
Merge remote-tracking branch 'shadowsocks/master' into noad
Browse files Browse the repository at this point in the history
  • Loading branch information
kaneawk committed Feb 26, 2017
2 parents a8c37f8 + c920c0d commit ce80562
Show file tree
Hide file tree
Showing 8 changed files with 38 additions and 20 deletions.
12 changes: 6 additions & 6 deletions mobile/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ enablePlugins(AndroidApp)
android.useSupportVectors

name := "shadowsocks"
version := "4.0.3"
versionCode := Some(178)
version := "4.0.4"
versionCode := Some(179)

proguardOptions ++=
"-keep class com.github.shadowsocks.JniHelper { *; }" ::
Expand All @@ -15,20 +15,20 @@ proguardOptions ++=

resConfigs := Seq("ja", "ru", "zh-rCN", "zh-rTW")

val playServicesVersion = "10.0.1"
val playServicesVersion = "10.2.0"
resolvers += Resolver.jcenterRepo
libraryDependencies ++=
"com.futuremind.recyclerfastscroll" % "fastscroll" % "0.2.5" ::
"com.evernote" % "android-job" % "1.1.5" ::
"com.evernote" % "android-job" % "1.1.6" ::
"com.github.jorgecastilloprz" % "fabprogresscircle" % "1.01" ::
"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.6" ::
"com.mikepenz" % "fastadapter" % "2.1.7" ::
"com.mikepenz" % "iconics-core" % "2.8.2" ::
"com.mikepenz" % "materialdrawer" % "5.8.1" ::
"com.mikepenz" % "materialize" % "1.0.0" ::
"com.mikepenz" % "materialize" % "1.0.1" ::
"com.squareup.okhttp3" % "okhttp" % "3.6.0" ::
"com.twofortyfouram" % "android-plugin-api-for-locale" % "1.0.2" ::
"dnsjava" % "dnsjava" % "2.1.8" ::
Expand Down
2 changes: 1 addition & 1 deletion mobile/src/main/assets/pages/about.html
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@
<body>
<p>A <a href="http://shadowsocks.org">Shadowsocks</a> client for Android, written in Scala.</p>
<p>Copyright (C) 2017 by Max Lv <a href="&#x6d;&#97;&#x69;&#108;&#116;&#111;&#x3a;&#x6d;&#97;x&#46;&#99;.&#108;&#118;&#x40;&#103;&#109;&#97;&#x69;&#108;&#46;&#x63;&#x6f;&#109;">&#x6d;&#97;&#x78;.&#x63;&#x2e;&#108;v&#64;&#x67;&#109;&#x61;&#x69;&#108;&#x2e;&#99;&#111;&#109;</a></p>
<p>Copyright (C) 2017 by Mygod Studio <a href="[email protected]">[email protected]</a></p>
<p>Copyright (C) 2017 by Mygod Studio <a href="mailto:[email protected]">[email protected]</a></p>
<p>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
Expand Down
30 changes: 24 additions & 6 deletions mobile/src/main/jni/Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,22 @@ LOCAL_SRC_FILES := $(addprefix libancillary/, $(ANCILLARY_SOURCE))

include $(BUILD_STATIC_LIBRARY)

########################################################
## libbloom
########################################################

include $(CLEAR_VARS)

BLOOM_SOURCE := bloom.c murmur2/MurmurHash2.c

LOCAL_MODULE := libbloom
LOCAL_CFLAGS += -O2 -I$(LOCAL_PATH)/shadowsocks-libev/libbloom \
-I$(LOCAL_PATH)/shadowsocks-libev/libbloom/murmur2

LOCAL_SRC_FILES := $(addprefix shadowsocks-libev/libbloom/, $(BLOOM_SOURCE))

include $(BUILD_STATIC_LIBRARY)

########################################################
## libipset
########################################################
Expand Down Expand Up @@ -250,7 +266,7 @@ SHADOWSOCKS_SOURCES := local.c \
cache.c udprelay.c utils.c netutils.c json.c jconf.c \
acl.c http.c tls.c rule.c \
crypto.c aead.c stream.c base64.c \
plugin.c \
plugin.c ppbloom.c \
android.c

LOCAL_MODULE := ss-local
Expand All @@ -264,13 +280,14 @@ LOCAL_CFLAGS := -Wall -O2 -fno-strict-aliasing -DMODULE_LOCAL \
-I$(LOCAL_PATH)/mbedtls/include \
-I$(LOCAL_PATH)/pcre \
-I$(LOCAL_PATH)/libudns \
-I$(LOCAL_PATH)/shadowsocks-libev/libcork/include \
-I$(LOCAL_PATH)/libsodium/src/libsodium/include \
-I$(LOCAL_PATH)/libsodium/src/libsodium/include/sodium \
-I$(LOCAL_PATH)/shadowsocks-libev/libcork/include \
-I$(LOCAL_PATH)/shadowsocks-libev/libipset/include \
-I$(LOCAL_PATH)/shadowsocks-libev/libbloom \
-I$(LOCAL_PATH)/libev

LOCAL_STATIC_LIBRARIES := libev libmbedtls libipset libcork libudns \
LOCAL_STATIC_LIBRARIES := libev libmbedtls libipset libcork libbloom libudns \
libsodium libancillary libpcre

LOCAL_LDLIBS := -llog
Expand All @@ -286,7 +303,7 @@ include $(CLEAR_VARS)
SHADOWSOCKS_SOURCES := tunnel.c \
cache.c udprelay.c utils.c netutils.c json.c jconf.c \
crypto.c aead.c stream.c base64.c \
plugin.c \
plugin.c ppbloom.c \
android.c

LOCAL_MODULE := ss-tunnel
Expand All @@ -297,14 +314,15 @@ LOCAL_CFLAGS := -Wall -O2 -fno-strict-aliasing -DMODULE_TUNNEL \
-I$(LOCAL_PATH)/libancillary \
-I$(LOCAL_PATH)/include \
-I$(LOCAL_PATH)/libudns \
-I$(LOCAL_PATH)/shadowsocks-libev/libcork/include \
-I$(LOCAL_PATH)/libsodium/src/libsodium/include \
-I$(LOCAL_PATH)/libsodium/src/libsodium/include/sodium \
-I$(LOCAL_PATH)/mbedtls/include \
-I$(LOCAL_PATH)/libev \
-I$(LOCAL_PATH)/shadowsocks-libev/libcork/include \
-I$(LOCAL_PATH)/shadowsocks-libev/libbloom \
-I$(LOCAL_PATH)/include/shadowsocks-libev

LOCAL_STATIC_LIBRARIES := libev libmbedtls libsodium libcork libudns libancillary
LOCAL_STATIC_LIBRARIES := libev libmbedtls libsodium libcork libbloom libudns libancillary

LOCAL_LDLIBS := -llog

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ class ShadowsocksNatService extends BaseService {
"-t", "10",
"-b", "127.0.0.1",
"-l", (profile.localPort + 63).toString,
"-L", profile.remoteDns + ":53",
"-L", profile.remoteDns.trim + ":53",
"-c", buildShadowsocksConfig("ss-tunnel-nat.conf"))

if (profile.udpdns) cmd.append("-u")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ class ShadowsocksVpnService extends VpnService with BaseService {
"-t", "10",
"-b", "127.0.0.1",
"-l", (profile.localPort + 63).toString,
"-L" , profile.remoteDns + ":53",
"-L" , profile.remoteDns.trim + ":53",
"-c", buildShadowsocksConfig("ss-tunnel-vpn.conf")).start()

def startDnsDaemon() {
Expand Down Expand Up @@ -219,7 +219,7 @@ class ShadowsocksVpnService extends VpnService with BaseService {
.setMtu(VPN_MTU)
.addAddress(PRIVATE_VLAN.formatLocal(Locale.ENGLISH, "1"), 24)

builder.addDnsServer(profile.remoteDns)
builder.addDnsServer(profile.remoteDns.trim)

if (profile.ipv6) {
builder.addAddress(PRIVATE_VLAN6.formatLocal(Locale.ENGLISH, "1"), 126)
Expand Down Expand Up @@ -251,7 +251,7 @@ class ShadowsocksVpnService extends VpnService with BaseService {
val subnet = Subnet.fromString(cidr)
builder.addRoute(subnet.address.getHostAddress, subnet.prefixSize)
})
builder.addRoute(profile.remoteDns, 32)
builder.addRoute(profile.remoteDns.trim, 32)
}

conn = builder.establish()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import com.github.shadowsocks.database.Profile

object Parser {
val TAG = "ShadowParser"
private val pattern = "(?i)^ss://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]$".r
private val pattern = "(?i)ss://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]".r
private val userInfoPattern = "^(.+?):(.*)$".r
private val legacyPattern = "^((.+?):(.*)@(.+?):(\\d+?))$".r

Expand Down
2 changes: 1 addition & 1 deletion project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
addSbtPlugin("org.scala-android" % "sbt-android" % "1.7.4")
addSbtPlugin("org.scala-android" % "sbt-android" % "1.7.5")

addSbtPlugin("com.timushev.sbt" % "sbt-updates" % "0.1.10")

Expand Down

0 comments on commit ce80562

Please sign in to comment.