This repository contains a tool to automatically generate and update a hosts file for blocking Ad-Shield related domains.
The main script analyzes obfuscated Ad-Shield scripts to extract delivery domains. These domains are then formatted into a standard hosts file structure (0.0.0.0 domain) to be used as a blocklist for advertisements and tracking.
index.js: The core logic for domain extraction. It fetches the script, deobfuscates it, traverses the AST to find specific patterns, and outputs the found domains.hosts: The generated blocklist file containing the extracted domains..github/workflows/generate.yml: A GitHub Actions workflow that runs periodically to update thehostsfile and commit changes automatically.package.json: Defines the project dependencies.
To generate the list locally:
-
Install dependencies:
npm install
-
Run the script:
node index.js
The project includes a GitHub Action (generate.yml) that:
- Runs every hour.
- Executes the generation script.
- Updates and sorts the
hostsfile. - Commits and pushes any changes to the repository.