feat:Android现版本已无法支持inotifyd监视文件变动故删除

This commit is contained in:
Xu Tianliang 2022-01-18 03:09:11 +08:00
parent 093d9f4242
commit bcac6b8a7a
No known key found for this signature in database
GPG Key ID: 7FF3F70CD1C04346
3 changed files with 0 additions and 48 deletions

View File

@ -79,7 +79,6 @@ set_perm_recursive $MODPATH 0 0 0755 0644
set_perm $MODPATH/service.sh 0 0 0755 set_perm $MODPATH/service.sh 0 0 0755
set_perm $MODPATH/uninstall.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/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.service 0 0 0755
set_perm $MODPATH/scripts/v2ray.tproxy 0 0 0755 set_perm $MODPATH/scripts/v2ray.tproxy 0 0 0755
set_perm $MODPATH/system/bin/v2ray ${inet_uid} ${inet_uid} 0755 set_perm $MODPATH/system/bin/v2ray ${inet_uid} ${inet_uid} 0755

View File

@ -8,7 +8,3 @@ start_proxy () {
${MODDIR}/v2ray.tproxy enable &>> /data/v2ray/run/service.log & ${MODDIR}/v2ray.tproxy enable &>> /data/v2ray/run/service.log &
fi fi
} }
if [ ! -f /data/v2ray/manual ] ; then
start_proxy
inotifyd ${MODDIR}/v2ray.inotify ${MODDIR}/.. &>> /data/v2ray/run/service.log &
fi

View File

@ -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