device-analyzer-pro

Checks Android TV boxes, Android phones and iPhones for two things: is the device really what the seller claims, and is anything on it that should not be (malware, adware, stalkerware, known spyware, hidden management). Formerly android-cleaner; the iPhone side is in ios/.

A read-first methodology (packaged as a Hermes skill; the scripts are plain adb and run anywhere) for auditing Android TV boxes and Android phones — including counterfeit phones sold through Alibaba and Amazon marketplace listings — for:

  • Preinstalled malware, adware or spyware (BADBOX-family firmware that phones home on boot).
  • Spoofed build fingerprints that claim to be a certified Google device to forge Play Protect certification.
  • Fake specs: RAM, storage, CPU cores or display claims that measurement does not support.

It shows how to measure what hardware is really present, whether the advertised specs and certification are real, what is making network connections at idle, and how to disable or remove the problem packages, least-destructive step first.

Scope

Defensive use on a device you own, or one you are working on with the owner's consent. The audit phase is entirely read-only. Removal is a separate, per-package, confirmed step. The skill does not root, modify firmware, or attack anything.

The scripts only speak adb, so the same audit works on a phone: adb -s <serial> scripts/spec-truth.sh. Counterfeit phones sold on Alibaba or Amazon fake the same numbers as cheap boxes, so phases 1 and 2 (hardware and spec truth) apply unchanged; phase 3 is box-framed but still catches a phone wearing another model's identity. Phases 4, 4b and 4c apply to any Android device. On a phone that is behaving oddly, start with 4c, then references/phone-playbook.md for counterfeit hardware, sideloads, accessibility abuse and device-admin droppers.

Requirements

  • adb (Android platform-tools) on your computer.
  • The device reachable over adb (USB debugging, or adb connect <ip>:5555 with the prompt accepted on the device).

Or no computer at all: the scripts run on the phone itself in Termux through Shizuku's rish — the same shell privileges as adb, no root. See references/shizuku.md.

Quick start

adb connect <device-ip>:5555     # or USB
adb devices -l

# One-shot read-only report (phases 1-4):
scripts/report.sh > audit.md

# Or run the phases individually:
scripts/hw-truth.sh              # real SoC, cores, GPU
scripts/spec-truth.sh            # measured RAM / storage / display vs advertised
scripts/fingerprint-check.sh     # spoofed fingerprint / borrowed certification
scripts/pkg-audit.sh             # flag IOC-listed and silent phone-home packages
scripts/staging-check.sh         # the machinery that stages or re-drops payloads
scripts/net-watch.sh             # what the device connects to at idle
scripts/drm-level.sh             # Widevine L1 vs L3

# Measure real flash capacity (writes capped test data into a temp dir, then deletes it):
scripts/storage-verify.sh - 128  # 128 = advertised GB

# On the phone itself (Termux + Shizuku), no PC:
export DEVICE_ANALYZER_ONDEVICE=1
scripts/report.sh > audit.md

Then follow references/remediation-playbook.md to disable or remove findings safely. The desktop app's Clean up apps window does the same one app at a time (see below).

Report a bug

Press Report a bug in the app, or open https://git.edt-labs.xyz/cybertr0n/Device-Analyzer-Pro/issues/new (a free account on git.edt-labs.xyz). Say what device it was, what you did and what happened, and attach the report from the Reports folder if there is one (check it for anything private first). No account? Email [email protected].

Security problem, or a report with private details (serial numbers, account names, IP addresses)? Don't post it as an issue, since issues are visible to other users: email [email protected] instead.

Clean up bloatware

After an Android scan, press Clean up apps in the desktop window (Linux and Windows). It lists the preinstalled apps on this device that are known malware (from references/ioc-packages.txt) or known bloatware (from references/bloat-packages.txt: hidden installers, ad and tracking services, sponsored and trial apps, Google extras), and lets you act on one app at a time:

  • Disable — the app stops running. Gentlest; undo with Restore.
  • Remove — taken away for this user (pm uninstall -k --user 0). The original stays in the firmware, so Restore or a factory reset brings it back. Nothing in /system is touched; no root.
  • Restore — turns a disabled app back on, or reinstalls a removed one (install-existing).

Every change asks first, is checked on the device afterwards, and is written to debloat-history.jsonl in the settings folder. The core system, the active home screen, the keyboard in use and device admins are never offered. Tick Also list every other preinstalled app to see the rest, marked "You may use this". The same thing from a terminal:

python3 app/debloat.py SERIAL list            # what can be cleaned (--all for every preinstalled app)
python3 app/debloat.py SERIAL disable com.facebook.appmanager
python3 app/debloat.py SERIAL remove  com.facebook.appmanager
python3 app/debloat.py SERIAL restore com.facebook.appmanager
python3 app/debloat.py SERIAL history

A payload that comes back after a reboot lives in the firmware; see references/remediation-playbook.md, step 4.

Running without a PC (Shizuku)

The same scripts run on the phone in Termux as the ADB shell user through Shizuku's rish:

export DEVICE_ANALYZER_ONDEVICE=1
scripts/report.sh > audit.md

rish is uid 2000 — exactly what adb shell already is, not root. It removes the cable, not a privilege limit: another app's data directory, /data/adb and /system stay unreadable. Setup, the privilege table and the limits: references/shizuku.md.

Layout

  • SKILL.md: the full methodology (what each phase checks and why). Read this first.
  • scripts/: read-only audit scripts, the staging check, the capacity check, the report assembler, the IOC feed updater, and lib.sh (shared adb preflight, sourced by the others).
  • references/: SoC decoder, fake-spec playbook, BADBOX indicator lists (badbox-iocs.md, ioc-packages.txt, ioc-domains.txt), the uncited device-specific leads (case-observed.txt, never used to flag), the open-source feed list (feeds.txt), the phone playbook (phone-playbook.md), the on-device transport and its limits (shizuku.md), and the remediation playbook.
  • tests/: bash tests/run-tests.sh runs syntax checks, no-device exit checks and fake-adb behavior tests, the iPhone and app suites, the Windows tests, and then the whole suite again through the Python engine (DAP_ENGINE=python). No device is needed.
  • ios/: the iPhone side (see below): scripts/, references/ios-playbook.md, and its own tests against a fake pymobiledevice3.
  • app/: the desktop app: core.py (engine), the GTK window (Linux), the tkinter window (device_analyzer_tk.py, Windows), pychecks/ (the checks in Python, same output as the scripts), winplat.py (Windows device detection).
  • windows/: installer (Install.cmd / setup.ps1), launcher and Windows notes.

Desktop app

app/install-desktop.sh      # once: "Device Analyzer Pro" icon on the Desktop and in the app menu

Double-click the icon, plug in a phone (Android with USB debugging on, or an iPhone), answer the questions it asks, read the findings, press Disconnect, unplug. Reports land in ~/Documents/Device Analyzer Reports.

Windows

Double-click windows\Install.cmd, then start Device Analyzer Pro from the desktop. Same window and checks, no bash or WSL needed: the checks run through their Python port (app/pychecks/), devices are found through Windows' own APIs. Details, driver tips and what has been tested: windows/README.md.

iPhones

ios/scripts/ios-setup.sh --install-watcher   # once: tools in a venv + plug-in watcher (no sudo)
# plug the iPhone in, unlock it, tap Trust. The watcher updates the tools for its iOS version,
# refreshes spyware indicators and tells you when it is ready. Then:
ios/scripts/report.sh - 256 > iphone.md      # quick read-only audit (256 = advertised GB)
ios/scripts/spyware-scan.sh --enable-encryption   # deep check: backup + MVT

An iPhone cannot be cleaned from a computer; the report tells you what to remove on the phone and ios/references/ios-playbook.md says how. An "iPhone" that answers adb is an Android counterfeit.

Keeping the domain list current

Two files feed the domain comparison in net-watch.sh:

  • references/ioc-domains.txt — curated. Hand-edit it; every entry ends with the public report it came from.
  • references/ioc-domains.feed — generated. scripts/ioc-update.sh downloads the open-source feeds listed in references/feeds.txt (URLhaus by default) and rewrites it. The file is gitignored because it goes stale, so fetch it when you need it.
scripts/ioc-update.sh --check                              # verify each feed URL still answers HTTP 200
scripts/ioc-update.sh --dry-run                            # how many hosts the feeds yield now
scripts/ioc-update.sh                                      # download and rewrite the feed
scripts/ioc-update.sh --from saved-list.txt --out /tmp/x   # offline, from a list you already have

To keep the list warm between audits, let cron refresh it weekly:

30 5 * * 1 cd /path/to/device-analyzer-pro && ./scripts/ioc-update.sh >> ~/.device-analyzer-pro-ioc-feed.log 2>&1

That runs Mondays at 05:30 and appends the host count to the log. When every feed fails, ioc-update.sh exits non-zero and leaves the previous feed in place, so a dead upstream never wipes your list. net-watch.sh also prints the feed's age and warns once it is more than two weeks old, so a refresh job that quietly died surfaces during the audit rather than shrinking coverage unnoticed. The script is committed executable (100755); if your copy is not, chmod +x scripts/ioc-update.sh.

Add a feed by pasting its raw URL into references/feeds.txt; hosts-file, AdGuard and plain one-domain-per-line formats are all accepted, and a feed that stops answering is reported and skipped. Run scripts/ioc-update.sh --check to test every enabled URL at once without downloading anything: it prints each feed's HTTP status and host count and exits non-zero if any of them is dead, so a weekly cron job or CI can catch a source that quietly stopped publishing. net-watch.sh resolves the device's observed IPs backwards and looks for the resulting name, or any parent domain, in both files, so a ten-thousand-entry feed costs one lookup per observed socket rather than one per entry. A feed hit means "look closer": those entries are generic malware hosts, not box-specific indicators.

Malware staging mechanisms

A name-based scan answers "what already ran". scripts/staging-check.sh answers "what can still arrive", which is what decides whether a cleanup holds. It looks for the mechanism rather than another indicator:

  • Drop zones — executables and installables in /data/local/tmp, Download and app caches. /data/local/tmp is where adb push lands and nothing legitimate is executable there; an APK in Download on a phone is usually the owner's own file, so it stays a lead.
  • Staged scripts — a readable .sh or extension-less file in /data/local/tmp containing curl, wget, base64, /dev/tcp, chmod, pm install, or app_process/dalvikvm (runs a dex or jar without installing anything). That is a downloader, a decoder or an installer written as a script.
  • APKs installed from outside the app directories — a package whose path is under /data/local/tmp or /sdcard was staged first and installed second.
  • Dropper privilege — INSTALL_PACKAGES granted (installs with no prompt, normally only the OEM updater) versus REQUEST_INSTALL_PACKAGES requested (prompted installs, ordinary).
  • Open install vectors — network adb listening, adb-install verification off, the package verifier off, and non-store installers.
  • Boot hooks — /data/adb/service.d (Magisk runs every script there as root at boot) and a downloader inside /system/etc/install-recovery.sh.

STRONG means the mechanism is present with no ordinary explanation on a consumer device; lead means it is common enough that you confirm it first. The script prints a summary count and its own notes on what it cannot see.

Important limits

  • getprop can lie. /proc, df and a write test cannot, so the scripts trust measurement.
  • pm disable-user and pm uninstall --user 0 remove payloads for the user but leave the APK in firmware. A factory reset can bring firmware-resident code back. If a payload returns after a reboot, it lives in /system or the bootloader, and the honest fix is a trusted replacement or returning the device. The tool reports this rather than claiming a full clean.
  • A payload that returns is being re-dropped. Removing an app while its stager stays only resets the clock. Without root the shell user cannot read another app's private code_cache, so an app that stages dex inside its own storage is invisible to staging-check.sh; that gap is a limit of the check, not a clean result.
  • The indicator lists go stale. Re-verify names and domains against current vendor and researcher reporting before acting on a match. Only add an entry with a public citation.

License

MIT. See LICENSE. Contributions of sourced indicators and SoC mappings welcome.

S
Description
Read-only audit and cleanup for Android TV boxes sold with preinstalled BADBOX-family payloads.
Readme MIT
645 KiB
0 Stars 1 Watchers 0 Forks
Languages
Python 71.4%
Shell 26%
PowerShell 2.4%
Batchfile 0.2%