diff --git a/README.md b/README.md index b6dca8f..be6c8ee 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # AdGuardHome for Magisk -> 一个通过过滤DNS请求来屏蔽广告的 Magisk 模块,也能防止DNS污染,无需配置,在 Magisk 里安装重启即可使用,使用前需关闭私人dns,AdGuardHome 后台管理地址为 http://127.0.0.1:3000,用户名/密码root +一个通过过滤DNS请求来屏蔽广告的 Magisk 模块,也能防止DNS污染, ![Static Badge](https://img.shields.io/badge/arm--64-support-blue) ![GitHub all releases](https://img.shields.io/github/downloads/twoone-3/AdguardHome/total) @@ -7,11 +7,21 @@ 加入我们的 [Telegram](https://t.me/adguardhome_for_magisk_release) 频道获取最新信息以及FAQ # 用法 -- 在 Magisk/KernelSU 刷入后重启即可使用 +- 使用前需在设置里关闭 `私人/专用dns`,在 Magisk/KernelSU 刷入后重启即可使用,AdGuardHome 后台管理地址为 http://127.0.0.1:3000,用户名/密码root # 特性 -- DNS上游为DoH,稳定,减少污染 -- 仅内置[秋风广告规则](https://github.com/TG-Twilight/AWAvenue-Ads-Rule),省电,不误杀 +- DNS 上游为腾讯阿里 DoT,备用 DNS 为 Google 和 CloudFlare 的 DoT +- 仅内置[秋风广告规则](https://github.com/TG-Twilight/AWAvenue-Ads-Rule),省电,少误杀 +- 可配合第三方软件进行启动停止,通过执行位于 /data/adb/modules/AdGuardHome/bin/ 的 apply_iptables.sh 和 flush_iptables.sh,这里给出Anywhere的快捷导入链接(复制到剪贴板即可导入) + +Anywhere启动链接 +``` +anywhere://share/J2VP8X5qVhbI2sRvhZ6JXLZdx7Y6JLmsCgw9Wd7k7qce3ERvOaJlWHt61Y8oalvceraVdBkTbIymWLyhgxRQLeICFi3/GKuZYkqPJ3A6WQ8+xW4nTvmC9SwzER2X/9PFEtjgZsphvy2R8suN6BOE3Pm10gwmsdoLwCuLxs0uIA2VmP25Ur1GHTCogIgJoWBpJpz0QT1/LvBtNXXdFwkilQNF8VvcKAO3cgKns+I3hUk0T2rbsjVfj4UwxgYxi5Yg9yiV53hOzIzVZ9uZki3uy6TNTnThFXM+Hg88m8dron/cJM9Qg5Y979j0YTVrA9XakpnXKlF7UvaDM85FSjXZpkXCzbn00lWcvQ== +``` +Anywhere停止链接 +``` +anywhere://share/J2VP8X5qVhbI2sRvhZ2hdp4467QzpcHDlkAQil7Mg6oDOLdzYgAJO+9fKKenP2M28XWZ71jveGDq1E/sCmMAhBqd5N04LZkJp0EYtrFp7Vw9xPsYBhlmwlaKWljr9iIAMGWOulpW7Zzhm/tpfaDIKjweOGfIsONgcoWq89Idmb215WTrhfju+OeoNqDicBqrOLI5iyI8fTCQifRm7m7hq53WMgN/BoYbWnyE34AeVO2hq5btVggCTBGunrftXnlweSY4ngaN8CmhTlDWQeyjMJRZMooTPHwcQm3fisvBY6McMaVV5lSLHBe+MNaK1EwnzQ0RjNJh/3eoVGQJgUUyN8swAmtakrwaNA== +``` # 鸣谢 - [AdguardHome_magisk](https://github.com/410154425/AdGuardHome_magisk) diff --git a/apply_iptables.sh b/apply_iptables.sh index 2f9b392..ec5e45f 100644 --- a/apply_iptables.sh +++ b/apply_iptables.sh @@ -4,8 +4,5 @@ iptables -t nat -A ADGUARD -m owner --uid-owner root --gid-owner net_raw -j RETU # 将 53 端口所有 udp tcp 流量转发到 adguard home iptables -t nat -A ADGUARD -p udp --dport 53 -j REDIRECT --to-ports 5591 iptables -t nat -A ADGUARD -p tcp --dport 53 -j REDIRECT --to-ports 5591 -# ip6 缺少nat表,待查问题 -# ip6tables -t nat -A ADGUARD -p udp --dport 53 -j REDIRECT --to-ports 5591 -# ip6tables -t nat -A ADGUARD -p tcp --dport 53 -j REDIRECT --to-ports 5591 # 将 ADGUARD 规则添加到 OUTPUT iptables -t nat -I OUTPUT 1 -j ADGUARD \ No newline at end of file diff --git a/bin/AdGuardHome.yaml b/bin/AdGuardHome.yaml index ebeddd2..0c7b779 100644 --- a/bin/AdGuardHome.yaml +++ b/bin/AdGuardHome.yaml @@ -23,16 +23,17 @@ dns: ratelimit_whitelist: [] refuse_any: true upstream_dns: - - tls://dot.pub - - tls://dns.alidns.com + - tls://1.12.12.12 + - tls://223.5.5.5 + - tls://120.53.53.53 + - tls://223.6.6.6 upstream_dns_file: "" bootstrap_dns: - - 223.5.5.5 - - 119.29.29.29 + - 0.0.0.0 fallback_dns: - - tls://dns.google - - tls://1dot1dot1dot1.cloudflare-dns.com - all_servers: true + - tls://1.1.1.1 + - tls://8.8.8.8 + all_servers: false fastest_addr: false fastest_timeout: 1s allowed_clients: [] @@ -86,7 +87,7 @@ tls: strict_sni_check: false querylog: ignored: [] - interval: 1h + interval: 6h size_memory: 1000 enabled: true file_enabled: true @@ -143,7 +144,7 @@ filtering: parental_cache_size: 1048576 cache_time: 30 filters_update_interval: 72 - blocked_response_ttl: 10 + blocked_response_ttl: 30 filtering_enabled: true parental_enabled: false safebrowsing_enabled: false diff --git a/customize.sh b/customize.sh index 80d79b9..855bc06 100644 --- a/customize.sh +++ b/customize.sh @@ -4,8 +4,5 @@ fi ADG_DIR="$MODPATH/bin" chmod +x "$ADG_DIR/AdGuardHome" "$MODPATH/apply_iptables.sh" "$MODPATH/flush_iptables.sh" -# TODO: 研究用户组对程序运行有什么影响 -# chgrp net_raw "$ADG_DIR/AdGuardHome" -# chgrp net_raw "$ADG_DIR/AdGuardHome.yaml" ui_print "安装成功,请重启设备" \ No newline at end of file diff --git a/flush_iptables.sh b/flush_iptables.sh index c0bc971..435d10d 100644 --- a/flush_iptables.sh +++ b/flush_iptables.sh @@ -1,7 +1,3 @@ iptables -t nat -D OUTPUT 1 iptables -t nat -F ADGUARD -iptables -t nat -X ADGUARD - -# ip6tables -t nat -D ADGUARD 1 -# ip6tables -t nat -F ADGUARD -# ip6tables -t nat -X ADGUARD +iptables -t nat -X ADGUARD \ No newline at end of file diff --git a/module.prop b/module.prop index c5968c7..99d7e93 100644 --- a/module.prop +++ b/module.prop @@ -1,6 +1,6 @@ id=AdGuardHome name=AdGuardHome for Magisk -version=20231223 -versionCode=8 +version=20240101 +versionCode=9 author=twoone3 -description=通过DNS层面过滤广告、防DNS劫持,后台地址http://127.0.0.1:3000,用户名/密码root \ No newline at end of file +description=Filter ads at the DNS level \ No newline at end of file diff --git a/service.sh b/service.sh index c334a19..91347cb 100644 --- a/service.sh +++ b/service.sh @@ -1,12 +1,9 @@ -# until [ $(getprop sys.boot_completed) ]; do -# sleep 1 -# done MODDIR="${0%/*}" ADG_DIR="$MODDIR/bin" # 输出重定向 exec 1>"$ADG_DIR/stdout.log" exec 2>"$ADG_DIR/stderr.log" -setuidgid root:net_raw "$ADG_DIR/AdGuardHome" 2>&1 & +setuidgid root:net_raw "$ADG_DIR/AdGuardHome" & "$MODDIR/apply_iptables.sh"