Skip to content

Commit

Permalink
v4.35.1
Browse files Browse the repository at this point in the history
  • Loading branch information
cary-sas committed Jul 27, 2021
1 parent 1c75721 commit afa05bf
Show file tree
Hide file tree
Showing 25 changed files with 1,990 additions and 3,262 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,177 @@
#!/bin/bash

# cross & static compile shadowsocks-libev

export host=arm-uclibc-linux
export CC=arm-uclibc-linux-2.6.36-gcc
export CXX=arm-uclibc-linux-2.6.36-g++
export AR=arm-uclibc-linux-2.6.36-ar
export RANLIB=arm-uclibc-linux-2.6.36-ranlib

PCRE_VER=8.45
PCRE_FILE="https://ftp.pcre.org/pub/pcre/pcre-$PCRE_VER.tar.gz"

MBEDTLS_VER=2.16.6
MBEDTLS_FILE="https://tls.mbed.org/download/mbedtls-$MBEDTLS_VER-gpl.tgz"

LIBSODIUM_VER=1.0.18
LIBSODIUM_FILE="https://download.libsodium.org/libsodium/releases/libsodium-$LIBSODIUM_VER.tar.gz"

LIBEV_VER=4.33
LIBEV_FILE="http://dist.schmorp.de/libev/libev-$LIBEV_VER.tar.gz"

LIBC_ARES_VER=1.13.0
LIBC_ARES_FILE="https://c-ares.haxx.se/download/c-ares-$LIBC_ARES_VER.tar.gz"

SHADOWSOCKS_LIBEV_VER=3.3.5
SHADOWSOCKS_LIBEV_FILE="https://github.com/shadowsocks/shadowsocks-libev"

SIMPLE_OBFS_VER=0.0.4
SIMPLE_OBFS_FILE="https://github.com/shadowsocks/simple-obfs"

cur_dir=$(pwd)

prepare() {
rm -rf $cur_dir/build && mkdir $cur_dir/build
}

compile_pcre() {
[ -d $prefix/pcre ] && return

cd $cur_dir/build
wget $PCRE_FILE
tar xvf pcre-$PCRE_VER.tar.gz
cd pcre-$PCRE_VER
CPPFLAGS="-DNEED_PRINTF" ./configure --prefix=$prefix/pcre --host=$host --enable-jit --enable-utf8 --enable-unicode-properties --disable-shared
make -j$(getconf _NPROCESSORS_ONLN) && make install
}

compile_mbedtls() {
[ -d $prefix/mbedtls ] && return

cd $cur_dir/build
wget --no-check-certificate $MBEDTLS_FILE
tar xvf mbedtls-$MBEDTLS_VER-gpl.tgz
cd mbedtls-$MBEDTLS_VER
prefix_reg=$(echo $prefix | sed "s/\//\\\\\//g")
sed -i "s/DESTDIR=\/usr\/local/DESTDIR=$prefix_reg\/mbedtls/g" Makefile
[ -z $host ] && make install -j$(getconf _NPROCESSORS_ONLN) || CC=$CC AR=$AR make install -j$(getconf _NPROCESSORS_ONLN)
}

compile_libsodium() {
[ -d $prefix/libsodium ] && return

cd $cur_dir/build
wget --no-check-certificate $LIBSODIUM_FILE
tar xvf libsodium-$LIBSODIUM_VER.tar.gz
cd libsodium-$LIBSODIUM_VER
./configure --prefix=$prefix/libsodium --host=$host --disable-ssp --disable-shared
make -j$(getconf _NPROCESSORS_ONLN) && make install
ldconfig
}

compile_libev() {
[ -d $prefix/libev ] && return

cd $cur_dir/build
wget --no-check-certificate $LIBEV_FILE
tar xvf libev-$LIBEV_VER.tar.gz
cd libev-$LIBEV_VER
./configure --prefix=$prefix/libev --host=$host --disable-shared
make -j$(getconf _NPROCESSORS_ONLN) && make install
}

compile_libc_ares() {
[ -d $prefix/libc-ares ] && return

cd $cur_dir/build
wget --no-check-certificate $LIBC_ARES_FILE
tar xvf c-ares-$LIBC_ARES_VER.tar.gz
cd c-ares-$LIBC_ARES_VER
./configure --prefix=$prefix/libc-ares --host=$host --disable-shared
make -j$(getconf _NPROCESSORS_ONLN) && make install
}

compile_shadowsocks_libev() {
[ -f $prefix/shadowsocks-libev/bin/ss-local ] && return

cd $cur_dir/build
git clone --branch v$SHADOWSOCKS_LIBEV_VER --single-branch --depth 1 $SHADOWSOCKS_LIBEV_FILE
cd shadowsocks-libev
git submodule update --init --recursive
./autogen.sh
LIBS="-lpthread -lm" LDFLAGS="-Wl,-static -static-libgcc -L$prefix/libc-ares/lib -L$prefix/libev/lib" CFLAGS="-I$prefix/libc-ares/include -I$prefix/libev/include" ./configure --prefix=$prefix/shadowsocks-libev --host=$host --disable-ssp --disable-documentation --with-mbedtls=$prefix/mbedtls --with-pcre=$prefix/pcre --with-sodium=$prefix/libsodium
make -j$(getconf _NPROCESSORS_ONLN) && make install
}

compile_simple_obfs() {
[ -f $prefix/shadowsocks-libev/bin/obfs-local ] && return

cd $cur_dir/build
git clone --branch v$SIMPLE_OBFS_VER --single-branch --depth 1 $SIMPLE_OBFS_FILE
cd simple-obfs
git submodule update --init --recursive
./autogen.sh
LIBS="-lpthread -lm" LDFLAGS="-Wl,-static -static-libgcc -L$prefix/libc-ares/lib -L$prefix/libev/lib -L$prefix/libsodium/lib" CFLAGS="-I$prefix/libc-ares/include -I$prefix/libev/include -I$prefix/libsodium/include" ./configure --prefix=$prefix/shadowsocks-libev --host=$host --disable-ssp --disable-documentation
make -j$(getconf _NPROCESSORS_ONLN) && make install
}

clean() {
cd $cur_dir
rm -rf $cur_dir/build
}

while [ ! -z $1 ]; do
case $1 in
-h | --help)
echo "Useage: sh $0 [--host=<host>] [--prefix=<path>]"
echo ""
echo "Options:"
echo " --host=<host> the machine that you are building for"
echo " --prefix=<path> install architecture-independent files in prefix[$cur_dir/dists]"
exit 0
;;
--host)
shift
host=$1
;;
--host=*)
arr=(${1//=/ })
host=${arr[1]}
;;
--prefix)
shift
prefix=$1
;;
--prefix=*)
arr=(${1//=/ })
prefix=${arr[1]}
;;
esac
shift
done

red="\033[0;31m"
green="\033[0;32m"
plain="\033[0m"

[ -z $host ] && compiler=gcc || compiler=$CC
if [ -f "$(which $compiler)" ]; then
echo -e "found cross compiler ${green}$(which ${compiler})${plain}"
else
echo -e "${red}Error:${plain} not found cross compiler ${green}${compiler}${plain}"
exit -1
fi

[ -z $prefix ] && prefix=$cur_dir/dists
echo -e "binaries will be installed in ${green}${prefix}${plain}"
clean
prepare
compile_pcre
compile_mbedtls
compile_libsodium
compile_libev
compile_libc_ares
compile_shadowsocks_libev
#compile_simple_obfs
clean
Binary file added 380_armv5/shadowsocks-libev/v3.3.5/ss-local
Binary file not shown.
Binary file added 380_armv5/shadowsocks-libev/v3.3.5/ss-manager
Binary file not shown.
Binary file added 380_armv5/shadowsocks-libev/v3.3.5/ss-nat
Binary file not shown.
Binary file added 380_armv5/shadowsocks-libev/v3.3.5/ss-redir
Binary file not shown.
Binary file added 380_armv5/shadowsocks-libev/v3.3.5/ss-tunnel
Binary file not shown.
1 change: 1 addition & 0 deletions 380_armv5_packge/4.35.1/md5sum.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2957e4b8040a57052c5d35890e54d184
Binary file added 380_armv5_packge/4.35.1/shadowsocks.tar.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion 380_armv5_packge/latest.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.35.0
4.35.1
Binary file modified shadowsocks/bin/ss-local
Binary file not shown.
Binary file modified shadowsocks/bin/ss-redir
Binary file not shown.
Binary file modified shadowsocks/bin/ss-tunnel
Binary file not shown.
Binary file modified shadowsocks/bin/v2ray
Binary file not shown.
Binary file modified shadowsocks/bin/xray
Binary file not shown.
4 changes: 2 additions & 2 deletions shadowsocks/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -237,8 +237,8 @@ dbus set softcenter_module_shadowsocks_description="科学上网 for merlin armv
dbus set softcenter_module_shadowsocks_home_url="Main_Ss_Content.asp"

# 设置v2ray 版本号
dbus set ss_basic_v2ray_version=4.35.0
dbus set ss_basic_v2ray_date=20210513
dbus set ss_basic_v2ray_version=4.35.1
dbus set ss_basic_v2ray_date=20210727

echo_date 一点点清理工作...
rm -rf /tmp/shadowsocks* >/dev/null 2>&1
Expand Down
53 changes: 37 additions & 16 deletions shadowsocks/scripts/ss_online_update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,7 @@ get_ss_config(){
#v2ray plugin : simple obfs will not be supported anymore, v2ray plugin will replace it
# link format example
# plugin=v2ray;path=/s233;host=yes.herokuapp.com;tls
# plugin=V2ray-plugin;path=/s233;host=yes.herokuapp.com;tls#nodename4test

# 初始化
ss_v2ray_tmp="0"
Expand All @@ -304,10 +305,10 @@ get_ss_config(){


if [ -n "$(echo -n "$decode_link" | grep "?")" ];then
plugin=$(echo "$decode_link" |awk -F'?' '{print $2}')
plugin_type=$(echo "$plugin" | tr ';' '\n' | grep 'plugin=' | awk -F'=' '{print $2}')
plugin=$(echo "$decode_link" |awk -F'[?#]' '{print $2}')
plugin_type=$(echo "$plugin" | tr ';' '\n' | grep 'plugin=' | awk -F'=' '{print $2}' | tr '[A-Z]' '[a-z]')

if [ -n "$plugin" ] && [ "$plugin_type" == "v2ray" ];then
if [ -n "$plugin" ] && [ -z "${plugin_type##*v2ray*}" ] ;then
ss_v2ray_tmp="1"
ss_v2ray_opts_tmp="$(echo $plugin | cut -d";" -f2-)"
ss_v2ray_plugin_tmp="1"
Expand Down Expand Up @@ -951,6 +952,12 @@ add_vless_servers(){
# @@ 不确定这个变量是否需要添加
# [ -n "$v2ray_host" ] && dbus set ssconf_basic_v2ray_network_host_$v2rayindex=$v2ray_host
;;

kcp)
# kcp协议设置【 kcp伪装类型 (type)】
dbus set ssconf_basic_v2ray_headtype_kcp_$v2rayindex=$v2ray_type
[ -n "$v2ray_path" ] && dbus set ssconf_basic_v2ray_network_path_$v2rayindex=$v2ray_path
;;

ws|h2)
# ws/h2协议设置【 伪装域名 (host))】和【路径 (path)】
Expand Down Expand Up @@ -1000,6 +1007,14 @@ update_vless_config(){
# local_v2ray_host=$(dbus get ssconf_basic_v2ray_network_host_$index)
# [ "$local_v2ray_host" != "$v2ray_host" ] && dbus set ssconf_basic_v2ray_network_host_$index=$v2ray_host && let i+=1
;;
kcp)
# kcp协议
local_v2ray_type=$(dbus get ssconf_basic_v2ray_headtype_kcp_$index)
local_v2ray_path=$(dbus get ssconf_basic_v2ray_network_path_$index)
[ "$local_v2ray_type" != "$v2ray_type" ] && dbus set ssconf_basic_v2ray_headtype_kcp_$index=$v2ray_type && let i+=1
[ "$local_v2ray_path" != "$v2ray_path" ] && dbus set ssconf_basic_v2ray_network_path_$index=$v2ray_path && let i+=1
;;

ws|h2)
# ws/h2协议
local_v2ray_host=$(dbus get ssconf_basic_v2ray_network_host_$index)
Expand Down Expand Up @@ -1813,6 +1828,23 @@ remove_online(){
done
}

change_cru(){
echo ==================================================================================================
sed -i '/ssnodeupdate/d' /var/spool/cron/crontabs/* >/dev/null 2>&1
if [ "$ss_basic_node_update" = "1" ];then
if [ "$ss_basic_node_update_day" = "7" ];then
cru a ssnodeupdate "0 $ss_basic_node_update_hr * * * /bin/sh /koolshare/scripts/ss_online_update.sh 3"
echo_date "设置自动更新订阅服务在每天 $ss_basic_node_update_hr 点。"
else
cru a ssnodeupdate "0 $ss_basic_node_update_hr * * $ss_basic_node_update_day /bin/sh /koolshare/scripts/ss_online_update.sh 3"
echo_date "设置自动更新订阅服务在星期 $ss_basic_node_update_day$ss_basic_node_update_hr 点。"
fi
else
echo_date "关闭自动更新订阅服务!"
sed -i '/ssnodeupdate/d' /var/spool/cron/crontabs/* >/dev/null 2>&1
fi
}

case $ss_online_action in
0)
# 删除所有节点
Expand All @@ -1836,26 +1868,15 @@ case $ss_online_action in
local_groups=`dbus list ssconf_basic_|grep group|cut -d "=" -f2|sort -u|wc -l`
online_group=`dbus get ss_online_links|base64_decode|sed 's/$/\n/'|sed '/^$/d'|wc -l`
echo_date "保存订阅节点成功,现共有 $online_group 组订阅来源,当前节点列表内已经订阅了 $local_groups 组..."
sed -i '/ssnodeupdate/d' /var/spool/cron/crontabs/* >/dev/null 2>&1
if [ "$ss_basic_node_update" = "1" ];then
if [ "$ss_basic_node_update_day" = "7" ];then
cru a ssnodeupdate "0 $ss_basic_node_update_hr * * * /koolshare/scripts/ss_online_update.sh 3"
echo_date "设置自动更新订阅服务在每天 $ss_basic_node_update_hr 点。"
else
cru a ssnodeupdate "0 $ss_basic_node_update_hr * * ss_basic_node_update_day /koolshare/scripts/ss_online_update.sh 3"
echo_date "设置自动更新订阅服务在星期 $ss_basic_node_update_day$ss_basic_node_update_hr 点。"
fi
else
echo_date "关闭自动更新订阅服务!"
sed -i '/ssnodeupdate/d' /var/spool/cron/crontabs/* >/dev/null 2>&1
fi
change_cru
unset_lock
;;
3)
# 订阅节点
set_lock
detect
echo_date "开始订阅"
change_cru
start_update
unset_lock
;;
Expand Down
14 changes: 8 additions & 6 deletions shadowsocks/scripts/ss_proc_status.sh
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,10 @@ echo_version(){
echo ① 程序版本(插件版本:$SOFVERSION):
echo -----------------------------------------------------------
echo "程序 版本 备注"
echo "ss-redir 3.3.0 2019年6月20日编译"
echo "ss-tunnel 3.3.0 2019年6月20日编译"
echo "ss-local 3.3.0 2019年6月20日编译"
echo "v2ray-plugin 1.1.0 2019年2月16日编译"
echo "ss-redir 3.3.5 2020年9月15日编译"
echo "ss-tunnel 3.3.5 2020年9月15日编译"
echo "ss-local 3.3.5 2020年9月15日编译"
echo "v2ray-plugin 1.3.1 2020年6月01日编译"
echo "ssrr-redir 3.5.3 2018年11月25日编译"
echo "ssrr-tunnel 3.5.3 2018年11月25日编译"
echo "ssrr-local 3.5.3 2018年11月25日编译"
Expand All @@ -131,9 +131,10 @@ check_status(){
#echo
SS_REDIR=`pidof ss-redir`
SS_TUNNEL=`pidof ss-tunnel`
SS_LOCAL=`ps|grep ss-local|grep 23456|awk '{print $1}'`
SS_LOCAL=`ps|grep -w ss-local|grep 23456|awk '{print $1}'`
V2RAY_PLUGIN=`pidof v2ray-plugin`
SSR_REDIR=`pidof rss-redir`
SSR_LOCAL=`ps|grep rss-local|grep 23456|awk '{print $1}'`
SSR_LOCAL=`ps|grep -w rss-local|grep 23456|awk '{print $1}'`
SSR_TUNNEL=`pidof rss-tunnel`
KOOLGAME=`pidof koolgame`
DNS2SOCKS=`pidof dns2socks`
Expand All @@ -157,6 +158,7 @@ check_status(){
echo -----------------------------------------------------------
echo "程序 状态 PID"
[ -n "$SS_REDIR" ] && echo "ss-redir 工作中 pid:$SS_REDIR" || echo "ss-redir 未运行"
[ -n "$V2RAY_PLUGIN" ] && echo "v2ray-plugin 工作中 pid:$V2RAY_PLUGIN" || echo "v2ray-plugin 未运行"
elif [ "$ss_basic_type" == "1" ];then
echo_version
echo
Expand Down
24 changes: 19 additions & 5 deletions shadowsocks/scripts/ss_webtest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -486,10 +486,18 @@ start_webtest(){
fi

if [ "$array11" == "1" ] || [ "$array11" == "2" ] || [ "$array11" == "3" ] || [ "$array11" == "5" ];then
# Resolve domain name to IP for SS and SSR
if [ "$array12" == "1" ] || [ "$array12" == "0" ];then
IFIP=`echo $array1|grep -E "([0-9]{1,3}[\.]){3}[0-9]{1,3}|:"`
if [ -z "$IFIP" ];then
server_ip=`nslookup "$array1" 9.9.9.9 | sed '1,4d' | awk '{print $3}' | grep -v :|awk 'NR==1{print}'`
fi
fi

if [ "$array12" == "1" ];then #ssr
cat > /tmp/tmp_ss.json <<-EOF
{
"server":"$array1",
"server":"$server_ip",
"server_port":$array2,
"local_port":23458,
"password":"$array3",
Expand All @@ -506,16 +514,22 @@ start_webtest(){
# result=`curl -o /dev/null -s -w %{time_connect}:%{time_starttransfer}:%{time_total}:%{speed_download} --socks5-hostname 127.0.0.1:23458 https://www.google.com/`
sleep 1
dbus set ssconf_basic_webtest_$nu=$result
kill -9 `ps|grep rss-local|grep 23458|awk '{print $1}'` >/dev/null 2>&1
kill -9 `ps|grep -w rss-local|grep 23458|awk '{print $1}'` >/dev/null 2>&1
rm -rf /tmp/tmp_ss.json

elif [ "$array12" == "0" ];then #ss
ss-local -b 0.0.0.0 -l 23458 -s $array1 -p $array2 -k $array3 -m $array4 -u $ARG_OTA $ARG_V2RAY_PLUGIN -f /var/run/sslocal3.pid >/dev/null 2>&1
ss-local -b 0.0.0.0 -l 23458 -s $server_ip -p $array2 -k $array3 -m $array4 -u $ARG_OTA $ARG_V2RAY_PLUGIN -f /var/run/sslocal3.pid >/dev/null 2>&1
sleep 3
result=`curl -o /dev/null -s -w %{time_total}:%{speed_download} --connect-timeout 15 --socks5-hostname 127.0.0.1:23458 $ssconf_basic_test_domain`
sleep 1
dbus set ssconf_basic_webtest_$nu=$result
kill -9 `ps|grep ss-local|grep 23458|awk '{print $1}'` >/dev/null 2>&1

ss_local_pid=$(ps|grep -w ss-local|grep 23458|awk '{print $1}')
if [ -n "$ARG_V2RAY_PLUGIN" ];then
v2ray_plugin_pid=$(top -b -n 1 | grep 'v2ray-plugin' | awk -v ss_local_pid="$ss_local_pid" '$2 == ss_local_pid {print $1}')
kill -9 $v2ray_plugin_pid >/dev/null 2>&1
fi
kill -9 $ss_local_pid >/dev/null 2>&1

elif [ "$array12" == "3" ];then #v2ray
create_v2ray_json
xray run -config=/tmp/tmp_v2ray.json >/dev/null 2>&1 &
Expand Down
Loading

0 comments on commit afa05bf

Please sign in to comment.