某些机型下系统流量会以root用户请求,修复此机型下open too many files报错

This commit is contained in:
Xu Tianliang 2023-06-04 15:19:50 +08:00
parent aef6fe709e
commit ecce393578
4 changed files with 18 additions and 16 deletions

View File

@ -10,22 +10,22 @@ mkdir -p /data/v2ray
mkdir -p /data/v2ray/run mkdir -p /data/v2ray/run
mkdir -p $MODPATH/scripts mkdir -p $MODPATH/scripts
mkdir -p $MODPATH/system/bin mkdir -p $MODPATH/system/bin
mkdir -p $MODPATH/system/app # mkdir -p $MODPATH/system/app
mkdir -p $MODPATH/system/app/Stk # mkdir -p $MODPATH/system/app/Stk
mkdir -p $MODPATH/system/etc mkdir -p $MODPATH/system/etc
ui_print "- Install V2Ray core execute files" ui_print "- Install V2Ray core execute files"
unzip -j -o "${ZIPFILE}" "v2ray/bin/v2ray" -d $MODPATH/system/bin >&2 unzip -j -o "${ZIPFILE}" "v2ray/bin/v2ray" -d $MODPATH/system/bin >&2
unzip -j -o "${ZIPFILE}" "v2ray/bin/geoip.dat" -d /data/v2ray >&2 unzip -j -o "${ZIPFILE}" "v2ray/bin/geoip.dat" -d /data/v2ray >&2
unzip -j -o "${ZIPFILE}" "v2ray/bin/geosite.dat" -d /data/v2ray >&2 unzip -j -o "${ZIPFILE}" "v2ray/bin/geosite.dat" -d /data/v2ray >&2
unzip -j -o "${ZIPFILE}" "v2ray/bin/v2manager.apk" -d $MODPATH/system/app/Stk >&2 # unzip -j -o "${ZIPFILE}" "v2ray/bin/v2manager.apk" -d $MODPATH/system/app/Stk >&2
unzip -j -o "${ZIPFILE}" 'v2ray/scripts/*' -d $MODPATH/scripts >&2 unzip -j -o "${ZIPFILE}" 'v2ray/scripts/*' -d $MODPATH/scripts >&2
unzip -j -o "${ZIPFILE}" 'service.sh' -d $MODPATH >&2 unzip -j -o "${ZIPFILE}" 'service.sh' -d $MODPATH >&2
unzip -j -o "${ZIPFILE}" 'uninstall.sh' -d $MODPATH >&2 unzip -j -o "${ZIPFILE}" 'uninstall.sh' -d $MODPATH >&2
# pm command was not working in install scipt? # pm command was not working in install scipt?
ui_print "- Install V2Ray Manager APK" # ui_print "- Install V2Ray Manager APK"
pm install $MODPATH/system/app/Stk/v2manager.apk # pm install $MODPATH/system/app/Stk/v2manager.apk
rm "${download_v2ray_zip}" rm "${download_v2ray_zip}"
# copy v2ray data and config # copy v2ray data and config

View File

@ -1,6 +1,6 @@
id=v2ray id=v2ray
name=V2ray for Android name=V2ray for Android
version=2.0.1.02 version=2.1.0.0
versionCode=20220223 versionCode=20230529
author=ohnoku author=ohnoku
description=V2ray core with service scripts for Android description=V2ray core with service scripts for Android

View File

@ -7,7 +7,7 @@ run_path="${data_path}/run"
pid_file="${run_path}/${bin_name}.pid" pid_file="${run_path}/${bin_name}.pid"
error_log="${run_path}/error.log" error_log="${run_path}/error.log"
conf_file="${data_path}/config.json" conf_file="${data_path}/config.json"
bin_opts="-config ${conf_file}" bin_opts="run -c ${conf_file}"
iptables_wait="iptables" iptables_wait="iptables"
@ -80,9 +80,9 @@ start_service() {
elif [ -f ${conf_file} ] && ${bin_path} ${bin_opts} -test ; then elif [ -f ${conf_file} ] && ${bin_path} ${bin_opts} -test ; then
echo "[Info]: Starting ${bin_name} service." echo "[Info]: Starting ${bin_name} service."
mkdir -p ${run_path} mkdir -p ${run_path}
chown -R inet:inet ${data_path} # chown -R inet:inet ${data_path}
chown inet:inet ${bin_path} # chown inet:inet ${bin_path}
chmod 6755 ${bin_path} # chmod 6755 ${bin_path}
nohup ${bin_path} ${bin_opts} &>${error_log} & nohup ${bin_path} ${bin_opts} &>${error_log} &
echo -n $! > ${pid_file} echo -n $! > ${pid_file}
if wait_v2ray_listen ; then if wait_v2ray_listen ; then

View File

@ -1,12 +1,13 @@
#!/system/bin/sh #!/system/bin/sh
route_id="1130" # route_id="1130"
inet_uid="3003" inet_uid="3003"
net_raw_uid="3004" root_uid="0"
# net_raw_uid="3004"
route_name="v2ray" route_name="v2ray"
proxy_port="65535" proxy_port="65535"
proxy_mark="0x20151130" # proxy_mark="0x20151130"
table_file="/data/misc/net/rt_tables" # table_file="/data/misc/net/rt_tables"
appid_file="/data/v2ray/appid.list" appid_file="/data/v2ray/appid.list"
softap_file="/data/v2ray/softap.list" softap_file="/data/v2ray/softap.list"
iptables_wait="iptables" iptables_wait="iptables"
@ -152,6 +153,7 @@ proxy_app_tcp_iptables() {
${iptables_wait} -t nat -N APP_TCP_PROXY ${iptables_wait} -t nat -N APP_TCP_PROXY
## bypass v2ray program ## bypass v2ray program
${iptables_wait} -t nat -A APP_TCP_PROXY -m owner --uid-owner ${inet_uid} -j RETURN ${iptables_wait} -t nat -A APP_TCP_PROXY -m owner --uid-owner ${inet_uid} -j RETURN
${iptables_wait} -t nat -A APP_TCP_PROXY -m owner --uid-owner ${root_uid} -j RETURN
## white-list mode ## white-list mode
if [ "${app_proxy_mode}" = "pick" ] ; then if [ "${app_proxy_mode}" = "pick" ] ; then
## proxy all apps network ## proxy all apps network