# Clash Rules

自动同步 [clash-rules](https://github.com/Loyalsoldier/clash-rules) 规则文件。</br>
其中广告过滤规则替换为更好的[anti-AD](https://github.com/privacy-protection-tools/anti-AD?tab=readme-ov-file) : anti-ad-clash.yaml。

## 文件说明

| 规则 | 说明 | TXT | YAML |
|------|------|-----|------|
| reject | 广告拦截 | [链接](./ruleset/txt/reject.txt) | [链接](./ruleset/yaml/reject.yaml) |
| apple | 苹果服务 | [链接](./ruleset/txt/apple.txt) | [链接](./ruleset/yaml/apple.yaml) |
| google | 谷歌服务 | [链接](./ruleset/txt/google.txt) | [链接](./ruleset/yaml/google.yaml) |
| proxy | 代理列表 | [链接](./ruleset/txt/proxy.txt) | [链接](./ruleset/yaml/proxy.yaml) |
| direct | 直连列表 | [链接](./ruleset/txt/direct.txt) | [链接](./ruleset/yaml/direct.yaml) |
| gfw | GFW列表 | [链接](./ruleset/txt/gfw.txt) | [链接](./ruleset/yaml/gfw.yaml) |
| cncidr | 中国IP段 | [链接](./ruleset/txt/cncidr.txt) | [链接](./ruleset/yaml/cncidr.yaml) |
| telegramcidr | Telegram IP | [链接](./ruleset/txt/telegramcidr.txt) | [链接](./ruleset/yaml/telegramcidr.yaml) |

## 使用方法

在 Clash 配置文件中添加：

```yaml
rule-providers:
  reject:
    type: http
    behavior: domain
    url: "https://git.nvme.cc/adminroot/clash-rules/raw/branch/main/ruleset/yaml/reject.yaml"
    path: ./ruleset/reject.yaml
    interval: 86400
    
  icloud:
    type: http
    behavior: domain
    url: "https://git.nvme.cc/adminroot/clash-rules/raw/branch/main/ruleset/yaml/icloud.yaml"
    path: ./ruleset/icloud.yaml
    interval: 86400
    
  apple:
    type: http
    behavior: domain
    url: "https://git.nvme.cc/adminroot/clash-rules/raw/branch/main/ruleset/yaml/apple.yaml"
    path: ./ruleset/apple.yaml
    interval: 86400
    
  google:
    type: http
    behavior: domain
    url: "https://git.nvme.cc/adminroot/clash-rules/raw/branch/main/ruleset/yaml/google.yaml"
    path: ./ruleset/google.yaml
    interval: 86400
    
  proxy:
    type: http
    behavior: domain
    url: "https://git.nvme.cc/adminroot/clash-rules/raw/branch/main/ruleset/yaml/proxy.yaml"
    path: ./ruleset/proxy.yaml
    interval: 86400
    
  direct:
    type: http
    behavior: domain
    url: "https://git.nvme.cc/adminroot/clash-rules/raw/branch/main/ruleset/yaml/direct.yaml"
    path: ./ruleset/direct.yaml
    interval: 86400
    
  private:
    type: http
    behavior: domain
    url: "https://git.nvme.cc/adminroot/clash-rules/raw/branch/main/ruleset/yaml/private.yaml"
    path: ./ruleset/private.yaml
    interval: 86400
    
  telegramcidr:
    type: http
    behavior: ipcidr
    url: "https://git.nvme.cc/adminroot/clash-rules/raw/branch/main/ruleset/yaml/telegramcidr.yaml"
    path: ./ruleset/telegramcidr.yaml
    interval: 86400
    
  cncidr:
    type: http
    behavior: ipcidr
    url: "https://git.nvme.cc/adminroot/clash-rules/raw/branch/main/ruleset/yaml/cncidr.yaml"
    path: ./ruleset/cncidr.yaml
    interval: 86400
    
  lancidr:
    type: http
    behavior: ipcidr
    url: "https://git.nvme.cc/adminroot/clash-rules/raw/branch/main/ruleset/yaml/lancidr.yaml"
    path: ./ruleset/lancidr.yaml
    interval: 86400
    
  applications:
    type: http
    behavior: classical
    url: "https://git.nvme.cc/adminroot/clash-rules/raw/branch/main/ruleset/yaml/applications.yaml"
    path: ./ruleset/applications.yaml
    interval: 86400
    
rules:
  - RULE-SET,applications,DIRECT
  - RULE-SET,private,DIRECT
  - RULE-SET,reject,REJECT
  - RULE-SET,icloud,DIRECT
  - RULE-SET,apple,DIRECT
  - RULE-SET,google,PROXY
  - RULE-SET,proxy,PROXY
  - RULE-SET,direct,DIRECT
  - RULE-SET,telegramcidr,PROXY
  - RULE-SET,lancidr,DIRECT
  - RULE-SET,cncidr,DIRECT
  - GEOIP,LAN,DIRECT
  - GEOIP,CN,DIRECT
  - MATCH,PROXY
```

最后更新: 2026-04-24 07:00
