Skip to content

Commit 4668d47

Browse files
committed
much things for new version 20241012
1 parent cf69c58 commit 4668d47

17 files changed

+192
-134
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
*.zip
1+
cache/

README.md

Lines changed: 2 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -11,34 +11,8 @@
1111

1212
关注我们的频道以获取最新消息,或者加入我们的群组进行讨论!
1313

14-
# 用法
15-
- 使用前需在设置里关闭 `私人/专用dns`,在 Magisk/KernelSU 刷入后即可使用,本模块默认后台管理地址为 http://127.0.0.1:3000 ,默认用户名/密码root
16-
- 如果你从来没有接触过 AdGuardHome,你可以在这里找到[官方文档](https://github.com/AdguardTeam/AdGuardHome),或者也可以看看这篇教程[AdGuard Home 中文指南](https://www.timochan.cn/posts/jc/adguard_home_configuration_guide)
17-
18-
# 特性
19-
- DNS 服务器选用腾讯和阿里的公共 DNS,你也可以在 AdGuardHome 的 DNS 设置里更改来满足你的需求
20-
- 仅内置[秋风广告规则](https://github.com/TG-Twilight/AWAvenue-Ads-Rule),精准,轻量,少误杀
21-
- 在 Magisk/KernelSU 中可以通过模块开关实时启动/关闭模块,当然你也可以在shell中模拟模块开关
22-
```shell
23-
touch /data/adb/modules/AdguardHome/disable
24-
```
25-
- 可修改位于 `/data/adb/agh/scripts/config.sh` 的配置文件来调整配置
26-
- 在更新模块时,用户可自行选择是否保留原来的配置文件,即使你选择不保留,也会自动备份原来的配置文件到 `/data/adb/agh/backup` 目录下
27-
28-
# FAQ
29-
> Q: 为什么模块无法屏蔽全部广告?
30-
31-
> A: 模块通过转发 53 端口的 DNS 请求来实现广告屏蔽,因此无法屏蔽通过 HTTPS 传输的广告,以及与正常内容同域名的广告,如 知乎,Youtube 等,好在大部分广告还是优先使用 53 端口的 DNS 请求。
32-
33-
> Q: 模块可以与其它代理模块/软件一起使用吗?
34-
35-
> A: 可以,一般的代理app可以直接兼容(这里推荐使用[FlClash](https://github.com/chen08209/FlClash)),且 AdGuardHome 的 DNS 查询会经过 VPN,其它代理模块看情况使用,可关闭自动 iptables 规则当作普通 DNS 使用
36-
37-
> Q: 为什么不接入 KernelSU 的 WebUI?
38-
39-
> A: 由于 KernelSU 的 WebUI 在无法显示确认弹窗,导致 AdGuardHome 管理端一些功能无法使用,因此暂时不接入
40-
41-
14+
# 教程
15+
- 用法教程及常见问题解答请前往 [Wiki](https://github.com/twoone-3/AdGuardHomeForMagisk/wiki) 查看
4216

4317
# 鸣谢
4418
- [AdguardHome_magisk](https://github.com/410154425/AdGuardHome_magisk)

README_en.md

Lines changed: 5 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -3,40 +3,16 @@ English | [简体中文](README.md)
33

44
A Magisk/KernelSU module to block ads by redirecting and filtering DNS requests.
55

6-
! [Static Badge](https://img.shields.io/badge/arm--64-support-blue)
7-
! [Static Badge](https://img.shields.io/badge/arm--v7-support-blue) !
8-
! [GitHub all releases](https://img.shields.io/github/downloads/twoone-3/AdguardHome/total)
6+
![Static Badge](https://img.shields.io/badge/arm--64-support-blue)
7+
![Static Badge](https://img.shields.io/badge/arm--v7-support-blue) !
8+
![GitHub all releases](https://img.shields.io/github/downloads/twoone-3/AdguardHome/total)
99
[![](https://img.shields.io/badge/Telegram-Join%20Channel-blue?logo=telegram)](https://t.me/adguardhome_for_magisk_release)
1010
[![](https://img.shields.io/badge/Telegram-Join%20Group-blue?logo=telegram)](https://t.me/+mdZL11mJjxhkYjdl)
1111

1212
Follow our channel for the latest news, or join our group for discussion!
1313

14-
# Usage
15-
- Before using, turn off `Private/Custom DNS` in the settings, flash it in Magisk/KernelSU, and you can use it after installation. The default background management address is http://127.0.0.1:3000, and the default username/password is root.
16-
- If you have never used AdGuardHome before, you can find the [official documentation](https://github.com/AdguardTeam/AdGuardHome) here, or you can also take a look at this tutorial [AdGuard Home 中文指南](https://www.timochan.cn/posts/jc/adguard_home_configuration_guide)
17-
18-
# Features
19-
- The DNS server uses Tencent and Alibaba's public DNS, you can also change it in the DNS settings of AdGuardHome to meet your needs.
20-
- Only built-in [Autumn Breeze Ad Rule](https://github.com/TG-Twilight/AWAvenue-Ads-Rule), accurate, lightweight, and low false positives.
21-
- In Magisk/KernelSU, you can start/stop the module in real-time using the module switch, or you can simulate the module switch in the shell.
22-
```shell
23-
touch /data/adb/modules/AdguardHome/disable
24-
```
25-
- You can modify the configuration file located in `/data/adb/agh/scripts/config.sh` to adjust the configuration.
26-
- When updating the module, users can choose whether to keep the original configuration file, even if you choose not to keep it, the original configuration file will be automatically backed up to the `/data/adb/agh/backup` directory.
27-
28-
# FAQ
29-
> Q: Why can't the module block all ads?
30-
31-
> A: The module blocks ads by forwarding DNS requests on port 53, so it cannot block ads transmitted over HTTPS or ads on the same domain as normal content, such as Zhihu, Youtube, etc., but fortunately, most ads still prefer to use DNS requests on port 53.
32-
33-
> Q: Can the module be used with other proxy modules/software?
34-
35-
> A: Yes, general proxy apps can be directly compatible (here we recommend using [FlClash](https://github.com/chen08209/FlClash)), and AdGuardHome's DNS queries will pass through the VPN, other proxy modules can be used as needed, and the automatic iptables rules can be turned off for normal DNS use.
36-
37-
> Q: Why not integrate with KernelSU's WebUI?
38-
39-
> A: Because KernelSU's WebUI cannot display confirmation pop-ups, some functions of AdGuardHome's management end cannot be used, so it is not integrated for the time being.
14+
# Tutorial
15+
- For usage tutorials and FAQs, please visit [Wiki](https://github.com/twoone-3/AdGuardHomeForMagisk/wiki) for more information.
4016

4117
# Acknowledgments
4218
- [AdguardHome_magisk](https://github.com/410154425/AdGuardHome_magisk)

agh_service.sh

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,25 @@
11
#!/system/bin/sh
22

3+
AGH_DIR="/data/adb/agh"
4+
SCRIPT_DIR="$AGH_DIR/scripts"
5+
MOD_PATH="/data/adb/modules/AdGuardHome"
6+
37
(
8+
exec >$AGH_DIR/agh.log 2>&1
49
while [ "$(getprop init.svc.bootanim)" != "stopped" ]; do
510
echo "Waiting for system to finish booting..." >>/data/adb/agh/agh.log
611
sleep 8
712
done
8-
AGH_DIR="/data/adb/agh"
9-
SCRIPT_DIR="$AGH_DIR/scripts"
1013

11-
if [ ! -f "/data/adb/modules/AdGuardHome/disable" ]; then
12-
$SCRIPT_DIR/service.sh start >>$AGH_DIR/agh.log 2>&1 &&
13-
$SCRIPT_DIR/iptables.sh enable >>$AGH_DIR/agh.log 2>&1
14+
if [ ! -f "$MOD_PATH/disable" ]; then
15+
$SCRIPT_DIR/service.sh start
16+
if [ ! -f "$MOD_PATH/disable_iptable" ]; then
17+
$SCRIPT_DIR/iptables.sh enable
18+
sed -i "s/description=\[.*\]/description=\[😎AdGuardHome is running and 🔗iptables is enabled\]/" "$MOD_PATH/module.prop"
19+
else
20+
sed -i "s/description=\[.*\]/description=\[😎AdGuardHome is running but ⛓️‍💥iptables is disabled\]/" "$MOD_PATH/module.prop"
21+
fi
1422
fi
1523

16-
inotifyd $SCRIPT_DIR/inotify.sh /data/adb/modules/AdGuardHome:d,n >/dev/null 2>&1 &
24+
inotifyd $SCRIPT_DIR/inotify.sh $MOD_PATH:d,n >/dev/null 2>&1 &
1725
) &

bin/AdGuardHome.yaml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ dns:
3030
- 223.5.5.5
3131
- 119.29.29.29
3232
fallback_dns: []
33-
upstream_mode: parallel
33+
upstream_mode: load_balance
3434
fastest_timeout: 1s
3535
allowed_clients: []
3636
disallowed_clients: []
@@ -130,6 +130,7 @@ filtering:
130130
enabled: false
131131
bing: true
132132
duckduckgo: true
133+
ecosia: true
133134
google: true
134135
pixabay: true
135136
yandex: true
@@ -138,12 +139,13 @@ filtering:
138139
parental_block_host: family-block.dns.adguard.com
139140
safebrowsing_block_host: standard-block.dns.adguard.com
140141
rewrites: []
142+
safe_fs_patterns: []
141143
safebrowsing_cache_size: 1048576
142144
safesearch_cache_size: 1048576
143145
parental_cache_size: 1048576
144146
cache_time: 30
145147
filters_update_interval: 168
146-
blocked_response_ttl: 30
148+
blocked_response_ttl: 10
147149
filtering_enabled: true
148150
parental_enabled: false
149151
safebrowsing_enabled: false
@@ -169,4 +171,4 @@ os:
169171
group: ""
170172
user: ""
171173
rlimit_nofile: 0
172-
schema_version: 28
174+
schema_version: 29

bin/AdGuardHome_arm64

-28 MB
Binary file not shown.

bin/AdGuardHome_armv7

-27.6 MB
Binary file not shown.

changelog.md

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
# ChangeLog
2-
- 修复manual选项不生效的问题
3-
- fix manual option not work
4-
- 更改了模块更新安装时的备份方式
5-
- change the backup method when updating the module
6-
- 更新了 README.md
7-
- update README.md
8-
- 更改了默认DNS查询方式为parallel,提高了查询速度
9-
- change the default DNS query method to parallel, improve the query speed
2+
- 新增模块描述动态显示模块状态功能
3+
- 新增 [Wiki](https://github.com/twoone-3/AdGuardHomeForMagisk/wiki) 页面
4+
- 更新 `AdGuardHome` 到 v0.107.53
5+
- 更新 `AdGuardHome.yaml` 版本
6+
- 删除 `config.sh` 中的 manual 配置项,转而改用创建 `disable_iptable` 文件

customize.sh

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ if [ -d "$AGH_DIR" ]; then
2626
rm "$pid_file"
2727
sleep 1
2828
fi
29-
ui_print "- 发现旧版模块,是否保留原来的配置文件?"
30-
ui_print "- Found old version, do you want to keep the old configuration?"
29+
ui_print "- 发现旧版模块,是否保留原来的配置文件?(若不保留则自动备份)"
30+
ui_print "- Found old version, do you want to keep the old configuration? (If not, it will be automatically backed up)"
3131
ui_print "- (音量上键 = 是, 音量下键 = 否)"
3232
ui_print "- (Volume Up = Yes, Volume Down = No)"
3333
key_click=""
@@ -69,6 +69,30 @@ else
6969
unzip -o "$ZIPFILE" "bin/*" -d $AGH_DIR
7070
fi
7171

72+
ui_print "- 是否需要禁用用于转发 DNS 请求的 iptables 规则?"
73+
ui_print "- Do you want to disable iptables rules for forwarding DNS requests?"
74+
ui_print "- (音量上键 = 是, 音量下键 = 否)"
75+
ui_print "- (Volume Up = Yes, Volume Down = No)"
76+
key_click=""
77+
while [ "$key_click" = "" ]; do
78+
key_click="$(getevent -qlc 1 | awk '{ print $3 }' | grep 'KEY_')"
79+
sleep 0.2
80+
done
81+
case "$key_click" in
82+
"KEY_VOLUMEUP")
83+
ui_print "- 创建 disable_iptable 文件..."
84+
ui_print "- Creating disable_iptable file..."
85+
touch "$MODPATH/disable_iptable"
86+
;;
87+
*)
88+
if [ -f "$MODPATH/disable_iptable" ]; then
89+
ui_print "- 删除 disable_iptable 文件..."
90+
ui_print "- Deleting disable_iptable file..."
91+
rm "$MODPATH/disable_iptable"
92+
fi
93+
;;
94+
esac
95+
7296
ui_print "- 正在设置权限..."
7397
ui_print "- Setting permissions..."
7498
chmod +x "$BIN_DIR/AdGuardHome"

module.prop

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
id=AdGuardHome
22
name=AdGuardHome for Magisk
3-
version=20241007
4-
versionCode=22
3+
version=20241012
4+
versionCode=23
55
author=twoone3
6-
description=Filter ads at the DNS level
6+
description=[😐AdGuardHome is stopped and ⛓️‍💥iptables is disabled] Filter ads at the DNS level
77
updateJson=https://raw.githubusercontent.com/twoone-3/AdGuardHomeForMagisk/main/version.json

0 commit comments

Comments
 (0)