From bcac6b8a7a11334019c6b321114f84bab561c340 Mon Sep 17 00:00:00 2001 From: Xu Tianliang Date: Tue, 18 Jan 2022 03:09:11 +0800 Subject: [PATCH] =?UTF-8?q?feat:Android=E7=8E=B0=E7=89=88=E6=9C=AC?= =?UTF-8?q?=E5=B7=B2=E6=97=A0=E6=B3=95=E6=94=AF=E6=8C=81inotifyd=E7=9B=91?= =?UTF-8?q?=E8=A7=86=E6=96=87=E4=BB=B6=E5=8F=98=E5=8A=A8=E6=95=85=E5=88=A0?= =?UTF-8?q?=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- customize.sh | 1 - v2ray/scripts/start.sh | 4 ---- v2ray/scripts/v2ray.inotify | 43 ------------------------------------- 3 files changed, 48 deletions(-) delete mode 100644 v2ray/scripts/v2ray.inotify diff --git a/customize.sh b/customize.sh index f0ddc9a..f5c17fb 100644 --- a/customize.sh +++ b/customize.sh @@ -79,7 +79,6 @@ set_perm_recursive $MODPATH 0 0 0755 0644 set_perm $MODPATH/service.sh 0 0 0755 set_perm $MODPATH/uninstall.sh 0 0 0755 set_perm $MODPATH/scripts/start.sh 0 0 0755 -set_perm $MODPATH/scripts/v2ray.inotify 0 0 0755 set_perm $MODPATH/scripts/v2ray.service 0 0 0755 set_perm $MODPATH/scripts/v2ray.tproxy 0 0 0755 set_perm $MODPATH/system/bin/v2ray ${inet_uid} ${inet_uid} 0755 diff --git a/v2ray/scripts/start.sh b/v2ray/scripts/start.sh index 6ee02e4..719cad8 100644 --- a/v2ray/scripts/start.sh +++ b/v2ray/scripts/start.sh @@ -8,7 +8,3 @@ start_proxy () { ${MODDIR}/v2ray.tproxy enable &>> /data/v2ray/run/service.log & fi } -if [ ! -f /data/v2ray/manual ] ; then - start_proxy - inotifyd ${MODDIR}/v2ray.inotify ${MODDIR}/.. &>> /data/v2ray/run/service.log & -fi diff --git a/v2ray/scripts/v2ray.inotify b/v2ray/scripts/v2ray.inotify deleted file mode 100644 index 20679a4..0000000 --- a/v2ray/scripts/v2ray.inotify +++ /dev/null @@ -1,43 +0,0 @@ -#!/system/bin/sh - -inotify=`realpath $0` -scripts_dir=`dirname ${inotify}` -service="${scripts_dir}/v2ray.service" -tproxy="${scripts_dir}/v2ray.tproxy" - -events=$1 -monitor_dir=$2 -monitor_file=$3 - -start_v2ray() { - ${service} start && \ - if [ -f /data/v2ray/appid.list ] || [ -f /data/v2ray/softap.list ] ; then - ${tproxy} enable - settings put global airplane_mode_on 1 - sleep 1 - am broadcast -a android.intent.action.AIRPLANE_MODE - sleep 1 - settings put global airplane_mode_on 0 - sleep 1 - am broadcast -a android.intent.action.AIRPLANE_MODE - fi -} - -stop_v2ray() { - ${tproxy} disable - ${service} stop -} - -main() { -if [ ! -f /data/v2ray/manual ] ; then - if [ "${monitor_file}" = "disable" ] ; then - if [ "${events}" = "d" ] ; then - start_v2ray - elif [ "${events}" = "n" ] ; then - stop_v2ray - fi - fi -fi -} - -main