diff --git a/.gitmodules b/.gitmodules index 0e932ce4..400f847e 100644 --- a/.gitmodules +++ b/.gitmodules @@ -9,9 +9,6 @@ path = src/main/jni/libancillary url = https://github.com/shadowsocks/libancillary.git branch = shadowsocks-android -[submodule "src/main/jni/openssl"] - path = src/main/jni/openssl - url = https://github.com/shadowsocks/openssl-android.git [submodule "src/main/jni/libevent"] path = src/main/jni/libevent url = https://github.com/shadowsocks/libevent.git @@ -30,3 +27,6 @@ [submodule "kcptun/go"] path = kcptun/go url = https://github.com/shadowsocks/go +[submodule "src/main/jni/mbedtls"] + path = src/main/jni/mbedtls + url = https://github.com/shadowsocks/mbedtls diff --git a/src/main/AndroidManifest.xml b/src/main/AndroidManifest.xml index 0918a916..2b3b9a74 100644 --- a/src/main/AndroidManifest.xml +++ b/src/main/AndroidManifest.xml @@ -1,7 +1,7 @@ + android:versionCode="146" + android:versionName="3.0.4"> diff --git a/src/main/jni/Android.mk b/src/main/jni/Android.mk index 247a43c3..a845dc4f 100755 --- a/src/main/jni/Android.mk +++ b/src/main/jni/Android.mk @@ -222,7 +222,7 @@ include $(CLEAR_VARS) LIBEVENT_SOURCES := \ buffer.c \ bufferevent.c bufferevent_filter.c \ - bufferevent_openssl.c bufferevent_pair.c bufferevent_ratelim.c \ + bufferevent_pair.c bufferevent_ratelim.c \ bufferevent_sock.c epoll.c \ epoll_sub.c evdns.c event.c \ event_tagging.c evmap.c \ @@ -236,7 +236,6 @@ LOCAL_MODULE := event LOCAL_SRC_FILES := $(addprefix libevent/, $(LIBEVENT_SOURCES)) LOCAL_CFLAGS := -O2 -I$(LOCAL_PATH)/libevent \ -I$(LOCAL_PATH)/libevent/include \ - -I$(LOCAL_PATH)/openssl/include include $(BUILD_STATIC_LIBRARY) @@ -387,11 +386,11 @@ SHADOWSOCKS_SOURCES := local.c cache.c udprelay.c encrypt.c utils.c netutils.c j LOCAL_MODULE := ss-local LOCAL_SRC_FILES := $(addprefix shadowsocks-libev/src/, $(SHADOWSOCKS_SOURCES)) LOCAL_CFLAGS := -Wall -O2 -fno-strict-aliasing -DMODULE_LOCAL \ - -DUSE_CRYPTO_OPENSSL -DANDROID -DHAVE_CONFIG_H \ + -DUSE_CRYPTO_MBEDTLS -DANDROID -DHAVE_CONFIG_H \ -DCONNECT_IN_PROGRESS=EINPROGRESS \ -I$(LOCAL_PATH)/include \ -I$(LOCAL_PATH)/libancillary \ - -I$(LOCAL_PATH)/openssl/include \ + -I$(LOCAL_PATH)/mbedtls/include \ -I$(LOCAL_PATH)/shadowsocks-libev/libudns \ -I$(LOCAL_PATH)/shadowsocks-libev/libcork/include \ -I$(LOCAL_PATH)/shadowsocks-libev/libsodium/src/libsodium/include \ @@ -400,7 +399,7 @@ LOCAL_CFLAGS := -Wall -O2 -fno-strict-aliasing -DMODULE_LOCAL \ -I$(LOCAL_PATH)/shadowsocks-libev/libev \ -I$(LOCAL_PATH)/include/shadowsocks-libev -LOCAL_STATIC_LIBRARIES := libev libcrypto libipset libcork libudns libsodium libancillary +LOCAL_STATIC_LIBRARIES := libev libmbedtls libipset libcork libudns libsodium libancillary LOCAL_LDLIBS := -llog @@ -417,7 +416,7 @@ SHADOWSOCKS_SOURCES := tunnel.c cache.c udprelay.c encrypt.c utils.c netutils.c LOCAL_MODULE := ss-tunnel LOCAL_SRC_FILES := $(addprefix shadowsocks-libev/src/, $(SHADOWSOCKS_SOURCES)) LOCAL_CFLAGS := -Wall -O2 -fno-strict-aliasing -DMODULE_TUNNEL \ - -DUSE_CRYPTO_OPENSSL -DANDROID -DHAVE_CONFIG_H -DSSTUNNEL_JNI \ + -DUSE_CRYPTO_MBEDTLS -DANDROID -DHAVE_CONFIG_H -DSSTUNNEL_JNI \ -DCONNECT_IN_PROGRESS=EINPROGRESS \ -I$(LOCAL_PATH)/libancillary \ -I$(LOCAL_PATH)/include \ @@ -425,11 +424,11 @@ LOCAL_CFLAGS := -Wall -O2 -fno-strict-aliasing -DMODULE_TUNNEL \ -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 \ + -I$(LOCAL_PATH)/mbedtls/include \ -I$(LOCAL_PATH)/shadowsocks-libev/libev \ -I$(LOCAL_PATH)/include/shadowsocks-libev -LOCAL_STATIC_LIBRARIES := libev libcrypto libsodium libcork libudns libancillary +LOCAL_STATIC_LIBRARIES := libev libmbedtls libsodium libcork libudns libancillary LOCAL_LDLIBS := -llog @@ -546,12 +545,23 @@ LOCAL_SRC_FILES := $(addprefix badvpn/, $(TUN2SOCKS_SOURCES)) include $(BUILD_EXECUTABLE) -# OpenSSL -openssl_subdirs := $(addprefix $(LOCAL_PATH)/openssl/,$(addsuffix /Android.mk, \ - crypto \ - ssl \ - )) -include $(openssl_subdirs) +######################################################## +## mbed TLS +######################################################## + +include $(CLEAR_VARS) + +LOCAL_MODULE:= mbedtls + +LOCAL_C_INCLUDES:= $(LOCAL_PATH)/mbedtls/include + +MBEDTLS_SOURCES := $(wildcard $(LOCAL_PATH)/mbedtls/library/*.c) + +LOCAL_SRC_FILES := $(MBEDTLS_SOURCES:$(LOCAL_PATH)/%=%) + +LOCAL_LDLIBS := -ldl -llog + +include $(BUILD_STATIC_LIBRARY) # Import cpufeatures $(call import-module,android/cpufeatures) diff --git a/src/main/jni/include/shadowsocks-libev/config.h b/src/main/jni/include/shadowsocks-libev/config.h index 1d804a0a..8372373a 100644 --- a/src/main/jni/include/shadowsocks-libev/config.h +++ b/src/main/jni/include/shadowsocks-libev/config.h @@ -26,7 +26,7 @@ /* #undef HAVE_CCCRYPTORCREATEWITHMODE */ /* Define to 1 if you have the `clock_gettime' function. */ -#define HAVE_CLOCK_GETTIME 1 +/* #undef HAVE_CLOCK_GETTIME */ /* Define to 1 to use the syscall interface for clock_gettime */ /* #undef HAVE_CLOCK_SYSCALL */ @@ -42,13 +42,13 @@ #define HAVE_DLFCN_H 1 /* Define to 1 if you have the `epoll_ctl' function. */ -#define HAVE_EPOLL_CTL 1 +/* #undef HAVE_EPOLL_CTL */ /* Define to 1 if you have the `eventfd' function. */ -#define HAVE_EVENTFD 1 +/* #undef HAVE_EVENTFD */ /* Define to 1 if you have the `EVP_EncryptInit_ex' function. */ -#define HAVE_EVP_ENCRYPTINIT_EX 1 +/* #undef HAVE_EVP_ENCRYPTINIT_EX */ /* Define to 1 if you have the header file. */ #define HAVE_FCNTL_H 1 @@ -66,7 +66,7 @@ /* #undef HAVE_INET_NTOP */ /* Define to 1 if you have the `inotify_init' function. */ -#define HAVE_INOTIFY_INIT 1 +/* #undef HAVE_INOTIFY_INIT */ /* Define to 1 if you have the header file. */ #define HAVE_INTTYPES_H 1 @@ -75,7 +75,7 @@ #define HAVE_IPv6 1 /* Define to 1 if you have the `kqueue' function. */ -/* #undef HAVE_KQUEUE */ +#define HAVE_KQUEUE 1 /* Define to 1 if you have the header file. */ #define HAVE_LANGINFO_H 1 @@ -90,14 +90,14 @@ #define HAVE_LIMITS_H 1 /* Define to 1 if you have the header file. */ -#define HAVE_LINUX_IF_H 1 +/* #undef HAVE_LINUX_IF_H */ /* Define to 1 if you have the header file. */ -#define HAVE_LINUX_NETFILTER_IPV4_H 1 +/* #undef HAVE_LINUX_NETFILTER_IPV4_H */ /* Define to 1 if you have the header file. */ -#define HAVE_LINUX_NETFILTER_IPV6_IP6_TABLES_H 1 +/* #undef HAVE_LINUX_NETFILTER_IPV6_IP6_TABLES_H */ /* Define to 1 if you have the header file. */ #define HAVE_LOCALE_H 1 @@ -124,25 +124,25 @@ #define HAVE_NET_IF_H 1 /* Define to 1 if you have the header file. */ -#define HAVE_OPENSSL_ENGINE_H 1 +/* #undef HAVE_OPENSSL_ENGINE_H */ /* Define to 1 if you have the header file. */ -#define HAVE_OPENSSL_ERR_H 1 +/* #undef HAVE_OPENSSL_ERR_H */ /* Define to 1 if you have the header file. */ -#define HAVE_OPENSSL_EVP_H 1 +/* #undef HAVE_OPENSSL_EVP_H */ /* Define to 1 if you have the header file. */ -#define HAVE_OPENSSL_PEM_H 1 +/* #undef HAVE_OPENSSL_PEM_H */ /* Define to 1 if you have the header file. */ -#define HAVE_OPENSSL_RAND_H 1 +/* #undef HAVE_OPENSSL_RAND_H */ /* Define to 1 if you have the header file. */ -#define HAVE_OPENSSL_RSA_H 1 +/* #undef HAVE_OPENSSL_RSA_H */ /* Define to 1 if you have the header file. */ -#define HAVE_OPENSSL_SHA_H 1 +/* #undef HAVE_OPENSSL_SHA_H */ /* Define to 1 if you have the `poll' function. */ #define HAVE_POLL 1 @@ -160,13 +160,13 @@ #define HAVE_PTHREAD_PRIO_INHERIT 1 /* Define to 1 if you have the `RAND_pseudo_bytes' function. */ -#define HAVE_RAND_PSEUDO_BYTES 1 +/* #undef HAVE_RAND_PSEUDO_BYTES */ /* Define to 1 if you have the 'select' function. */ #define HAVE_SELECT 1 /* Define to 1 if you have the `setresuid' function. */ -#define HAVE_SETRESUID 1 +/* #undef HAVE_SETRESUID */ /* Define to 1 if you have the `setreuid' function. */ #define HAVE_SETREUID 1 @@ -175,7 +175,7 @@ #define HAVE_SETRLIMIT 1 /* Define to 1 if you have the `signalfd' function. */ -#define HAVE_SIGNALFD 1 +/* #undef HAVE_SIGNALFD */ /* Define to 1 if you have the `socket' function. */ #define HAVE_SOCKET 1 @@ -196,16 +196,16 @@ #define HAVE_STRING_H 1 /* Define to 1 if you have the header file. */ -#define HAVE_SYS_EPOLL_H 1 +/* #undef HAVE_SYS_EPOLL_H */ /* Define to 1 if you have the header file. */ -#define HAVE_SYS_EVENTFD_H 1 +/* #undef HAVE_SYS_EVENTFD_H */ /* Define to 1 if you have the header file. */ -/* #undef HAVE_SYS_EVENT_H */ +#define HAVE_SYS_EVENT_H 1 /* Define to 1 if you have the header file. */ -#define HAVE_SYS_INOTIFY_H 1 +/* #undef HAVE_SYS_INOTIFY_H */ /* Define to 1 if you have the header file. */ #define HAVE_SYS_IOCTL_H 1 @@ -214,7 +214,7 @@ #define HAVE_SYS_SELECT_H 1 /* Define to 1 if you have the header file. */ -#define HAVE_SYS_SIGNALFD_H 1 +/* #undef HAVE_SYS_SIGNALFD_H */ /* Define to 1 if you have the header file. */ #define HAVE_SYS_SOCKET_H 1 @@ -253,10 +253,10 @@ /* #undef HAVE_WS2TCPIP_H */ /* have zlib compression support */ -#define HAVE_ZLIB 1 +/* #undef HAVE_ZLIB */ /* Define to 1 if you have the header file. */ -#define HAVE_ZLIB_H 1 +/* #undef HAVE_ZLIB_H */ /* Define to the sub-directory in which libtool stores uninstalled libraries. */ @@ -275,7 +275,7 @@ #define PACKAGE_NAME "shadowsocks-libev" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "shadowsocks-libev 2.4.7" +#define PACKAGE_STRING "shadowsocks-libev 2.4.8" /* Define to the one symbol short name of this package. */ #define PACKAGE_TARNAME "shadowsocks-libev" @@ -284,7 +284,7 @@ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "2.4.7" +#define PACKAGE_VERSION "2.4.8" /* Define to necessary symbol if this constant uses a non-standard name on your system. */ @@ -315,10 +315,10 @@ /* #undef USE_CRYPTO_APPLECC */ /* Use mbed TLS library */ -/* #undef USE_CRYPTO_MBEDTLS */ +#define USE_CRYPTO_MBEDTLS 1 /* Use OpenSSL library */ -#define USE_CRYPTO_OPENSSL 1 +/* #undef USE_CRYPTO_OPENSSL */ /* Use PolarSSL library */ /* #undef USE_CRYPTO_POLARSSL */ @@ -346,7 +346,7 @@ /* Version number of package */ -#define VERSION "2.4.7" +#define VERSION "2.4.8" /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most significant byte first (like Motorola and SPARC, unlike Intel). */ diff --git a/src/main/jni/libevent b/src/main/jni/libevent index 574f6b81..5d5914f0 160000 --- a/src/main/jni/libevent +++ b/src/main/jni/libevent @@ -1 +1 @@ -Subproject commit 574f6b81c90883cc8e6174d4cf57c6feab28cdcd +Subproject commit 5d5914f00b8adefd383f66b8b352855ece22a1d7 diff --git a/src/main/jni/mbedtls b/src/main/jni/mbedtls new file mode 160000 index 00000000..1e4ec667 --- /dev/null +++ b/src/main/jni/mbedtls @@ -0,0 +1 @@ +Subproject commit 1e4ec667a4dd5f06ccc41d69cdef3e07f92fa242 diff --git a/src/main/jni/openssl b/src/main/jni/openssl deleted file mode 160000 index c51144d7..00000000 --- a/src/main/jni/openssl +++ /dev/null @@ -1 +0,0 @@ -Subproject commit c51144d76d0a0bbaf3117df6c0f1a97e11ebf661 diff --git a/src/main/res/values/arrays.xml b/src/main/res/values/arrays.xml index fd204a32..3ad46264 100644 --- a/src/main/res/values/arrays.xml +++ b/src/main/res/values/arrays.xml @@ -14,11 +14,6 @@ CAMELLIA-128-CFB CAMELLIA-192-CFB CAMELLIA-256-CFB - CAST5-CFB - DES-CFB - IDEA-CFB - RC2-CFB - SEED-CFB SALSA20 CHACHA20 CHACHA20-IETF @@ -38,11 +33,6 @@ camellia-128-cfb camellia-192-cfb camellia-256-cfb - cast5-cfb - des-cfb - idea-cfb - rc2-cfb - seed-cfb salsa20 chacha20 chacha20-ietf