Preflight: Auditing Android Apps with a $0, On-Device, Open-Source Pipeline
Every Android developer knows the dread of a Play Store rejection, a debuggable build that slipped through, a targetSdk that's too old, a QUERY_ALL_PACKAGES permission that trips policy review, or a third-party ad SDK quietly siphoning user data. The usual tooling for catching these problems is fragmented and cloud-based, and too often it wants an API key, a paid subscription, or your APK uploaded to someone else's server.
Preflight takes the opposite approach: an open-source, on-device pre-submission auditor that never sends your code anywhere. Point it at an APK, a public GitHub repo, or its own installed package, and it runs a full static-analysis pipeline locally, manifest and permission inspection, Play-policy rule checks, accessibility gaps, APK/dex size and ABI footprint, and an Exodus-Privacy-style byte-scan of classes*.dex for ~20 known tracker-SDK signatures.
The core auditor is fully free and open, and runs on any device. Where a device supports on-device generative AI, Preflight hands the findings to Gemini Nano (via Google's ML Kit GenAI Prompt API) to write a reviewer-style verdict, entirely on-device, at zero inference cost. This is the one proprietary dependency in the stack, and it's optional: on devices without Nano, a deterministic rule-based engine produces the same verdict. Either way you get an animated report , a 0–100 score, a letter grade, prioritized fixes with explanations, and a "+26 since last scan" delta, rendered locally and shareable as Markdown.
The constraint that shaped every decision: no server, no API keys, no code or APK ever leaves the device, total running cost $0. That constraint isn't a limitation, it's the feature, it's what makes the privacy story verifiable instead of merely promised. The app ships with exactly one permission (INTERNET, used only for anonymous public-GitHub fetches), no analytics, and no crash SDKs. Because the whole thing is open source under https://github.com/Abhijeet6395/Preflight--The-App-Reviewer , every one of those claims can be checked against the code rather than taken on trust.
Architecturally, Preflight is one shared codebase in Kotlin Multiplatform and Compose Multiplatform, targeting both Android and iOS, following a strict MVI pattern (a single immutable StateFlow per screen, intents in, effects out). I'll walk through the engineering decisions and trade-offs: how the staged pipeline is modeled as a Flow the UI animates against, how on-device LLM inference is wired in with a graceful fallback, the input-hardening needed to safely parse untrusted APKs (zip-bomb guards, size caps), and the dependency landmines along the way, such as a Ktor release that silently broke Android dexing. Compose-driven animation an animated score gauge, a radar-scan effect, typewriter AI text via Compottie, the KMP Lottie renderer, ties it into something genuinely pleasant to use.
You'll leave understanding how to build a privacy-respecting developer tool from entirely free and open building blocks, and why "on-device" is becoming the most honest answer to the trust problem in AI tooling.