# johnshall/shadowrocket-adblock-rules-forever architecture

> Architecture diagram of the GitHub repository johnshall/shadowrocket-adblock-rules-forever, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-09). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/johnshall/shadowrocket-adblock-rules-forever
- Repository: https://github.com/johnshall/shadowrocket-adblock-rules-forever

## Overview

This repository publishes plain-text Shadowrocket configurations, not a runtime service or the Python generator mentioned in the README (no generator source is present in the supplied tree). The user chooses a configuration and imports it into Shadowrocket, which applies its routing and, where included, ad-filtering rules. The graph preserves the documented blacklist, whitelist, geographic, global-routing, return-to-China, ad-only, and lazy-configuration options. Relationships are based on the README; no configuration contents or generation logic were supplied for inspection.

Main entry points: [`sr_top500_banlist_ad.conf`](https://github.com/johnshall/shadowrocket-adblock-rules-forever/blob/release/sr_top500_banlist_ad.conf) (Blacklist + ads), [`sr_top500_banlist.conf`](https://github.com/johnshall/shadowrocket-adblock-rules-forever/blob/release/sr_top500_banlist.conf) (Blacklist), [`sr_top500_whitelist_ad.conf`](https://github.com/johnshall/shadowrocket-adblock-rules-forever/blob/release/sr_top500_whitelist_ad.conf) (Whitelist + ads), [`sr_top500_whitelist.conf`](https://github.com/johnshall/shadowrocket-adblock-rules-forever/blob/release/sr_top500_whitelist.conf) (Whitelist)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_routing["Routing profiles"]
  node_top500_ban_ad["Blacklist + ads"]
  node_top500_ban["Blacklist"]
  node_top500_white_ad["Whitelist + ads"]
  node_top500_white["Whitelist"]
  node_cnip_ad["China / abroad + ads<br/>[sr_cnip_ad.conf]"]
  node_cnip["China / abroad<br/>[sr_cnip.conf]"]
  node_direct_ad["Global direct + ads"]
  node_proxy_ad["Global proxy + ads"]
  node_backcn_ad["Return to China + ads<br/>[sr_backcn_ad.conf]"]
  node_backcn["Return to China<br/>[sr_backcn.conf]"]
end

subgraph group_ads["Ad filtering"]
  node_ad_only["Ad-only rules<br/>[sr_ad_only.conf]"]
  node_adb["Ad-filter rules<br/>[sr_adb.conf]"]
end

subgraph group_convenience["Convenience profiles"]
  node_lazy["Lazy configuration<br/>[lazy.conf]"]
  node_lazy_group["Lazy with policy groups<br/>[lazy_group.conf]"]
end

node_user(("Shadowrocket user"))
node_shadowrocket["Shadowrocket"]

node_user -->|"imports configuration"| node_shadowrocket
node_user -->|"selects and downloads"| node_top500_ban_ad
node_user -->|"selects and downloads"| node_top500_ban
node_user -->|"selects and downloads"| node_top500_white_ad
node_user -->|"selects and downloads"| node_top500_white
node_user -->|"selects and downloads"| node_cnip_ad
node_user -->|"selects and downloads"| node_cnip
node_user -->|"selects and downloads"| node_direct_ad
node_user -->|"selects and downloads"| node_proxy_ad
node_user -->|"selects and downloads"| node_backcn_ad
node_user -->|"selects and downloads"| node_backcn
node_user -->|"selects and downloads"| node_ad_only
node_user -->|"selects and downloads"| node_lazy
node_user -->|"selects and downloads"| node_lazy_group
node_top500_ban_ad -->|"provides rules"| node_shadowrocket
node_top500_ban -->|"provides rules"| node_shadowrocket
node_top500_white_ad -->|"provides rules"| node_shadowrocket
node_top500_white -->|"provides rules"| node_shadowrocket
node_cnip_ad -->|"provides rules"| node_shadowrocket
node_cnip -->|"provides rules"| node_shadowrocket
node_direct_ad -->|"provides rules"| node_shadowrocket
node_proxy_ad -->|"provides rules"| node_shadowrocket
node_backcn_ad -->|"provides rules"| node_shadowrocket
node_backcn -->|"provides rules"| node_shadowrocket
node_ad_only -->|"provides rules"| node_shadowrocket
node_lazy -->|"provides configuration"| node_shadowrocket
node_lazy_group -->|"provides configuration"| node_shadowrocket

click node_top500_ban_ad "https://github.com/johnshall/shadowrocket-adblock-rules-forever/blob/release/sr_top500_banlist_ad.conf"
click node_top500_ban "https://github.com/johnshall/shadowrocket-adblock-rules-forever/blob/release/sr_top500_banlist.conf"
click node_top500_white_ad "https://github.com/johnshall/shadowrocket-adblock-rules-forever/blob/release/sr_top500_whitelist_ad.conf"
click node_top500_white "https://github.com/johnshall/shadowrocket-adblock-rules-forever/blob/release/sr_top500_whitelist.conf"
click node_cnip_ad "https://github.com/johnshall/shadowrocket-adblock-rules-forever/blob/release/sr_cnip_ad.conf"
click node_cnip "https://github.com/johnshall/shadowrocket-adblock-rules-forever/blob/release/sr_cnip.conf"
click node_direct_ad "https://github.com/johnshall/shadowrocket-adblock-rules-forever/blob/release/sr_direct_banad.conf"
click node_proxy_ad "https://github.com/johnshall/shadowrocket-adblock-rules-forever/blob/release/sr_proxy_banad.conf"
click node_backcn_ad "https://github.com/johnshall/shadowrocket-adblock-rules-forever/blob/release/sr_backcn_ad.conf"
click node_backcn "https://github.com/johnshall/shadowrocket-adblock-rules-forever/blob/release/sr_backcn.conf"
click node_ad_only "https://github.com/johnshall/shadowrocket-adblock-rules-forever/blob/release/sr_ad_only.conf"
click node_adb "https://github.com/johnshall/shadowrocket-adblock-rules-forever/blob/release/sr_adb.conf"
click node_lazy "https://github.com/johnshall/shadowrocket-adblock-rules-forever/blob/release/lazy.conf"
click node_lazy_group "https://github.com/johnshall/shadowrocket-adblock-rules-forever/blob/release/lazy_group.conf"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_top500_ban_ad,node_top500_ban,node_top500_white_ad,node_top500_white,node_cnip_ad,node_cnip,node_direct_ad,node_proxy_ad,node_backcn_ad,node_backcn,node_user toneBlue
class node_ad_only,node_adb toneAmber
class node_lazy,node_lazy_group toneMint
class node_shadowrocket toneIndigo
```

## Components

### Routing profiles

- [Blacklist + ads](https://github.com/johnshall/shadowrocket-adblock-rules-forever/blob/release/sr_top500_banlist_ad.conf): `sr_top500_banlist_ad.conf`
- [Blacklist](https://github.com/johnshall/shadowrocket-adblock-rules-forever/blob/release/sr_top500_banlist.conf): `sr_top500_banlist.conf`
- [Whitelist + ads](https://github.com/johnshall/shadowrocket-adblock-rules-forever/blob/release/sr_top500_whitelist_ad.conf): `sr_top500_whitelist_ad.conf`
- [Whitelist](https://github.com/johnshall/shadowrocket-adblock-rules-forever/blob/release/sr_top500_whitelist.conf): `sr_top500_whitelist.conf`
- [China / abroad + ads](https://github.com/johnshall/shadowrocket-adblock-rules-forever/blob/release/sr_cnip_ad.conf): `sr_cnip_ad.conf`
- [China / abroad](https://github.com/johnshall/shadowrocket-adblock-rules-forever/blob/release/sr_cnip.conf): `sr_cnip.conf`
- [Global direct + ads](https://github.com/johnshall/shadowrocket-adblock-rules-forever/blob/release/sr_direct_banad.conf): `sr_direct_banad.conf`
- [Global proxy + ads](https://github.com/johnshall/shadowrocket-adblock-rules-forever/blob/release/sr_proxy_banad.conf): `sr_proxy_banad.conf`
- [Return to China + ads](https://github.com/johnshall/shadowrocket-adblock-rules-forever/blob/release/sr_backcn_ad.conf): `sr_backcn_ad.conf`
- [Return to China](https://github.com/johnshall/shadowrocket-adblock-rules-forever/blob/release/sr_backcn.conf): `sr_backcn.conf`

### Ad filtering

- [Ad-only rules](https://github.com/johnshall/shadowrocket-adblock-rules-forever/blob/release/sr_ad_only.conf): `sr_ad_only.conf`
- [Ad-filter rules](https://github.com/johnshall/shadowrocket-adblock-rules-forever/blob/release/sr_adb.conf): `sr_adb.conf`

### Convenience profiles

- [Lazy configuration](https://github.com/johnshall/shadowrocket-adblock-rules-forever/blob/release/lazy.conf): `lazy.conf`
- [Lazy with policy groups](https://github.com/johnshall/shadowrocket-adblock-rules-forever/blob/release/lazy_group.conf): `lazy_group.conf`

### Other components

- **Shadowrocket user**
- **Shadowrocket**

## Connections

- Shadowrocket user → Shadowrocket: imports configuration (evidence: `readme.md`)
- Shadowrocket user → Blacklist + ads: selects and downloads (evidence: `readme.md`)
- Shadowrocket user → Blacklist: selects and downloads (evidence: `readme.md`)
- Shadowrocket user → Whitelist + ads: selects and downloads (evidence: `readme.md`)
- Shadowrocket user → Whitelist: selects and downloads (evidence: `readme.md`)
- Shadowrocket user → China / abroad + ads: selects and downloads (evidence: `readme.md`)
- Shadowrocket user → China / abroad: selects and downloads (evidence: `readme.md`)
- Shadowrocket user → Global direct + ads: selects and downloads (evidence: `readme.md`)
- Shadowrocket user → Global proxy + ads: selects and downloads (evidence: `readme.md`)
- Shadowrocket user → Return to China + ads: selects and downloads (evidence: `readme.md`)
- Shadowrocket user → Return to China: selects and downloads (evidence: `readme.md`)
- Shadowrocket user → Ad-only rules: selects and downloads (evidence: `readme.md`)
- Shadowrocket user → Lazy configuration: selects and downloads (evidence: `readme.md`)
- Shadowrocket user → Lazy with policy groups: selects and downloads (evidence: `readme.md`)
- Blacklist + ads → Shadowrocket: provides rules (evidence: `readme.md`)
- Blacklist → Shadowrocket: provides rules (evidence: `readme.md`)
- Whitelist + ads → Shadowrocket: provides rules (evidence: `readme.md`)
- Whitelist → Shadowrocket: provides rules (evidence: `readme.md`)
- China / abroad + ads → Shadowrocket: provides rules (evidence: `readme.md`)
- China / abroad → Shadowrocket: provides rules (evidence: `readme.md`)
- Global direct + ads → Shadowrocket: provides rules (evidence: `readme.md`)
- Global proxy + ads → Shadowrocket: provides rules (evidence: `readme.md`)
- Return to China + ads → Shadowrocket: provides rules (evidence: `readme.md`)
- Return to China → Shadowrocket: provides rules (evidence: `readme.md`)
- Ad-only rules → Shadowrocket: provides rules (evidence: `readme.md`)
- Lazy configuration → Shadowrocket: provides configuration (evidence: `readme.md`)
- Lazy with policy groups → Shadowrocket: provides configuration (evidence: `readme.md`)
