On-device Android environment integrity diagnostics backed by Kotlin and native probes.
Download Nightly · Documentation · SDK Integration
# Overview DuckDetector collects and correlates security-relevant evidence on an Android device. It looks for boot-state changes, root and SU artifacts, runtime injection or hooking, mount namespace anomalies, modified system properties, suspicious applications, KeyStore and attestation inconsistencies, and signs of virtualization. The app combines a Jetpack Compose interface, feature-oriented Gradle modules, and a native C++/assembly library. The same detectors are also published as a UI-free SDK AAR that other applications can embed. Results are diagnostic signals, not an authoritative statement that a device is secure or compromised. # Quick start 1. **Download** the APK from the [Nightly release](https://github.com/eltavine/Duck-Detector-Refactoring/releases/tag/nightly). Nightly builds are published from `main` and are also posted to the [Telegram channel](https://t.me/duck_detector); there is no stable release yet. 2. **Install** it on a device running Android 10 or later. Root access is not required. 3. **Scan.** The first launch asks you to accept the user agreement and to settle a few startup choices: notifications, Live Update, the online revocation refresh used by the TEE check, and package visibility. Scanning then starts by itself, and each card fills in when its detector finishes. 4. **Read the results** as described below. To report a result or ask for help, [open an issue](https://github.com/eltavine/Duck-Detector-Refactoring/issues) and attach the file saved by **Export Report** at the top of the dashboard; a screenshot of the summary alone is not enough. ## Reading the results Each card shows one of these statuses: | Status | Meaning | | :--- | :--- | | **Danger**, **Warning** | The detector observed evidence; the card lists what it saw. | | **All Clear** | The probes ran and found none of the evidence they look for. This does not prove that the device is unmodified. | | **Info** (Support) | A probe was unsupported or unavailable on this device, so the absence of findings says nothing. | | **Info** (Error) | The check failed; the card says why. | To see what a detector looks for and why that counts as evidence, open its evidence record from [Detector coverage](#detector-coverage). # Detector coverage Current feature areas, each linked to its evidence record, which explains what the detector looks for, why that counts as evidence, and what it cannot see: [`ADB Runtime`](./feature/adbruntime/EVIDENCE.md) · [`Bootloader`](./feature/bootloader/EVIDENCE.md) · [`Custom ROM`](./feature/customrom/EVIDENCE.md) · [`Dangerous Apps`](./feature/dangerousapps/EVIDENCE.md) · [`Kernel Check`](./feature/kernelcheck/EVIDENCE.md) · [`LSPosed`](./feature/lsposed/EVIDENCE.md) · [`Memory`](./feature/memory/EVIDENCE.md) · [`Mount`](./feature/mount/EVIDENCE.md) · [`Native Root`](./feature/nativeroot/EVIDENCE.md) · [`Play Integrity Fix`](./feature/playintegrityfix/EVIDENCE.md) · [`Root Managers`](./feature/rootmanagers/EVIDENCE.md) · [`SELinux`](./feature/selinux/EVIDENCE.md) · [`SU`](./feature/su/EVIDENCE.md) · [`System Properties`](./feature/systemproperties/EVIDENCE.md) · [`TEE`](./feature/tee/EVIDENCE.md) · [`Virtualization`](./feature/virtualization/EVIDENCE.md) · [`Zygisk`](./feature/zygisk/EVIDENCE.md) The SELinux area also retains an app-zygote SID-table query/registration experiment. Repeated discrepancies are supporting warnings; synchronized policy hiding can leave no discrepancy. Controlled privileged-context writes run in a disposable child with malformed/stock controls; recognition and ordinary-app timing are supporting warnings, an app-zygote AVC lookup-count profile is informational only, and negative observations cannot exclude hidden policy. Access failures and incomplete experiments remain explicit coverage states. See the [SELinux evidence record](./feature/selinux/EVIDENCE.md) for source references and device-validation limits. `Play Integrity Fix` refers to local indicators associated with integrity-spoofing modifications; DuckDetector does not return an official Google Play Integrity API verdict. The TEE area evaluates Android KeyStore and attestation evidence, including certificate chains, security levels, revocation data, and selected KeyMint, StrongBox, and Soter behavior where supported. Native Root also offers an optional [fsnotify SRCU timing experiment](feature/nativeroot/SRCU_TIMING.md), disabled by default. It requires an explicit choice, uses a temporary private dynamic permission on supported Android 12–14 systems, and reports repeatable contention as supporting evidence. Its thresholds await device calibration; it does not identify KernelSU, and its private-process deadline cannot recover a blocked kernel. Supporting modules provide the dashboard, device information, settings, update checks, notifications, license information, and common UI infrastructure. # How it works - **Feature modules:** each detector owns its collection, judgement rules, report projection, and UI in its own Gradle modules, while collection code that several detectors share lives in capability modules. - **Early native capture:** a transparent `NativeActivity` runs before `MainActivity` and records early mount and virtualization evidence. - **Native probes:** the shared native library performs checks that require direct system calls, `/proc` inspection, timing measurements, linker/runtime visibility, or architecture-specific assembly. - **Process separation:** selected Zygisk, Mount, Native Root, virtualization, SELinux, LSPosed, and TEE checks run in dedicated or isolated services so evidence can be compared across process boundaries. - **Evidence correlation:** the dashboard reports individual findings and coverage states instead of treating one heuristic as conclusive. # Compatibility | Area | Details | | :--- | :--- | | **Android** | Android 10 or later (`minSdk 29`); compiled and targeted against Android API 37. | | **ABIs** | Native syscall paths are provided for `arm64-v8a`, `armeabi-v7a`, `x86`, and `x86_64`. Some timing and virtualization trap probes are available only on `arm64-v8a`. | | **Privileges** | Root access is not required. Android permissions and platform visibility rules still limit what the app can observe. | | **Device variance** | OEM changes, kernel configuration, Android version, and sandbox policy may cause a probe to be unsupported, unavailable, or lower-confidence. | | **Network use** | Core device scans run locally. TEE revocation checks always include the bundled snapshot; downloading Google's current revocation feed requires user consent. The app also checks GitHub for Nightly updates after a cold start and when requested from Settings. With GitHub acceleration on, which Chinese-language users are asked about and Settings can switch, those checks and the Nightly download go through the third-party [gh-proxy.com](https://gh-proxy.com/docs) service instead. | # Architecture ```text Duck-Detector-Refactoring/ ├─ app/ # UI composition root: activities, dashboard cards, notifications ├─ sdk/runtime/ # Headless composition root: detector catalog, scan API, process hooks, native library registry ├─ sdk/aar/ # The distributable SDK: every headless module fused into one AAR ├─ core/ # Contracts and shared infrastructure: evidence, native payloads, platform access, reports, scan lifecycle, detector, UI ├─ capability/ # Evidence collection shared by several detectors ├─ feature/ # One detector or supporting feature per directory, split into layers ├─ samples/sdk-consumer/ # A separate application built from the published AAR alone ├─ build-logic/ # Convention plugins, module boundary and dependency validation, generated assets ├─ uihelper/ # Pinned Git submodule: MIUIX / Material UI, included as a separate Gradle build ├─ docs/ # Architecture overview, guides, and follow-ups ├─ .github/policies/ # Module, native, detector touch point, reflection, and text protocol policies ├─ .github/scripts/ # Repository guards and their self-tests ├─ gradle/ # Version catalog and Gradle wrapper files ├─ scripts/ # Detector scaffold and repository maintenance scripts ├─ build.gradle.kts └─ settings.gradle.kts ``` Each detector is a set of Gradle modules under `feature/