Skip to content

Commit 4b73841

Browse files
committed
enable iptable settings
1 parent bf51b34 commit 4b73841

File tree

5 files changed

+12
-15
lines changed

5 files changed

+12
-15
lines changed

README.md

100755100644
Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,13 @@
44

55
sing-box 配置文件 config.json 放在 `/data/adb/singbox/` 目录, 重启手机模块生效
66

7-
**不修改手机 iptables 规则**
7+
**黑白名单**
88

9-
发现注释 iptables 相关的代码,手机流量正常走代理(不知道具体原因)
9+
- `/data/adb/singbox/include.list` 文件中的应用包名走代理
1010

11-
# 参考
12-
- https://github.com/taamarin/box_for_magisk
11+
- `/data/adb/singbox/exclude.list` 文件中的应用包名不走代理
12+
13+
`exclude.list` 优先级高于 `include.list`:
14+
15+
如果一个应用的包名同时出现在 `exclude.list``include.list` 中,这个应用不走代理。
1316

module.prop

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
id=box_for_magisk
22
name=SingBox for Magisk
3-
version=v1.2.4
4-
versionCode=20250317
3+
version=v1.2.5
4+
versionCode=20250318
55
author=gitduk
66
description=use sing-box for tunnel proxy on android device

singbox/scripts/iptables.sh

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,7 @@ init_chains() {
1919
}
2020

2121
cleanup_limit() {
22-
local iptables="iptables -w 64"
23-
24-
# 红魔9Pro
25-
${iptables} -D oem_out -j zte_fw_data_align_out 2>/dev/null
26-
${iptables} -D OUTPUT -j zte_fw_gms 2>/dev/null
22+
${scripts_dir}/rmlimit.sh
2723
}
2824

2925
# 统一的清理函数

singbox/scripts/rmlimit.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,3 @@ iptables="iptables -w 64"
55
# 红魔9Pro
66
${iptables} -D oem_out -j zte_fw_data_align_out 2>/dev/null
77
${iptables} -D OUTPUT -j zte_fw_gms 2>/dev/null
8-

singbox/scripts/service.sh

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ start_box() {
150150
fi
151151

152152
# 设置 iptables 规则
153-
# ${scripts_dir}/iptables.sh "${network_mode}"
153+
${scripts_dir}/iptables.sh "${network_mode}"
154154

155155
# IPv6 配置
156156
setup_ipv6
@@ -183,7 +183,7 @@ stop_box() {
183183
fi
184184

185185
# 清理 iptables 规则
186-
# ${scripts_dir}/iptables.sh "clear"
186+
${scripts_dir}/iptables.sh "clear"
187187

188188
log INFO "${bin_name} stopped"
189189

@@ -242,4 +242,3 @@ case "$1" in
242242
exit 1
243243
;;
244244
esac
245-

0 commit comments

Comments
 (0)