安卓手机获取 root 权限后,在 termux 里面跑 sing-box 内核,直接使用 tun 模式,设置国内外自动分流,高效率低能效,省电环保,更加底层,可以套娃其他 VPN.
termux 下编译
pkg update
pkg install wget golang git -y
git clone -b main-dev https://github.com/sagernet/sing-box
cd sing-box/cmd/sing-box
CGO_ENABLED=0 GOOS=android GOARCH=arm64 go build -tags with_quic,with_grpc,with_wireguard,with_shadowsocksr,with_ech,with_utls,with_acme,with_clash_api,with_v2ray_api,with_gvisor -trimpath -ldflags "-extldflags=-static -s -w -buildid=" -o ycycxz-sing-box-android-arm64
geoip & gesite
wget https://ycycxz.com/dl/geoip.db
wget https://ycycxz.com/dl/geosite.db
配置
cat <<EOF > config.json
...
EOF
运行
sudo ./ycycxz-sing-box-android-arm64 run -c config.json