本地构建需先手动克隆或下载多个上游源文件,缺一不可;mihomo 白名单必须放在拦截规则之前且用 PASS 而非 DIRECT;dnsmasq 和 SmartDNS 格式需先下载到本地再用 conf-file 引入,不生成 allow 文件

HyperADRules
Lynricsy活跃维护聚合多个上游广告与恶意域名规则,统一合并后输出 mihomo MRS、sing-box SRS、Clash 等格式,省去手动维护多套规则集的麻烦。
HyperADRules — 下一代广告/恶意域名规则聚合;多上游合并,输出 mihomo MRS / sing-box SRS / Clash 等格式
git clone --depth=1 https://github.com/liuzq2002/Adguard-Home-For-Magisk-Mod upstream-adguard
uv run python -m scripts.build_rulesets --adguard-source upstream-adguard --anti-ad-source upstream-anti-ad --output distREADME 未说明
聚合多上游广告与恶意域名规则,一次构建输出 mihomo、sing-box、Clash 等客户端订阅
聚合多个上游广告与恶意域名规则,统一合并后输出 mihomo MRS、sing-box SRS、Clash 等格式,省去手动维护多套规则集的麻烦。
核心能力
- 定时拉取多个 DNS 级上游并合并去重
- 保守语义跳过路径端口等无法表达的规则
- 一次构建输出 MRS、SRS、Clash YAML 等多格式
- 空 ipcidr 集合也发布可加载资产避免订阅 404
- 固定 latest/download 地址每日更新无需换链接
容易踩的坑
- snapshot-20261108HyperADRules rulesets 20261108最新正式版2026-11-08 · 2026-11-08 16:07 UTC
HyperADRules multi-format rulesets
- Release tag:
snapshot-20261108 - Content id:
48199f198fc7f921(sha256 of dist/SHA256SUMS, first 16 hex) - Converter commit:
7452a164e04d0478612d3d5606eef452e42b77d4 - Upstream: https://github.com/liuzq2002/Adguard-Home-For-Magisk-Mod
- Upstream commit:
1569a3c72664bb01103a74f68ace77d2cc3a5faa - Upstream: https://github.com/privacy-protection-tools/anti-AD
- Upstream commit:
2b83ce2de8e7d217385da1cee42dcaa2ea3f08f6 - Upstream: https://raw.githubusercontent.com/privacy-protection-tools/dead-horse/master/anti-ad-white-for-clash.yaml
- Upstream SHA256:
84bc8933dc69e36d939bb122e4d9c59dcef3cab408a6f54b68050e73f111ad4a - Upstream: https://raw.githubusercontent.com/lingeringsound/10007/main/reward
- Upstream SHA256:
5b225f41921c0a1cb854d93ae43dc6d215205d55ff5c813c3d694671302e359b - Generated at: 2026-11-08T16:07:37Z
HyperADRules multi-format rulesets
上游
-
AdGuard Home For Magisk Mod:
1569a3c72664bb01103a74f68ace77d2cc3a5faa -
anti-AD:
2b83ce2de8e7d217385da1cee42dcaa2ea3f08f6 -
dead-horse:
84bc8933dc69e36d939bb122e4d9c59dcef3cab408a6f54b68050e73f111ad4a -
Coolapk 1007 reward:
5b225f41921c0a1cb854d93ae43dc6d215205d55ff5c813c3d694671302e359b -
local allow:
sources/local_allow.txt -
产物语义: 多上游 DNS 广告规则到多种客户端格式的保守转换。
-
例外规则已拆为
hyper_adrules_allow.*, mihomo 建议在sub-rules中用PASS。 -
dnsmasq / SmartDNS 仅输出 ads、malware 的 suffix 阻断规则; exact 与 wildcard 不会静默扩大。
-
allow 不生成 dnsmasq / SmartDNS 阻断文件。
集合 domain ipcidr 跳过 正则 修饰符 路径 端口 模式 ads233283 191 196 0 3 161 1 31 allow708 0 14586 1 12410 2172 3 0 malware6294 0 0 0 0 0 0 0 规则集
- mihomo MRS:
hyper_adrules_{ads,allow,malware}.mrs/*_ipcidr.mrs - Clash YAML:
hyper_adrules_*_clash.yaml/*_clash_ipcidr.yaml - domains / surge / surge2 / adguard / easylist / sing-box json
- dnsmasq / SmartDNS: 仅
hyper_adrules_{ads,malware}_*.conf - sing-box SRS:
hyper_adrules_*_singbox.srs(由 json 编译)
- Release tag:
- snapshot-20261107HyperADRules rulesets 202611072026-11-07 · 2026-11-07 23:42 UTC
查看更新说明
HyperADRules multi-format rulesets
- Release tag:
snapshot-20261107 - Content id:
17eaf6273b50aaa9(sha256 of dist/SHA256SUMS, first 16 hex) - Converter commit:
7ea61b43aee1f0ce50ab096e9e9ff58d76b32884 - Upstream: https://github.com/liuzq2002/Adguard-Home-For-Magisk-Mod
- Upstream commit:
1569a3c72664bb01103a74f68ace77d2cc3a5faa - Upstream: https://github.com/privacy-protection-tools/anti-AD
- Upstream commit:
2b83ce2de8e7d217385da1cee42dcaa2ea3f08f6 - Upstream: https://raw.githubusercontent.com/privacy-protection-tools/dead-horse/master/anti-ad-white-for-clash.yaml
- Upstream SHA256:
84bc8933dc69e36d939bb122e4d9c59dcef3cab408a6f54b68050e73f111ad4a - Upstream: https://raw.githubusercontent.com/lingeringsound/10007/main/reward
- Upstream SHA256:
5b225f41921c0a1cb854d93ae43dc6d215205d55ff5c813c3d694671302e359b - Generated at: 2026-11-07T23:42:31Z
HyperADRules multi-format rulesets
上游
-
AdGuard Home For Magisk Mod:
1569a3c72664bb01103a74f68ace77d2cc3a5faa -
anti-AD:
2b83ce2de8e7d217385da1cee42dcaa2ea3f08f6 -
dead-horse:
84bc8933dc69e36d939bb122e4d9c59dcef3cab408a6f54b68050e73f111ad4a -
Coolapk 1007 reward:
5b225f41921c0a1cb854d93ae43dc6d215205d55ff5c813c3d694671302e359b -
local allow:
sources/local_allow.txt -
产物语义: 多上游 DNS 广告规则到多种客户端格式的保守转换。
-
例外规则已拆为
hyper_adrules_allow.*, mihomo 建议在sub-rules中用PASS。 -
dnsmasq / SmartDNS 仅输出 ads、malware 的 suffix 阻断规则; exact 与 wildcard 不会静默扩大。
-
allow 不生成 dnsmasq / SmartDNS 阻断文件。
集合 domain ipcidr 跳过 正则 修饰符 路径 端口 模式 ads233283 191 196 0 3 161 1 31 allow708 0 14586 1 12410 2172 3 0 malware6294 0 0 0 0 0 0 0 规则集
- mihomo MRS:
hyper_adrules_{ads,allow,malware}.mrs/*_ipcidr.mrs - Clash YAML:
hyper_adrules_*_clash.yaml/*_clash_ipcidr.yaml - domains / surge / surge2 / adguard / easylist / sing-box json
- dnsmasq / SmartDNS: 仅
hyper_adrules_{ads,malware}_*.conf - sing-box SRS:
hyper_adrules_*_singbox.srs(由 json 编译)
- Release tag:
- snapshot-20261106HyperADRules rulesets 202611062026-11-06 · 2026-11-06 00:59 UTC
查看更新说明
HyperADRules multi-format rulesets
- Release tag:
snapshot-20261106 - Content id:
dc8a1991af503ae6(sha256 of dist/SHA256SUMS, first 16 hex) - Converter commit:
7ea61b43aee1f0ce50ab096e9e9ff58d76b32884 - Upstream: https://github.com/liuzq2002/Adguard-Home-For-Magisk-Mod
- Upstream commit:
1569a3c72664bb01103a74f68ace77d2cc3a5faa - Upstream: https://github.com/privacy-protection-tools/anti-AD
- Upstream commit:
97c344c19e6bf0286b9b8dd95d80f5ce67ab4d64 - Upstream: https://raw.githubusercontent.com/privacy-protection-tools/dead-horse/master/anti-ad-white-for-clash.yaml
- Upstream SHA256:
84bc8933dc69e36d939bb122e4d9c59dcef3cab408a6f54b68050e73f111ad4a - Upstream: https://raw.githubusercontent.com/lingeringsound/10007/main/reward
- Upstream SHA256:
5b225f41921c0a1cb854d93ae43dc6d215205d55ff5c813c3d694671302e359b - Generated at: 2026-11-06T00:59:06Z
HyperADRules multi-format rulesets
上游
-
AdGuard Home For Magisk Mod:
1569a3c72664bb01103a74f68ace77d2cc3a5faa -
anti-AD:
97c344c19e6bf0286b9b8dd95d80f5ce67ab4d64 -
dead-horse:
84bc8933dc69e36d939bb122e4d9c59dcef3cab408a6f54b68050e73f111ad4a -
Coolapk 1007 reward:
5b225f41921c0a1cb854d93ae43dc6d215205d55ff5c813c3d694671302e359b -
local allow:
sources/local_allow.txt -
产物语义: 多上游 DNS 广告规则到多种客户端格式的保守转换。
-
例外规则已拆为
hyper_adrules_allow.*, mihomo 建议在sub-rules中用PASS。 -
dnsmasq / SmartDNS 仅输出 ads、malware 的 suffix 阻断规则; exact 与 wildcard 不会静默扩大。
-
allow 不生成 dnsmasq / SmartDNS 阻断文件。
集合 domain ipcidr 跳过 正则 修饰符 路径 端口 模式 ads232655 191 196 0 3 161 1 31 allow708 0 14586 1 12410 2172 3 0 malware6294 0 0 0 0 0 0 0 规则集
- mihomo MRS:
hyper_adrules_{ads,allow,malware}.mrs/*_ipcidr.mrs - Clash YAML:
hyper_adrules_*_clash.yaml/*_clash_ipcidr.yaml - domains / surge / surge2 / adguard / easylist / sing-box json
- dnsmasq / SmartDNS: 仅
hyper_adrules_{ads,malware}_*.conf - sing-box SRS:
hyper_adrules_*_singbox.srs(由 json 编译)
- Release tag:
- snapshot-20261105HyperADRules rulesets 202611052026-11-05 · 2026-11-05 00:56 UTC
查看更新说明
HyperADRules multi-format rulesets
- Release tag:
snapshot-20261105 - Content id:
dc8a1991af503ae6(sha256 of dist/SHA256SUMS, first 16 hex) - Converter commit:
7ea61b43aee1f0ce50ab096e9e9ff58d76b32884 - Upstream: https://github.com/liuzq2002/Adguard-Home-For-Magisk-Mod
- Upstream commit:
1569a3c72664bb01103a74f68ace77d2cc3a5faa - Upstream: https://github.com/privacy-protection-tools/anti-AD
- Upstream commit:
97c344c19e6bf0286b9b8dd95d80f5ce67ab4d64 - Upstream: https://raw.githubusercontent.com/privacy-protection-tools/dead-horse/master/anti-ad-white-for-clash.yaml
- Upstream SHA256:
84bc8933dc69e36d939bb122e4d9c59dcef3cab408a6f54b68050e73f111ad4a - Upstream: https://raw.githubusercontent.com/lingeringsound/10007/main/reward
- Upstream SHA256:
5b225f41921c0a1cb854d93ae43dc6d215205d55ff5c813c3d694671302e359b - Generated at: 2026-11-05T00:56:36Z
HyperADRules multi-format rulesets
上游
-
AdGuard Home For Magisk Mod:
1569a3c72664bb01103a74f68ace77d2cc3a5faa -
anti-AD:
97c344c19e6bf0286b9b8dd95d80f5ce67ab4d64 -
dead-horse:
84bc8933dc69e36d939bb122e4d9c59dcef3cab408a6f54b68050e73f111ad4a -
Coolapk 1007 reward:
5b225f41921c0a1cb854d93ae43dc6d215205d55ff5c813c3d694671302e359b -
local allow:
sources/local_allow.txt -
产物语义: 多上游 DNS 广告规则到多种客户端格式的保守转换。
-
例外规则已拆为
hyper_adrules_allow.*, mihomo 建议在sub-rules中用PASS。 -
dnsmasq / SmartDNS 仅输出 ads、malware 的 suffix 阻断规则; exact 与 wildcard 不会静默扩大。
-
allow 不生成 dnsmasq / SmartDNS 阻断文件。
集合 domain ipcidr 跳过 正则 修饰符 路径 端口 模式 ads232655 191 196 0 3 161 1 31 allow708 0 14586 1 12410 2172 3 0 malware6294 0 0 0 0 0 0 0 规则集
- mihomo MRS:
hyper_adrules_{ads,allow,malware}.mrs/*_ipcidr.mrs - Clash YAML:
hyper_adrules_*_clash.yaml/*_clash_ipcidr.yaml - domains / surge / surge2 / adguard / easylist / sing-box json
- dnsmasq / SmartDNS: 仅
hyper_adrules_{ads,malware}_*.conf - sing-box SRS:
hyper_adrules_*_singbox.srs(由 json 编译)
- Release tag:
- snapshot-20261103HyperADRules rulesets 202611032026-11-03 · 2026-11-03 02:27 UTC
查看更新说明
HyperADRules multi-format rulesets
- Release tag:
snapshot-20261103 - Content id:
26c36b39cabd77d3(sha256 of dist/SHA256SUMS, first 16 hex) - Converter commit:
7ea61b43aee1f0ce50ab096e9e9ff58d76b32884 - Upstream: https://github.com/liuzq2002/Adguard-Home-For-Magisk-Mod
- Upstream commit:
1569a3c72664bb01103a74f68ace77d2cc3a5faa - Upstream: https://github.com/privacy-protection-tools/anti-AD
- Upstream commit:
9bbc98fae9be597e9e853c14e2da1a6983d88523 - Upstream: https://raw.githubusercontent.com/privacy-protection-tools/dead-horse/master/anti-ad-white-for-clash.yaml
- Upstream SHA256:
84bc8933dc69e36d939bb122e4d9c59dcef3cab408a6f54b68050e73f111ad4a - Upstream: https://raw.githubusercontent.com/lingeringsound/10007/main/reward
- Upstream SHA256:
5b225f41921c0a1cb854d93ae43dc6d215205d55ff5c813c3d694671302e359b - Generated at: 2026-11-03T02:27:39Z
HyperADRules multi-format rulesets
上游
-
AdGuard Home For Magisk Mod:
1569a3c72664bb01103a74f68ace77d2cc3a5faa -
anti-AD:
9bbc98fae9be597e9e853c14e2da1a6983d88523 -
dead-horse:
84bc8933dc69e36d939bb122e4d9c59dcef3cab408a6f54b68050e73f111ad4a -
Coolapk 1007 reward:
5b225f41921c0a1cb854d93ae43dc6d215205d55ff5c813c3d694671302e359b -
local allow:
sources/local_allow.txt -
产物语义: 多上游 DNS 广告规则到多种客户端格式的保守转换。
-
例外规则已拆为
hyper_adrules_allow.*, mihomo 建议在sub-rules中用PASS。 -
dnsmasq / SmartDNS 仅输出 ads、malware 的 suffix 阻断规则; exact 与 wildcard 不会静默扩大。
-
allow 不生成 dnsmasq / SmartDNS 阻断文件。
集合 domain ipcidr 跳过 正则 修饰符 路径 端口 模式 ads232000 191 196 0 3 161 1 31 allow708 0 14586 1 12410 2172 3 0 malware6294 0 0 0 0 0 0 0 规则集
- mihomo MRS:
hyper_adrules_{ads,allow,malware}.mrs/*_ipcidr.mrs - Clash YAML:
hyper_adrules_*_clash.yaml/*_clash_ipcidr.yaml - domains / surge / surge2 / adguard / easylist / sing-box json
- dnsmasq / SmartDNS: 仅
hyper_adrules_{ads,malware}_*.conf - sing-box SRS:
hyper_adrules_*_singbox.srs(由 json 编译)
- Release tag:
用户点评
登录用户的真实使用记录,可按版本和硬件筛选还没有人点评。第一个说出真实体验的人最有价值。
这是什么
HyperADRules 是广告与恶意域名规则聚合项目:
- 定时拉取多个 DNS 级上游,合并去重
- 保守语义:路径 / 端口 / 无法表达的 modifier 跳过,绝不静默扩大为整域误杀
- 一次构建,输出 AdGuard Home、mihomo、Clash、sing-box、Surge、dnsmasq、SmartDNS、Pi-hole 等格式
- 空
ipcidr集合也会发布可加载资产,订阅 URL 不会 404;mihomo MRS 不支持 0 条 ipcidr,空集 MRS 内含单条 RFC 6666 discard-only 占位地址100::/128(不会命中真实流量),text / YAML 仍为真正的空集合
上游来源
| 上游 | 用途 |
|---|---|
| AdGuard Home For Magisk Mod | ads / malware / allow 主过滤器 |
| anti-AD | Clash payload 广告域 + 例外 |
| dead-horse whitelist | 并入 allow |
| Coolapk 1007 reward | 补充 ads hosts |
sources/local_allow.txt | 仓库本地白名单,覆盖上游误杀业务域 |
快速开始
先按客户端选择格式,不需要下载整个 Release:
- AdGuard Home:使用
*_adguard.txt,见下方 AdGuard Home - mihomo / Clash Meta:优先使用
.mrs,见下方 mihomo / Clash Meta - Clash(不支持 MRS):使用
*_clash.yaml - sing-box:使用
*_singbox.srs - 其他客户端见 按客户端选择格式
规则按用途分为三组:
{kind} | 用途 | 通常动作 |
|---|---|---|
ads | 广告、跟踪域名 | 拦截 |
malware | 恶意、钓鱼域名 | 拦截 |
allow | 误杀例外 | 放行;必须优先于拦截规则 |
所有订阅都使用下面这种固定地址:
https://github.com/Lynricsy/HyperADRules/releases/latest/download/<文件名>
例如 AdGuard Home 广告规则:
https://github.com/Lynricsy/HyperADRules/releases/latest/download/hyper_adrules_ads_adguard.txt
latest/download 会自动转到最新 Release。每天发布新版本后地址不变,客户端仍会下载到新内容。不要复制带
/download/snapshot-YYYYMMDD/ 的版本固定地址,也不需要每次手动更换。
按客户端选择格式
下表中的 {kind} 替换为 ads、malware 或 allow;订阅地址均为
https://github.com/Lynricsy/HyperADRules/releases/latest/download/<文件名>。
| 客户端 / 用途 | 文件名 | 怎么用 |
|---|---|---|
| AdGuard Home | hyper_adrules_{kind}_adguard.txt | 在 DNS 封锁清单中添加 ads、malware URL,在 DNS 允许清单中添加 allow URL |
| AdGuard / EasyList 兼容过滤器 | hyper_adrules_{kind}_easylist.txt | 作为远程过滤器订阅;内容使用 Adblock DNS 规则语法 |
| mihomo / Clash Meta | hyper_adrules_{kind}.mrs | rule-providers 设置 behavior: domain、format: mrs |
| mihomo 的 IP 规则 | hyper_adrules_{kind}_ipcidr.mrs | 单独的 provider,设置 behavior: ipcidr、format: mrs |
| mihomo 文本格式 | hyper_adrules_{kind}.txt | provider 设置 behavior: domain、format: text |
| mihomo 文本 IP 格式 | hyper_adrules_{kind}_ipcidr.txt | provider 设置 behavior: ipcidr、format: text |
| Clash / YAML provider | hyper_adrules_{kind}_clash.yaml | provider 设置 behavior: domain、format: yaml |
| Clash / YAML IP provider | hyper_adrules_{kind}_clash_ipcidr.yaml | provider 设置 behavior: ipcidr、format: yaml |
| sing-box | hyper_adrules_{kind}_singbox.srs | 远程 rule-set 设置 format: binary |
| sing-box 可读源文件 | hyper_adrules_{kind}_singbox.json | 远程 rule-set 设置 format: source;通常优先用 SRS |
| Surge Rule Set | hyper_adrules_{kind}_surge.txt | 使用 RULE-SET,文件内含 DOMAIN / DOMAIN-SUFFIX / IP-CIDR |
| Surge Domain Set | hyper_adrules_{kind}_surge2.txt | 使用 DOMAIN-SET;只含域名,不含 IP |
| dnsmasq | hyper_adrules_{ads,malware}_dnsmasq.conf | 下载后通过 conf-file= 引入;只有拦截规则 |
| SmartDNS | hyper_adrules_{ads,malware}_smartdns.conf | 下载后通过 conf-file 引入;只有拦截规则 |
| Pi-hole / 纯域名列表 | hyper_adrules_{kind}_domains.txt | ads、malware 加入封锁列表;allow 加入允许列表 |
| 校验与统计 | SHA256SUMS / manifest.md / stats.json | 校验下载、查看产物统计;不能作为过滤规则导入 |
_ipcidr 文件只包含 IP/CIDR 规则,不能当域名列表使用。dnsmasq 和 SmartDNS 没有标准的远程白名单动作,
所以只生成 ads、malware 文件;allow 应使用客户端自己的白名单功能。
客户端配置
AdGuard Home
进入 过滤器 → DNS 封锁清单 → 添加封锁清单 → 添加自定义列表,分别添加:
https://github.com/Lynricsy/HyperADRules/releases/latest/download/hyper_adrules_ads_adguard.txt
https://github.com/Lynricsy/HyperADRules/releases/latest/download/hyper_adrules_malware_adguard.txt
再进入 过滤器 → DNS 允许清单 → 添加允许清单 → 添加自定义列表,添加:
https://github.com/Lynricsy/HyperADRules/releases/latest/download/hyper_adrules_allow_adguard.txt
名称可以自行填写,例如 HyperADRules Ads、HyperADRules Malware、HyperADRules Allow。保存后点击
“检查更新”即可立即拉取;之后 AdGuard Home 会按自身过滤器刷新周期继续请求同一个固定 URL。
mihomo / Clash Meta
MRS 体积更小、加载更快,推荐使用。下面是完整的域名规则配置;如需 IP/CIDR,再按格式表添加对应
*_ipcidr.mrs provider,并使用 no-resolve。
rule-providers:
hyper_allow:
type: http
behavior: domain
format: mrs
path: ./ruleset/hyper_adrules_allow.mrs
url: https://github.com/Lynricsy/HyperADRules/releases/latest/download/hyper_adrules_allow.mrs
interval: 86400
hyper_ads:
type: http
behavior: domain
format: mrs
path: ./ruleset/hyper_adrules_ads.mrs
url: https://github.com/Lynricsy/HyperADRules/releases/latest/download/hyper_adrules_ads.mrs
interval: 86400
hyper_malware:
type: http
behavior: domain
format: mrs
path: ./ruleset/hyper_adrules_malware.mrs
url: https://github.com/Lynricsy/HyperADRules/releases/latest/download/hyper_adrules_malware.mrs
interval: 86400
rules:
- SUB-RULE,(NETWORK,tcp),hyper_filter
- SUB-RULE,(NETWORK,udp),hyper_filter
# 这里继续你的代理 / 直连 / 地区分流
- MATCH,DIRECT
sub-rules:
hyper_filter:
- RULE-SET,hyper_allow,PASS
- RULE-SET,hyper_ads,REJECT
- RULE-SET,hyper_malware,REJECT
- MATCH,PASS
白名单必须在拦截规则之前。不要把 allow 写成 DIRECT,否则例外域名无法继续匹配后面的代理规则;也不要把
PASS 白名单和 REJECT 平铺在同一层 rules 中。旧版 Clash 不支持 MRS 时,把文件换为
*_clash.yaml,并把 format 改为 yaml。
sing-box
SRS 是已编译的二进制 rule-set。下面用逻辑规则表达“命中 ads 或 malware,并且没有命中 allow”; 这样白名单只退出本项目的拦截,不会强制改变后续代理路由:
{
"route": {
"rules": [
{
"type": "logical",
"mode": "and",
"rules": [
{ "rule_set": ["hyper-ads", "hyper-malware"] },
{ "rule_set": "hyper-allow", "invert": true }
],
"action": "reject"
}
],
"rule_set": [
{
"tag": "hyper-allow",
"type": "remote",
"format": "binary",
"url": "https://github.com/Lynricsy/HyperADRules/releases/latest/download/hyper_adrules_allow_singbox.srs"
},
{
"tag": "hyper-ads",
"type": "remote",
"format": "binary",
"url": "https://github.com/Lynricsy/HyperADRules/releases/latest/download/hyper_adrules_ads_singbox.srs"
},
{
"tag": "hyper-malware",
"type": "remote",
"format": "binary",
"url": "https://github.com/Lynricsy/HyperADRules/releases/latest/download/hyper_adrules_malware_singbox.srs"
}
]
}
}
如果下载 Release 需要经过代理,可给每个远程规则集增加 "download_detour": "<出站标签>"。使用
*_singbox.json 时把 format 改为 source。
Surge
在 [Rule] 中使用远程 Rule Set:
RULE-SET,https://github.com/Lynricsy/HyperADRules/releases/latest/download/hyper_adrules_ads_surge.txt,REJECT
RULE-SET,https://github.com/Lynricsy/HyperADRules/releases/latest/download/hyper_adrules_malware_surge.txt,REJECT
Surge 没有与 mihomo PASS 等价的“只跳过当前过滤器”动作。若接受白名单域名固定直连,可把
hyper_adrules_allow_surge.txt 作为 DIRECT Rule Set 放在上述规则之前;否则不要整表导入 allow,
而应把实际误杀域名加入你现有的优先规则。只需要域名集合时,可把 RULE-SET 和 _surge.txt 分别换成
DOMAIN-SET 和 _surge2.txt。
dnsmasq / SmartDNS
这两种格式需要先下载到本地,再由服务配置文件引入;可用 cron 或 systemd timer 定期覆盖本地文件。
# dnsmasq
conf-file=/etc/dnsmasq.d/hyper_adrules_ads_dnsmasq.conf
conf-file=/etc/dnsmasq.d/hyper_adrules_malware_dnsmasq.conf
# SmartDNS
conf-file /etc/smartdns/hyper_adrules_ads_smartdns.conf
conf-file /etc/smartdns/hyper_adrules_malware_smartdns.conf
下载后重载对应 DNS 服务。此格式只导出明确的域名后缀阻断规则,避免把精确匹配扩大为整个域。
Pi-hole / 其他纯域名客户端
使用 *_domains.txt。它每行一个域名,适合只接受纯域名的客户端;为了不扩大匹配语义,无法安全表达的
“仅子域”和通配符规则不会写入该格式。将 ads、malware URL 加入封锁列表,将 allow URL 加入允许列表。
手动下载
只需替换文件名即可下载任何格式:
base=https://github.com/Lynricsy/HyperADRules/releases/latest/download
curl -fLO "$base/hyper_adrules_ads_adguard.txt"
curl -fLO "$base/SHA256SUMS"
产物一览
GitHub Actions 每天 UTC 20:23 构建并发布。文件名中 {kind} = ads / allow / malware。
完整文件清单、适用客户端和用法见 按客户端选择格式;Release 内的
manifest.md 提供当次构建统计。
Release tag
- 新 tag:
snapshot-YYYYMMDD(UTC 日期) - notes 含
CONTENT_ID(SHA256SUMS指纹前 16 位) - 同日重跑:完整且 checksum 一致则跳过;残缺则删重建
转换策略
只保留 DNS / domain 层能完整表达的规则:
| 输入 | 结果 |
|---|---|
||example.com^ | +.example.com |
@@||example.com^ | allow 集合 |
||1.2.3.4^ / CIDR | ipcidr |
hosts 0.0.0.0 ads.example.com | exact domain |
||example.com/path、:8443、query/fragment | 跳过(不整域扩大) |
无法表达的 $script 等 modifier | 跳过 |
| 安全 wildcard | 保留为 Clash/mihomo 可编译形式 |
跳过原因会进入 unsupported_path / unsupported_port / unsupported_modifier 统计。
本地构建
git clone --depth=1 https://github.com/liuzq2002/Adguard-Home-For-Magisk-Mod upstream-adguard
git clone --depth=1 https://github.com/privacy-protection-tools/anti-AD upstream-anti-ad
curl -fsSL https://raw.githubusercontent.com/privacy-protection-tools/dead-horse/master/anti-ad-white-for-clash.yaml \
-o upstream-anti-ad/anti-ad-white-for-clash.yaml
curl -fsSL https://raw.githubusercontent.com/lingeringsound/10007/main/reward \
-o upstream-coolapk-1007-reward.txt
uv run python -m scripts.build_rulesets \
--adguard-source upstream-adguard \
--anti-ad-source upstream-anti-ad \
--coolapk-1007-reward-source upstream-coolapk-1007-reward.txt \
--local-allow-source sources/local_allow.txt \
--output dist \
--adguard-commit "$(git -C upstream-adguard rev-parse HEAD)" \
--anti-ad-commit "$(git -C upstream-anti-ad rev-parse HEAD)" \
--dead-horse-commit "$(sha256sum upstream-anti-ad/anti-ad-white-for-clash.yaml | cut -d ' ' -f 1)" \
--coolapk-1007-reward-commit "$(sha256sum upstream-coolapk-1007-reward.txt | cut -d ' ' -f 1)"
生成二进制:
mihomo convert-ruleset domain text dist/hyper_adrules_ads.txt dist/hyper_adrules_ads.mrs
# 空 ipcidr 先换成占位地址 100::/128 再 convert-ruleset ipcidr(mihomo 拒绝加载 0 条的 ipcidr MRS)
sing-box rule-set compile --output dist/hyper_adrules_ads_singbox.srs dist/hyper_adrules_ads_singbox.json
反馈
误杀 / 漏拦欢迎开 Issue。规则会定期从上游重建;本仓库只做保守、可追溯的格式转换与发布。