Compare commits

...
20 Commits
Author SHA1 Message Date
Max Lv 6c1ae68931 update shadowsocks-libev 2015-01-27 21:00:25 +08:00
Max Lv 2703e91bbe bump version 2015-01-27 17:52:06 +08:00
Max Lv 8fba319db2 fix #228 2015-01-25 13:18:42 +08:00
Max Lv 3e04734b9b update shadowsocks-libev 2015-01-21 20:55:35 +08:00
Max Lv fe33997494 update shadowsocks-libev 2015-01-19 12:08:34 +08:00
Max Lv 86cd49d3e1 update shadowsocks-libev 2015-01-16 13:16:07 +08:00
Max Lv ff13792192 update strings 2015-01-16 13:11:51 +08:00
Max Lv f36a8c784d update shadowsocks-libev 2015-01-13 14:44:58 +08:00
Max Lv 57f8c0f307 disable notification auto-hiding on Kitkat and below #216 2015-01-11 21:26:59 +08:00
Max Lv 601c227644 update shadowsocks-libev 2015-01-08 12:14:54 +08:00
Max Lv 220143aee1 fix #211 2015-01-08 10:44:54 +08:00
Max Lv 81a19c4a81 bump version 2015-01-02 14:16:21 +08:00
Max Lv 27cc53baf8 revert to tcp_only mode 2014-12-28 21:47:43 +08:00
Max Lv 935fddcb15 update submodule 2014-12-28 10:05:12 +08:00
Max Lv 49458080a1 bump version 2014-12-28 09:50:11 +08:00
Max Lv 8101fc935e update shadowsocks 2014-12-27 19:55:33 +08:00
Max Lv 491ebe500f remove https dns query 2014-12-27 08:49:08 +08:00
Max Lv 98ce68774a update black list 2014-12-26 22:08:20 +08:00
Max Lv b0e20552dd refine list 2014-12-26 20:02:26 +08:00
Max Lv 0d478cfbc4 refine reject list 2014-12-26 17:54:35 +08:00
13 changed files with 9377 additions and 9767 deletions
+3 -3
View File
@@ -1,3 +1,3 @@
[submodule "src/main/jni/shadowsocks"]
path = src/main/jni/shadowsocks
url = https://github.com/madeye/shadowsocks-libev
[submodule "src/main/jni/shadowsocks-libev"]
path = src/main/jni/shadowsocks-libev
url = https://github.com/shadowsocks/shadowsocks-libev
+2 -2
View File
@@ -1,7 +1,7 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.github.shadowsocks"
android:versionCode="98"
android:versionName="2.6.0">
android:versionCode="102"
android:versionName="2.6.4">
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
+44 -22
View File
@@ -61,8 +61,8 @@ SODIUM_SOURCE := $(crypto_aead_src) $(crypto_auth_src) $(crypto_box_src) \
$(crypto_stream_src) $(crypto_verify_src) $(randombytes_src) $(sodium_src)
LOCAL_MODULE := sodium
LOCAL_CFLAGS += -O2 -I$(LOCAL_PATH)/shadowsocks/libsodium/src/libsodium/include \
-I$(LOCAL_PATH)/shadowsocks/libsodium/src/libsodium/include/sodium \
LOCAL_CFLAGS += -O2 -I$(LOCAL_PATH)/shadowsocks-libev/libsodium/src/libsodium/include \
-I$(LOCAL_PATH)/shadowsocks-libev/libsodium/src/libsodium/include/sodium \
-DPACKAGE_NAME=\"libsodium\" -DPACKAGE_TARNAME=\"libsodium\" \
-DPACKAGE_VERSION=\"1.0.1\" -DPACKAGE_STRING=\"libsodium\ 1.0.1\" \
-DPACKAGE_BUGREPORT=\"https://github.com/jedisct1/libsodium/issues\" \
@@ -79,7 +79,7 @@ LOCAL_CFLAGS += -O2 -I$(LOCAL_PATH)/shadowsocks/libsodium/src/libsodium/include
-DHAVE_WEAK_SYMBOLS=1 -DHAVE_ARC4RANDOM=1 -DHAVE_ARC4RANDOM_BUF=1 \
-DHAVE_MLOCK=1 -DHAVE_MPROTECT=1 -DHAVE_POSIX_MEMALIGN=1
LOCAL_SRC_FILES := $(addprefix shadowsocks/libsodium/src/libsodium/,$(SODIUM_SOURCE))
LOCAL_SRC_FILES := $(addprefix shadowsocks-libev/libsodium/src/libsodium/,$(SODIUM_SOURCE))
include $(BUILD_STATIC_LIBRARY)
@@ -126,10 +126,10 @@ set_src = set/allocation.c set/inspection.c set/ipv4_set.c set/ipv6_set.c \
IPSET_SOURCE := general.c $(bdd_src) $(map_src) $(set_src)
LOCAL_MODULE := libipset
LOCAL_CFLAGS += -O2 -I$(LOCAL_PATH)/shadowsocks/libipset/include \
-I$(LOCAL_PATH)/shadowsocks/libcork/include
LOCAL_CFLAGS += -O2 -I$(LOCAL_PATH)/shadowsocks-libev/libipset/include \
-I$(LOCAL_PATH)/shadowsocks-libev/libcork/include
LOCAL_SRC_FILES := $(addprefix shadowsocks/libipset/,$(IPSET_SOURCE))
LOCAL_SRC_FILES := $(addprefix shadowsocks-libev/libipset/,$(IPSET_SOURCE))
include $(BUILD_STATIC_LIBRARY)
@@ -153,10 +153,29 @@ pthreads_src := pthreads/thread.c
CORK_SOURCE := $(cli_src) $(core_src) $(ds_src) $(posix_src) $(pthreads_src)
LOCAL_MODULE := libcork
LOCAL_CFLAGS += -O2 -I$(LOCAL_PATH)/shadowsocks/libcork/include \
LOCAL_CFLAGS += -O2 -I$(LOCAL_PATH)/shadowsocks-libev/libcork/include \
-DCORK_API=CORK_LOCAL
LOCAL_SRC_FILES := $(addprefix shadowsocks/libcork/,$(CORK_SOURCE))
LOCAL_SRC_FILES := $(addprefix shadowsocks-libev/libcork/,$(CORK_SOURCE))
include $(BUILD_STATIC_LIBRARY)
########################################################
## libudns
########################################################
include $(CLEAR_VARS)
UDNS_SOURCES := udns_dn.c udns_dntosp.c udns_parse.c udns_resolver.c udns_init.c \
udns_misc.c udns_XtoX.c \
udns_rr_a.c udns_rr_ptr.c udns_rr_mx.c udns_rr_txt.c udns_bl.c \
udns_rr_srv.c udns_rr_naptr.c udns_codes.c udns_jran.c
LOCAL_MODULE := libudns
LOCAL_CFLAGS += -O2 -I$(LOCAL_PATH)/shadowsocks-libev/libudns \
-DHAVE_DECL_INET_NTOP
LOCAL_SRC_FILES := $(addprefix shadowsocks-libev/libudns/,$(UDNS_SOURCES))
include $(BUILD_STATIC_LIBRARY)
@@ -210,48 +229,51 @@ LOCAL_CFLAGS := -Wall -O2 -I$(LOCAL_PATH)/pdnsd
include $(BUILD_EXECUTABLE)
########################################################
## shadowsocks local library
## shadowsocks-libev local library
########################################################
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 netutils.c json.c jconf.c acl.c
LOCAL_MODULE := ss-local
LOCAL_SRC_FILES := $(addprefix shadowsocks/src/, $(SHADOWSOCKS_SOURCES))
LOCAL_SRC_FILES := $(addprefix shadowsocks-libev/src/, $(SHADOWSOCKS_SOURCES))
LOCAL_CFLAGS := -Wall -O2 -fno-strict-aliasing -DUDPRELAY_LOCAL \
-DUSE_CRYPTO_OPENSSL -DANDROID -DHAVE_CONFIG_H \
-I$(LOCAL_PATH)/libev/ \
-I$(LOCAL_PATH)/openssl/include \
-I$(LOCAL_PATH)/shadowsocks/libcork/include \
-I$(LOCAL_PATH)/shadowsocks/libsodium/src/libsodium/include \
-I$(LOCAL_PATH)/shadowsocks/libsodium/src/libsodium/include/sodium \
-I$(LOCAL_PATH)/shadowsocks/libipset/include
-I$(LOCAL_PATH)/shadowsocks-libev/libudns \
-I$(LOCAL_PATH)/shadowsocks-libev/libcork/include \
-I$(LOCAL_PATH)/shadowsocks-libev/libsodium/src/libsodium/include \
-I$(LOCAL_PATH)/shadowsocks-libev/libsodium/src/libsodium/include/sodium \
-I$(LOCAL_PATH)/shadowsocks-libev/libipset/include
LOCAL_STATIC_LIBRARIES := libev libcrypto libipset libcork libsodium
LOCAL_STATIC_LIBRARIES := libev libcrypto libipset libcork libudns libsodium
LOCAL_LDLIBS := -llog
include $(BUILD_EXECUTABLE)
########################################################
## shadowsocks tunnel
## shadowsocks-libev tunnel
########################################################
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 netutils.c json.c jconf.c
LOCAL_MODULE := ss-tunnel
LOCAL_SRC_FILES := $(addprefix shadowsocks/src/, $(SHADOWSOCKS_SOURCES))
LOCAL_SRC_FILES := $(addprefix shadowsocks-libev/src/, $(SHADOWSOCKS_SOURCES))
LOCAL_CFLAGS := -Wall -O2 -fno-strict-aliasing -DUDPRELAY_LOCAL -DUDPRELAY_TUNNEL \
-DUSE_CRYPTO_OPENSSL -DANDROID -DHAVE_CONFIG_H -DSSTUNNEL_JNI \
-I$(LOCAL_PATH)/libev/ \
-I$(LOCAL_PATH)/shadowsocks/libsodium/src/libsodium/include \
-I$(LOCAL_PATH)/shadowsocks/libsodium/src/libsodium/include/sodium \
-I$(LOCAL_PATH)/shadowsocks-libev/libudns \
-I$(LOCAL_PATH)/shadowsocks-libev/libcork/include \
-I$(LOCAL_PATH)/shadowsocks-libev/libsodium/src/libsodium/include \
-I$(LOCAL_PATH)/shadowsocks-libev/libsodium/src/libsodium/include/sodium \
-I$(LOCAL_PATH)/openssl/include
LOCAL_STATIC_LIBRARIES := libev libcrypto libsodium
LOCAL_STATIC_LIBRARIES := libev libcrypto libsodium libcork libudns
LOCAL_LDLIBS := -llog
+4 -4
View File
@@ -10,13 +10,13 @@
<string name="profile">配置文件</string>
<string name="profile_summary">配置文件名称</string>
<string name="proxy">服务器</string>
<string name="proxy_summary">您的影梭服务器的地址</string>
<string name="proxy_summary">远程服务器的地址</string>
<string name="remote_port">远程端口</string>
<string name="remote_port_summary">您的影梭服务器的端口号</string>
<string name="remote_port_summary">远程服务器的端口号</string>
<string name="port">本地端口</string>
<string name="port_summary">您的影梭客户端的端口号</string>
<string name="port_summary">本地客户端的端口号</string>
<string name="sitekey">密码</string>
<string name="sitekey_summary">您的影梭服务器的密码</string>
<string name="sitekey_summary">远程服务器的密码</string>
<string name="enc_method">加密方法</string>
<string name="feature_cat">功能设置</string>
<string name="http_proxy">HTTP 代理服务器</string>
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
+4 -4
View File
@@ -14,13 +14,13 @@
<string name="profile">Profile</string>
<string name="profile_summary">Profile name</string>
<string name="proxy">Server</string>
<string name="proxy_summary">Hostname or IP Address of your Shadowsocks server</string>
<string name="proxy_summary">Hostname or IP of the remote server</string>
<string name="remote_port">Remote Port</string>
<string name="remote_port_summary">Port number of your Shadowsocks server</string>
<string name="remote_port_summary">Port number of the remote server</string>
<string name="port">Local Port</string>
<string name="port_summary">Port number of your Shadowsocks client</string>
<string name="port_summary">Port number of the local server</string>
<string name="sitekey">Password</string>
<string name="sitekey_summary">Password of your Shadowsocks server</string>
<string name="sitekey_summary">Password of the remote server</string>
<string name="enc_method">Encrypt Method</string>
<!-- feature category -->
@@ -265,7 +265,7 @@ class ShadowsocksNatService extends Service with BaseService {
val reject = ConfigUtils.getRejectList(getContext, application)
val blackList = ConfigUtils.getBlackList(getContext, application)
ConfigUtils.PDNSD_DIRECT.formatLocal(Locale.ENGLISH, "127.0.0.1", 8153,
Path.BASE + "pdnsd-nat.pid", reject, blackList, reject, blackList, 8163)
Path.BASE + "pdnsd-nat.pid", reject, blackList, 8163)
} else {
ConfigUtils.PDNSD_LOCAL.formatLocal(Locale.ENGLISH, "127.0.0.1", 8153,
Path.BASE + "pdnsd-nat.pid", 8163)
@@ -348,7 +348,7 @@ class ShadowsocksNatService extends Service with BaseService {
actionIntent)
if (visible)
builder.setPriority(NotificationCompat.PRIORITY_MAX)
builder.setPriority(NotificationCompat.PRIORITY_DEFAULT)
else
builder.setPriority(NotificationCompat.PRIORITY_MIN)
@@ -513,31 +513,33 @@ class ShadowsocksNatService extends Service with BaseService {
}
registerReceiver(closeReceiver, filter)
val screenFilter = new IntentFilter()
screenFilter.addAction(Intent.ACTION_SCREEN_ON)
screenFilter.addAction(Intent.ACTION_SCREEN_OFF)
screenFilter.addAction(Intent.ACTION_USER_PRESENT)
lockReceiver = new BroadcastReceiver() {
def onReceive(context: Context, intent: Intent) {
if (getState == State.CONNECTED) {
val action = intent.getAction
if (action == Intent.ACTION_SCREEN_OFF) {
notifyForegroundAlert(getString(R.string.forward_success),
getString(R.string.service_running).formatLocal(Locale.ENGLISH, config.profileName), false)
} else if (action == Intent.ACTION_SCREEN_ON) {
val keyGuard = getSystemService(Context.KEYGUARD_SERVICE).asInstanceOf[KeyguardManager]
if (!keyGuard.inKeyguardRestrictedInputMode) {
if (Utils.isLollipopOrAbove) {
val screenFilter = new IntentFilter()
screenFilter.addAction(Intent.ACTION_SCREEN_ON)
screenFilter.addAction(Intent.ACTION_SCREEN_OFF)
screenFilter.addAction(Intent.ACTION_USER_PRESENT)
lockReceiver = new BroadcastReceiver() {
def onReceive(context: Context, intent: Intent) {
if (getState == State.CONNECTED) {
val action = intent.getAction
if (action == Intent.ACTION_SCREEN_OFF) {
notifyForegroundAlert(getString(R.string.forward_success),
getString(R.string.service_running).formatLocal(Locale.ENGLISH, config.profileName), false)
} else if (action == Intent.ACTION_SCREEN_ON) {
val keyGuard = getSystemService(Context.KEYGUARD_SERVICE).asInstanceOf[KeyguardManager]
if (!keyGuard.inKeyguardRestrictedInputMode) {
notifyForegroundAlert(getString(R.string.forward_success),
getString(R.string.service_running).formatLocal(Locale.ENGLISH, config.profileName), true)
}
} else if (action == Intent.ACTION_USER_PRESENT) {
notifyForegroundAlert(getString(R.string.forward_success),
getString(R.string.service_running).formatLocal(Locale.ENGLISH, config.profileName), true)
}
} else if (action == Intent.ACTION_USER_PRESENT) {
notifyForegroundAlert(getString(R.string.forward_success),
getString(R.string.service_running).formatLocal(Locale.ENGLISH, config.profileName), true)
}
}
}
}
registerReceiver(lockReceiver, screenFilter)
}
registerReceiver(lockReceiver, screenFilter)
// send event
application.tracker.send(new HitBuilders.EventBuilder()
@@ -606,9 +608,12 @@ class ShadowsocksNatService extends Service with BaseService {
unregisterReceiver(closeReceiver)
closeReceiver = null
}
if (lockReceiver != null) {
unregisterReceiver(lockReceiver)
lockReceiver = null
if (Utils.isLollipopOrAbove) {
if (lockReceiver != null) {
unregisterReceiver(lockReceiver)
lockReceiver = null
}
}
// send event
@@ -157,7 +157,7 @@ class ShadowsocksVpnService extends VpnService with BaseService {
val reject = ConfigUtils.getRejectList(getContext, application)
val blackList = ConfigUtils.getBlackList(getContext, application)
ConfigUtils.PDNSD_DIRECT.formatLocal(Locale.ENGLISH, "0.0.0.0", 8153,
Path.BASE + "pdnsd-vpn.pid", reject, blackList, reject, blackList, 8163)
Path.BASE + "pdnsd-vpn.pid", reject, blackList, 8163)
} else {
ConfigUtils.PDNSD_LOCAL.formatLocal(Locale.ENGLISH, "0.0.0.0", 8153,
Path.BASE + "pdnsd-vpn.pid", 8163)
@@ -145,7 +145,7 @@ object ConfigUtils {
| cache_dir = "/data/data/com.github.shadowsocks";
| server_ip = %s;
| server_port = %d;
| query_method = udp_tcp;
| query_method = tcp_only;
| run_ipv4 = on;
| min_ttl = 15m;
| max_ttl = 1w;
@@ -168,20 +168,6 @@ object ConfigUtils {
|}
|
|server {
| label= "secure";
| port = 443;
| ip = 208.67.220.220,113.20.8.17,77.66.84.233,176.56.237.171;
| timeout = 3;
| reject = %s;
| reject_policy = fail;
| reject_recursively = on;
| exclude = %s;
| policy = included;
| uptest = none;
| preset = on;
|}
|
|server {
| label = "local-server";
| ip = 127.0.0.1;
| port = %d;
@@ -52,17 +52,21 @@ object Parser {
if (uri.getScheme == Scheme.SS) {
val encoded = data.replace(Scheme.SS + "://", "")
val content = new String(Base64.decode(encoded, Base64.NO_PADDING), "UTF-8")
val info = content.split('@')
val encinfo = info(0).split(':')
val serverinfo = info(1).split(':')
val methodIdx = content.indexOf(':')
val passwordIdx = content.lastIndexOf('@')
val hostIdx = content.lastIndexOf(':')
val method = content.substring(0, methodIdx)
val password = content.substring(methodIdx + 1, passwordIdx)
val host = content.substring(passwordIdx + 1, hostIdx)
val port = content.substring(hostIdx + 1)
val profile = new Profile
profile.name = serverinfo(0)
profile.host = serverinfo(0)
profile.remotePort = serverinfo(1).toInt
profile.name = host
profile.host = host
profile.remotePort = port.toInt
profile.localPort = 1080
profile.method = encinfo(0)
profile.password = encinfo(1)
profile.method = method
profile.password = password
return Some(profile)
}
} catch {