Android Ad Evidence Capture & DSP Attribution
Automation Engineer / Python Engineer · Android advertising verification PoC
An automated Android ad-inspection system that captures creatives, UI evidence, click destinations, and network traffic to verify delivery paths and investigate DSP attribution such as Smadex.
View source & evidenceTamper-evident evidence bundles · 95.69% coverage across 90 tests.
How it works
Launch
PowerShell + Python CLI
Control & detect
ADB + uiautomator2
Capture evidence
UI + screenshots + safe clicks
Capture network
ADB reverse + mitmproxy
Attribute & archive
Rules + JSONL + SHA-256
Problem
A screenshot cannot prove which buying platform delivered an ad, while dynamic creatives, stale intents, certificate restrictions, freezes, and non-rooted devices make reliable evidence collection difficult.
Solution
Built a dual-path pipeline: ADB and uiautomator2 record what users see and safely inspect interactions, while mitmproxy captures delivery-chain signals for rule-based correlation and tamper-evident archiving.
Key decisions
- Kept UI and network capture independent: Android automation proves what the user saw, while intercepted flows provide delivery-chain evidence.
- Required explicit Ad Info, redirect, client-signature, or reporting signals for confirmed DSP attribution; creatives alone remain candidates, never proof.
- Captured broadly, matched later, and recorded creative URLs without fetching them—preserving limited-window evidence without creating accidental impressions or clicks.
- Externalized provider indicators in JSON and separated attribution into confirmed, candidate, and not_detected states.
- Protected artifacts with append-only SHA-256 manifests, recorded measured geo metadata, and added ANR recovery, cold restarts, and proxy restoration for long sessions.
Tech stack
- Python 3.11
- uiautomator2
- ADB
- mitmproxy
- Pillow
- ImageHash
- PowerShell
- Pytest
- mypy
- JSON Lines
- SHA-256