PhoneVitals
Forensic Analysis and Diagnostics of Android Phones over USB
Abstract
Anyone buying a second-hand phone asks the same questions: is it genuine, has it been opened, and what has been replaced? The answers a phone gives about itself, such as its system properties, are easy to fake. PhoneVitals answers these questions by relying on checks that are hard to fake.
It is a desktop application that analyzes an Android phone connected over USB, with no root and no app installed on the phone. It collects the real specifications, cross-checks the device against itself, measures the condition of its components, runs functional tests and shows live sensor data. The result is a report in PDF and JSON. Results are always indicative: the program never declares a device authentic.
Architecture
flowchart LR
P[Android phone] -- adb over USB --> A[adb layer<br/>device watcher]
P -. temporary agent .-> AG[On-device agent<br/>32 KB dex, shell UID]
AG --> A
A --> C[Collectors<br/>one per area]
C --> AN[Analyzer]
AN --> E[Authenticity engine<br/>IMEI · attestation · spec catalogue]
AN --> TS[Test suite<br/>automatic + guided]
AN --> DB[(Local memory<br/>salted hashes)]
E --> S[Local server<br/>127.0.0.1]
TS --> S
S --> UI[Desktop UI]
S --> R[PDF / JSON report]
To read sensors at about 60 Hz, GNSS and key attestation, PhoneVitals pushes a tiny agent (a 32 KB dex file) to the phone’s temporary directory and runs it with shell privileges. It installs no app, does not survive a reboot and is deleted at the end of the session.
Engineering Highlights
Three evidence levels
Every finding is labeled, so that hard facts are never mixed with guesses:
- Certain: structural and cryptographic checks. These include the IMEI checksum, agreement between the identities declared by five system partitions (a rebranded phone usually edits only one), build fingerprint vs declared model, Verified Boot and bootloader state, and the Samsung Knox fuse.
- Measured: values read from the kernel, such as real CPU cores and frequencies, RAM, storage and display, compared against a catalogue of expected specifications.
- Indication: usage statistics and heuristics. For example, battery health is reported as not measurable rather than a reassuring 100% when the fuel gauge only repeats the design capacity.
Hardware key attestation, verified offline
The phone’s hardware-backed attestation certificate chain is verified signature by signature, offline, up to Google’s attestation roots, and checked against Google’s revocation list. Both ship with the program. A phone with original hardware but an unlocked bootloader or a custom ROM (e.g., GrapheneOS or LineageOS) gets a dedicated Modified verdict instead of being called fake.
Reading the IMEI without root
Since Android 10, the shell can no longer read the IMEI directly. PhoneVitals types *#06# into the dialer as key events, because the dialer only reacts to typed digits, and reads the resulting dialog through UI automation. On phones whose hardware attests its identifiers, the IMEI arrives signed instead.
Functional tests
Automatic tests cover the inertial sensors at rest, vibration (detected by the phone’s own accelerometer), Wi-Fi, storage write speed, charging current, all CPU cores under a 30 s load, loudspeaker and microphone (heard by and played from the PC), Bluetooth, mobile network and GNSS. Guided tests cover touch and stylus. A test that cannot decide reports inconclusive, never failed. Battery capacity is estimated by integrating the charging current over whole percent steps.
Privacy and report integrity
- The local memory stores IMEI, serial and component IDs only as salted SHA-256 hashes. That is still enough to notice a cloned IMEI or parts swapped between two visits, and to compare a phone trait by trait with a known reference unit of the same model.
- The PDF report embeds the SHA-256 of the canonical JSON report, so any later edit is detectable.
- The local server only listens on loopback, authenticates the UI with a per-launch token exchanged for a strict cookie, and checks the
Hostheader against DNS rebinding.
Technical Notes
- Stack: Python (FastAPI) backend, Svelte UI in Electron, adb over USB.
- Distribution: Snap Store (
snap install phonevitals), plus.deb,.dmgand.exebuilds. CI checks version consistency, runs the backend tests (engine, attestation, collectors), builds the UI and the snap, and runs the store review. - License: Apache-2.0.
Limitations
PhoneVitals does not check whether a phone is reported stolen (that requires paid GSMA/CEIR access), and it cannot detect a part replaced with an identical original. The catalogue of expected specifications is incomplete, so a mismatch is a suspicion rather than a verdict, and reading the IMEI requires an unlocked screen.