rddmwmddr

android-ad-cleaner

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 PM
Downloads slow? Switch the source anytime above

README

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 devices lists connected serial numbers and models and marks whether a matching device recipe exists
  • check: python3 tool/run.py -s <serial> check performs a read-only inspection of exactly what would change
  • backup: python3 tool/run.py -s <serial> backup takes a pre-change snapshot stored under backups/<model>-<time>/
  • recipe: python3 tool/run.py -s <serial> recipe runs the whole device recipe automatically
  • chan-scan and chan-off: the first lists marketing notification channels, and the second reads channels.tsv to disable the chosen ones
  • quickapp: detects quick apps, and adding off disables them
  • finish and dev-off: finish gives the closing reminder, and dev-off --yes turns 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 suspend on packages such as com.opos.ads and com.miui.systemAdSolution, with owner confirmation
  • Quick app shutdown: detect quickapp and cut off the install-free mini apps that ads jump into
  • Device recipes: one recipes/<brand>-<model>/recipe.py per 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

  1. Enable developer options and USB debugging on the phone, then connect it with a cable
  2. Run pip3 install -r requirements.txt to install uiautomator2==3.7.1
  3. Run python3 tool/run.py devices to confirm the serial number and device recipe
  4. Run check first, then backup for a pre-change snapshot
  5. Run recipe for the full device script, then chan-scan and chan-off as needed
  6. Finish with finish and turn off developer mode when prompted; use dev-off --yes to 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, no pm disable-user, and no modules; only switches and pm 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-off may 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 --yes disconnects the device

Release history

Sort