Skip to content

Commit a5585c4

Browse files
committed
fix certificate issue AdguardTeam/AdGuardHome#7002
1 parent 7266aa1 commit a5585c4

File tree

13 files changed

+74
-448
lines changed

13 files changed

+74
-448
lines changed

README.md

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,31 @@
11
# AdGuardHome for Magisk
2-
一个通过过滤DNS请求来屏蔽广告的 Magisk 模块,也能防止DNS污染,
2+
一个通过重定向并过滤 DNS 请求来屏蔽广告的 Magisk/KernelSU 模块
33

44
![Static Badge](https://img.shields.io/badge/arm--64-support-blue)
55
![GitHub all releases](https://img.shields.io/github/downloads/twoone-3/AdguardHome/total)
66

77
加入我们的 [Telegram](https://t.me/adguardhome_for_magisk_release) 频道获取最新信息以及FAQ
88

9-
本模块基于[AdguardHome_magisk](https://github.com/410154425/AdGuardHome_magisk)二改而成,感谢原作者的付出
10-
119
# 用法
1210
- 使用前需在设置里关闭 `私人/专用dns`,在 Magisk/KernelSU 刷入后重启即可使用,AdGuardHome 后台管理地址为 http://127.0.0.1:3000,用户名/密码root
11+
- 注意!本模块与可能与代理类模块冲突,同时使用两种模块会导致潜在问题!
1312

1413
# 特性
15-
- 修改DNS筛选规则为[秋风广告规则](https://github.com/TG-Twilight/AWAvenue-Ads-Rule),省电,少误杀
16-
- 添加了 KernelSU 的 web 管理页面支持
17-
- 移除了强制自动更新
18-
- 移除了赞助页面
14+
- DNS 上游为腾讯阿里 DoT,备用 DNS 为 Google 和 CloudFlare
15+
- 仅内置[秋风广告规则](https://github.com/TG-Twilight/AWAvenue-Ads-Rule),省电,少误杀
16+
- 可配合第三方软件进行启动停止,通过执行位于 /data/adb/modules/AdGuardHome/bin/ 的 apply_iptables.sh 和 flush_iptables.sh,这里给出Anywhere的快捷导入链接(复制到剪贴板即可导入)
17+
- 在 KernelSU 里可以通过打开按钮来打开管理页面
18+
19+
Anywhere启动链接
20+
```
21+
anywhere://share/J2VP8X5qVhbI2sRvhZ6JXLZdx7Y6JLmsCgw9Wd7k7qce3ERvOaJlWHt61Y8oalvceraVdBkTbIymWLyhgxRQLeICFi3/GKuZYkqPJ3A6WQ8+xW4nTvmC9SwzER2X/9PFEtjgZsphvy2R8suN6BOE3Pm10gwmsdoLwCuLxs0uIA2VmP25Ur1GHTCogIgJoWBpJpz0QT1/LvBtNXXdFwkilQNF8VvcKAO3cgKns+I3hUk0T2rbsjVfj4UwxgYxi5Yg9yiV53hOzIzVZ9uZki3uy6TNTnThFXM+Hg88m8dron/cJM9Qg5Y979j0YTVrA9XakpnXKlF7UvaDM85FSjXZpkXCzbn00lWcvQ==
22+
```
23+
Anywhere停止链接
24+
```
25+
anywhere://share/J2VP8X5qVhbI2sRvhZ2hdp4467QzpcHDlkAQil7Mg6oDOLdzYgAJO+9fKKenP2M28XWZ71jveGDq1E/sCmMAhBqd5N04LZkJp0EYtrFp7Vw9xPsYBhlmwlaKWljr9iIAMGWOulpW7Zzhm/tpfaDIKjweOGfIsONgcoWq89Idmb215WTrhfju+OeoNqDicBqrOLI5iyI8fTCQifRm7m7hq53WMgN/BoYbWnyE34AeVO2hq5btVggCTBGunrftXnlweSY4ngaN8CmhTlDWQeyjMJRZMooTPHwcQm3fisvBY6McMaVV5lSLHBe+MNaK1EwnzQ0RjNJh/3eoVGQJgUUyN8swAmtakrwaNA==
26+
```
27+
28+
# 鸣谢
29+
- [AdguardHome_magisk](https://github.com/410154425/AdGuardHome_magisk)
30+
- [akashaProxy](https://github.com/ModuleList/akashaProxy)
31+
- [box_for_magisk](https://github.com/taamarin/box_for_magisk)

apply_iptables.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
iptables -t nat -N ADGUARD
2+
# return requests from AdGuardHome
3+
iptables -t nat -A ADGUARD -m owner --uid-owner root --gid-owner net_raw -j RETURN
4+
# redirect DNS requests to AdGuardHome
5+
iptables -t nat -A ADGUARD -p udp --dport 53 -j REDIRECT --to-ports 5591
6+
iptables -t nat -A ADGUARD -p tcp --dport 53 -j REDIRECT --to-ports 5591
7+
# apply iptables rules
8+
iptables -t nat -A OUTPUT -j ADGUARD
Binary file not shown.
Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -23,18 +23,17 @@ dns:
2323
ratelimit_whitelist: []
2424
refuse_any: true
2525
upstream_dns:
26-
- 10.35.53.10:3553
27-
- '#上面一行用于内网解析,若不用可删'
28-
- https://223.5.5.5/dns-query
2926
- https://1.12.12.12/dns-query
30-
- '#一般情况上面两行不可删!禁止填写53端口常规DNS上游'
31-
- '#强制使用并行请求,其它禁选'
27+
- https://120.53.53.53/dns-query
28+
- https://223.5.5.5/dns-query
29+
- https://223.6.6.6/dns-query
3230
upstream_dns_file: ""
3331
bootstrap_dns:
34-
- 10.35.53.10:3553
32+
- 1.1.1.1
33+
- 8.8.8.8
3534
fallback_dns:
36-
- '#此处留空不要填'
37-
upstream_mode: parallel
35+
- https://1.1.1.1/dns-query
36+
upstream_mode: load_balance
3837
fastest_timeout: 1s
3938
allowed_clients: []
4039
disallowed_clients: []
@@ -45,10 +44,10 @@ dns:
4544
trusted_proxies:
4645
- 127.0.0.0/8
4746
- ::1/128
48-
cache_size: 4194304
47+
cache_size: 33554432
4948
cache_ttl_min: 0
50-
cache_ttl_max: 300
51-
cache_optimistic: false
49+
cache_ttl_max: 0
50+
cache_optimistic: true
5251
bogus_nxdomain: []
5352
aaaa_disabled: false
5453
enable_dnssec: false
@@ -63,7 +62,7 @@ dns:
6362
bootstrap_prefer_ipv6: false
6463
upstream_timeout: 10s
6564
private_networks: []
66-
use_private_ptr_resolvers: false
65+
use_private_ptr_resolvers: true
6766
local_ptr_upstreams: []
6867
use_dns64: false
6968
dns64_prefixes: []
@@ -77,7 +76,7 @@ tls:
7776
force_https: false
7877
port_https: 443
7978
port_dns_over_tls: 853
80-
port_dns_over_quic: 853
79+
port_dns_over_quic: 784
8180
port_dnscrypt: 0
8281
dnscrypt_config_file: ""
8382
allow_unencrypted_doh: false
@@ -89,7 +88,7 @@ tls:
8988
querylog:
9089
dir_path: ""
9190
ignored: []
92-
interval: 6h
91+
interval: 24h
9392
size_memory: 1000
9493
enabled: true
9594
file_enabled: true
@@ -102,7 +101,7 @@ filters:
102101
- enabled: true
103102
url: https://adguardteam.github.io/HostlistsRegistry/assets/filter_53.txt
104103
name: AWAvenue Ads Rule
105-
id: 1721028739
104+
id: 1721483069
106105
whitelist_filters: []
107106
user_rules: []
108107
dhcp:
@@ -138,16 +137,16 @@ filtering:
138137
pixabay: true
139138
yandex: true
140139
youtube: true
141-
blocking_mode: null_ip
140+
blocking_mode: default
142141
parental_block_host: family-block.dns.adguard.com
143142
safebrowsing_block_host: standard-block.dns.adguard.com
144143
rewrites: []
145144
safebrowsing_cache_size: 1048576
146145
safesearch_cache_size: 1048576
147146
parental_cache_size: 1048576
148147
cache_time: 30
149-
filters_update_interval: 24
150-
blocked_response_ttl: 10
148+
filters_update_interval: 168
149+
blocked_response_ttl: 30
151150
filtering_enabled: true
152151
parental_enabled: false
153152
safebrowsing_enabled: false
@@ -156,17 +155,18 @@ clients:
156155
runtime_sources:
157156
whois: true
158157
arp: true
159-
rdns: false
158+
rdns: true
160159
dhcp: true
161160
hosts: true
162161
persistent: []
163162
log:
163+
enabled: true
164164
file: ""
165165
max_backups: 0
166166
max_size: 100
167167
max_age: 3
168168
compress: false
169-
local_time: false
169+
local_time: true
170170
verbose: false
171171
os:
172172
group: ""
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,7 @@
231231
||googleadservices.com^
232232
||googletagservices-cn.com^
233233
||googletagservices.com^
234+
||gorgon.youdao.com^
234235
||gromore.pangolin-sdk-toutiao.com^
235236
||grs.dbankcloud.com^
236237
||grs.hicloud.com^
@@ -268,7 +269,6 @@
268269
||img.adnyg.com.w.kunlungr.com^
269270
||imtmp.net^
270271
||irc.qubiankeji.com^
271-
||is.snssdk.com^
272272
||itv2-up.openspeech.cn^
273273
||ixav-cse.avlyun.com^
274274
||iyfbodn.com^
@@ -409,6 +409,7 @@
409409
||scs.openspeech.cn^
410410
||sdk-ab-config.qquanquan.com^
411411
||sdk-cache.video.ptqy.gitv.tv^
412+
||sdk.1rtb.net^
412413
||sdk.cferw.com^
413414
||sdk.e.qq.com^
414415
||sdk.hzsanjiaomao.com^

customize.sh

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,11 @@
1-
ui_print " -------------------------- "
2-
ui_print " ------ 安装中,请稍等 ------ "
3-
sleep 1
4-
cp "$MODPATH/module.prop" "$MODPATH/t_module"
5-
if [ "$IS64BIT" = 'true' ]; then
6-
cp "$MODPATH/linux_arm64/AdGuardHome" "$MODPATH/AdGuardHome" > /dev/null 2>&1
7-
ui_print " -------------------------- "
8-
else
9-
cp "$MODPATH/linux_armv7/AdGuardHome" "$MODPATH/AdGuardHome" > /dev/null 2>&1
10-
ui_print " -------------------------- "
1+
if [ "$ARCH" != "arm64" ]; then
2+
abort "- only support arm64"
113
fi
12-
sleep 1
13-
rm -rf "$MODPATH/linux_arm64"
14-
rm -rf "$MODPATH/linux_armv7"
15-
ui_print " ----- 安装已完成,请重启 ---- "
16-
ui_print " -------------------------- "
4+
5+
ui_print "- Installing AdGuardHome"
6+
7+
ADG_DIR="$MODPATH/bin"
8+
chmod 0775 "$ADG_DIR/AdGuardHome" "$MODPATH/apply_iptables.sh" "$MODPATH/flush_iptables.sh"
9+
chown root:net_raw "$ADG_DIR/AdGuardHome"
10+
11+
ui_print "- Installing success, please reboot your device"

flush_iptables.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
iptables -t nat -D OUTPUT -j ADGUARD
2+
iptables -t nat -F ADGUARD
3+
iptables -t nat -X ADGUARD

linux_armv7/AdGuardHome

-28.7 MB
Binary file not shown.

mode.conf

Lines changed: 0 additions & 36 deletions
This file was deleted.

module.prop

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
id=AdGuardHome
2-
name=AdGuardHome模块
3-
version=20240715
4-
versionCode=1
5-
author=top大佬(酷安) & twoone3 魔改
6-
description=[ - ] 通过DNS层面过滤广告,使用前请先详读mode.conf文件,支持订阅过滤规则,后台地址127.0.0.1:3000,用户名/密码root,配置文件:/data/adb/modules/AdGuardHome/mode.conf
2+
name=AdGuardHome for Magisk
3+
version=20240721
4+
versionCode=13
5+
author=twoone3
6+
description=Filter ads at the DNS level

0 commit comments

Comments
 (0)