基于Magisk的V2Ray代理,使用iptables转发,相较于VPN模式更为省电、无感。
本版本是fork自v2ray-for-android。由于源项目年久失修,在使用时需要大幅度自行调整内容。就将自己的改动保存到了自己的仓库。 本仓库删除了历史遗留的二进制大文件,直接检出旧版本不保证能正常使用,有需要匹配旧设备以及查看历史内容的需求请在源仓库查看。
目前还未合并至Magisk官方模块仓库,下载zip后自行在Magisk Manager
中从本地安装
/data/v2ray/config.json
V2Ray配置文件/data/v2ray/appid.list
需要代理的APP列表/data/v2ray/softap.list
需要代理的子网V2ray的进程可以通过下面的脚本来进行管理,默认情况下V2Ray进程将开机自动运行:
/data/adb/modules/v2ray/script/v2ray.service (start|stop|restart|status)
代理iptables规则可以通过下面的脚本管理,同V2Ray进程一样默认情况下iptables规则将开机自动运行:
/data/adb/modules/v2ray/script/v2ray.tproxy (enable|disable|renew)
全局代理
在appid.list
编辑内容:
0
分应用代理
在appid.list
指定需要代理应用的UID,例:
10131
UID可以通过应用包名在/data/system/packages.list
中找到:
lavender:/ $ pm list package -3
package:com.vanced.android.youtube # 应用 Vanced Youtube
lavender:/ $ grep 'com.vanced.android.youtube' /data/system/packages.list
com.vanced.android.youtube 10131 0 /data/user/0/com.vanced.android.youtube ....
# 10131即是应用Vanced Youtube的UID
代理热点子网
在softap.list
中指定热点子网IP即可,也可以使用网段,例:
192.168.43.0/24
各种机型的ROM中打开热点时子网网段并不一致,请根据实际情况编辑
在/data/v2ray/
目录下新建空白文件manual
即可
touch /data/v2ray/manaual
请参照v2manager页面
"A 'transparent proxy' is a proxy that does not modify the request or response beyond what is required for proxy authentication and identification". "A 'non-transparent proxy' is a proxy that modifies the request or response in order to provide some added service to the user agent, such as group annotation services, media type transformation, protocol reduction, or anonymity filtering".
This module also contains a simple script that helping you to make transparent proxy via iptables. In fact , the script is just make some REDIRECT and TPROXY rules to redirect app's network into 65535 port in localhost. And 65535 port is listen by v2ray inbond with dokodemo-door protocol. In summarize, the App proxy network path is looks like :
Android App ( Google, Facebook, Twitter ... )
⇕ ( TCP & UDP network protocol )
Android system iptables [ localhost inside ]
⇕ ( REDIRECT & TPROXY iptables rules )
[ 127.0.0.1:65535 Inbond ] -- V2Ray -- [ Outbond ]
⇕ ( Shadowsocks, Vmess )
Proxy Server ( SS, V2Ray) [ Internet outside ]
⇕ ( HTTP, TCP, ... other application protocol )
App Server ( Google, Facebook, Twitter ... )
pm uninstall co.lintian.v2manager
rm -rf /data/v2ray
Project V is a set of network tools that help you to build your own computer network. It secures your network connections and thus protects your privacy. See ProjectV website for more information.