android-ad-cleaner is a Python toolkit that turns off ads and marketing pushes on Chinese Android phones over adb, offering a command-line engine and a desktop client without root, with backups and rollback.
- v0.4.5
- Published at
- 8d ago
- 8,342
- Stars
- 44,753
- Download
- Synced at
- 8d ago
Latest release
v0.4.5Nov 18, 2026, 01:05 PMREADME
Project Overview
android-ad-cleaner is the equivalent of writing the manual process of digging through phone settings to disable ads as a repeatable script, except that it neither uninstalls nor disables system apps: it flips switches and suspends ad components with pm suspend. The toolkit is written in Python, connects over adb, and uses uiautomator2 to read screens and tap; the repository provides both the tool/run.py command-line entry point and Mac and Windows desktop clients. It targets system ad switches, search hot lists, negative-screen news, app store promo slots, marketing notification channels, and ad packages such as com.opos.ads and com.miui.systemAdSolution.
Switches only, no app removal, with a snapshot before changes and a path back afterwards.
Core Commands
- devices:
python3 tool/run.py deviceslists connected serial numbers and models and marks whether a matching device recipe exists - check:
python3 tool/run.py -s <serial> checkperforms a read-only inspection of exactly what would change - backup:
python3 tool/run.py -s <serial> backuptakes a pre-change snapshot stored underbackups/<model>-<time>/ - recipe:
python3 tool/run.py -s <serial> reciperuns the whole device recipe automatically - chan-scan and chan-off: the first lists marketing notification channels, and the second reads
channels.tsvto disable the chosen ones - quickapp: detects quick apps, and adding
offdisables them - finish and dev-off:
finishgives the closing reminder, anddev-off --yesturns off developer mode from the computer
Key Features
- System ad switches: handle personalized ads, ad tracking (OAID), and smart recommendation services in system settings
- Hot lists and news: disable pull-down search hot lists, negative-screen news, and browser feeds, and switch the browser to a simple home page
- Store promo slots: handle carousels, splash screens, floating campaigns, and check-in rewards in the app store
- Marketing pushes: disable content and marketing or promotional notification channels while keeping order, delivery, and update notifications from the same app
- Ad component suspension: run
pm suspendon packages such ascom.opos.adsandcom.miui.systemAdSolution, with owner confirmation - Quick app shutdown: detect
quickappand cut off the install-free mini apps that ads jump into - Device recipes: one
recipes/<brand>-<model>/recipe.pyper brand and model, recording entry labels, switch order, and items to keep - Backup and restore: take a snapshot before changes, with restore steps in
docs/05-还原.md
Target Audience
- Chinese Android users who want fewer ads without root
- Operations staff processing multiple phones in batches
- Users who let AI agents run the commands
- Cautious users who want to inspect the check result first
Quick Start
- Enable developer options and USB debugging on the phone, then connect it with a cable
- Run
pip3 install -r requirements.txtto installuiautomator2==3.7.1 - Run
python3 tool/run.py devicesto confirm the serial number and device recipe - Run
checkfirst, thenbackupfor a pre-change snapshot - Run
recipefor the full device script, thenchan-scanandchan-offas needed - Finish with
finishand turn off developer mode when prompted; usedev-off --yesto do it from the computer
If you do not want to install Python, use the desktop client instead: Mac builds ship as Apple silicon and Intel DMGs, and Windows 10 / 11 as an installer and a portable ZIP.
System Requirements
| Item | Requirement |
|---|---|
| Desktop client | macOS (Apple silicon / Intel), Windows 10 / 11 |
| Python dependency | uiautomator2==3.7.1 |
| Phone connection | Developer options and USB debugging enabled, connected over adb |
| Supported systems | Flyme, HarmonyOS (adb), MagicOS, ColorOS, HyperOS, OriginOS, Funtouch OS |
| Not supported | Native HarmonyOS connected over HDC |
Notes
- No system partition changes: no
pm uninstall, nopm disable-user, and no modules; only switches andpm suspend - Recipes match by version: settings pages differ between minor OS versions of the same brand, so the engine warns on a mismatch and skips entries it cannot find
- Some pages are skipped: certain vivo notification channel pages are permission-protected, so
chan-offmay not recognize them and the manual checklist applies - Keep the backup: pre-change snapshots live under
backups/, and a restore needs the backup for the matching model and time - Close developer mode: turn it off after processing, and note that
dev-off --yesdisconnects the device