自己之前用的v2模块,已经年久失修,本来想升级一下看看能不能用比较新点的协议,但是更新了一下却死活跑不了了,花点了时间去找各种问题,还是不行。
所以又找了一个magisk版本的,折腾了一圈,还是这个box_for_magisk能跑起来。
https://github.com/taamarin/box_for_magisk
不过确实也有很多问题。
安装之前最好先看一遍文档:https://github.com/taamarin/box_for_magisk/blob/master/docs/index_cn.md
1、magisk安装模块,之后,不建议立即重启。先创建一个名为 /data/adb/box/manual 的新文件,这样就不会开机自启,就可以手动先调试,调试好了,如需开机自启,删除该文件即可。
2、先不重启手机,先修改配置文件:/data/adb/box/settings.ini
bin_name,需要使用的内核类型,自己用v2fly和xray比较多,你自己用什么就用哪个。
proxy_mode,blacklist(默认),将要排除的应用程序添加到 packages_list,例如:packages_list=("com.termux" "org.telegram.messenger")
包名可以使用一个木函获取:https://bbs.zsxwz.com/thread-1965.htm
3、重启,之后修改代理的配置文件。如果内核使用的是xray,就修改/data/adb/box/xray 里面的config.json
除了inbounds部分不要动,其他部分可以从v2rayNG,导出完整配置到剪切板,然后把outbounds部分,替换一下即可。
4、dns部分不知道怎么改,就不要动,很容易起流量回环。
5、手动调试:可以使用termux等终端。
# 启动 BFM
su -c /data/adb/box/scripts/box.service start && su -c /data/adb/box/scripts/box.iptables enable
# 停止 BFM
su -c /data/adb/box/scripts/box.iptables disable && su -c /data/adb/box/scripts/box.service stop
6,附上一份自己修改的v2fly或者xray模板。
{
"dns": {
"queryStrategy": "UseIP",
"servers": [
"https://223.6.6.6/dns-query",
{
"address": "https://1.0.0.1/dns-query",
"domains": [
"domain:googleapis.cn",
"geosite:geolocation-!cn",
"domain:gstatic.com"
],
"port": 443
},
{
"address": "https://223.6.6.6/dns-query",
"domains": [
"domain:dns.alidns.com",
"domain:dns.pub",
"domain:doh.pub",
"domain:dot.pub",
"domain:doh.360.cn",
"domain:dot.360.cn",
"geosite:cn",
"geosite:geolocation-cn"
],
"expectIPs": [
"geoip:cn"
],
"port": 443
}
],
"tag": "dns",
"hosts": {
"geosite:category-ads-all": "127.0.0.1",
"domain:googleapis.cn": "googleapis.com",
"dns.pub": [
"1.12.12.12",
"120.53.53.53"
],
"dns.alidns.com": [
"223.5.5.5",
"223.6.6.6"
],
"one.one.one.one": [
"1.1.1.1",
"1.0.0.1"
],
"dns.google": [
"8.8.8.8",
"8.8.4.4"
]
}
},
"inbounds": [
{
"port": 9898,
"protocol": "dokodemo-door",
"tag": "proxy-in",
"settings": {
"followRedirect": true,
"network": "tcp,udp"
},
"sniffing": {
"destOverride": [
"http",
"tls"
],
"enabled": true,
"routeOnly": false
},
"streamSettings": {
"sockopt": {
"tproxy": "tproxy"
}
}
}
],
"log": {
"access": "none",
"dnsLog": true,
"loglevel": "error"
},
"outbounds": [
//这部分自己从v2客户端导出。
],
"routing": {
"domainStrategy": "UseIP",
"rules": [
{
"inboundTag": [
"proxy-in"
],
"outboundTag": "dns-out",
"port": 53,
"type": "field"
},
{
"domain": [
"domain:dns.alidns.com",
"domain:dns.pub",
"domain:doh.pub",
"domain:dot.pub",
"domain:doh.360.cn",
"domain:dot.360.cn",
"geosite:cn",
"geosite:geolocation-cn"
],
"outboundTag": "direct",
"type": "field"
},
{
"ip": [
"223.5.5.5/32",
"223.6.6.6/32",
"13.231.210.233",
"104.194.73.211",
"15.204.56.187",
"0.0.0.0/8",
"10.0.0.0/8",
"fc00::/7",
"fe80::/10",
"2400:3200::1/128",
"2400:3200:baba::1/128",
"119.29.29.29/32",
"1.12.12.12/32",
"120.53.53.53/32",
"2402:4e00::/128",
"2402:4e00:1::/128",
"180.76.76.76/32",
"2400:da00::6666/128",
"114.114.114.114/32",
"114.114.115.115/32",
"180.184.1.1/32",
"180.184.2.2/32",
"101.226.4.6/32",
"218.30.118.6/32",
"123.125.81.6/32",
"140.207.198.6/32",
"geoip:private",
"geoip:cn"
],
"outboundTag": "direct",
"type": "field"
},
{
"domain": [
"regexp:^.*googlesyndication.com$",
"regexp:^.*adtival\\.network$",
"domain:googleapis.cn",
"domain:gstatic.com"
],
"outboundTag": "proxy",
"type": "field"
},
{
"domain": [
"geosite:google"
],
"network": "udp",
"outboundTag": "block",
"type": "field"
},
{
"domain": [
"geosite:category-ads-all"
],
"outboundTag": "block",
"type": "field"
},
{
"network": "tcp,udp",
"outboundTag": "proxy",
"type": "field"
}
]
}
}
最后于 24/10.21 07:25
被zsxwz编辑
,原因: