KernelSU 模块,以 TUN 模式运行 Mihomo,对 Android 设备的全部 TCP/UDP 流量做透明代理。
- KernelSU ≥ 0.7.0
- Android ≥ 8.0(API 26)
- Mihomo ≥ 1.18.0
- 在 KernelSU 管理器安装
mitun-vX.Y.Z.zip - 将可执行的 mihomo 放置于
/data/adb/mitun/mihomo,chmod 0755 - 编辑
/data/adb/mitun/config.yaml填入订阅或者自行调整 - 重启设备
以下字段请勿修改,否则会破坏模块内部集成:
external-controller: 127.0.0.1:9090— Web 控制台跳转与 Action 按钮依赖该端口external-ui: ui— Web 控制台静态资源路径tun.device: mihomo— 模块按此接口名定位 TUN;如需更改需同步改common_functions.sh中的TUN_DEVICE
通过 KernelSU 管理器的 Action 按钮切换启停:
- 进程未运行时 → 启动
- 进程正在运行时 → 停止
http://127.0.0.1:9090/ui
密码即 config.yaml 的 secret。
/data/adb/modules/mitun/ # 模块本体(KernelSU 管理)
├── service.sh # late_start 入口
├── boot-completed.sh # 启动健康检查
├── action.sh # Action 按钮
├── common_functions.sh # 共享函数库
└── uninstall.sh
/data/adb/mitun/ # 用户数据(升级保留)
├── mihomo # 二进制(自备)
├── config.yaml # 主配置
└── run/
├── mihomo.pid
├── mihomo.log # mihomo 进程日志
└── mitun.log # 模块运维日志
# 日志
tail /data/adb/mitun/run/mihomo.log
tail /data/adb/mitun/run/mitun.log
# TUN 接口
ip link show mihomo
# SELinux 拒绝
dmesg | grep avc | grep mihomo通过 KernelSU 管理器卸载。用户配置与二进制默认保留,彻底清除:
rm -rf /data/adb/mitun