ScreenshotDetector
ScreenshotDetector is an Android app-layer tool that detects screenshot, screen recording, screen mirroring, and casting activity using a combination of public APIs (ScreenCaptureCallback, ScreenRecordingCallback, DisplayManager, MediaProjection, ContentObserver/MediaStore, FileObserver, AccessibilityService, NotificationListenerService) and hidden APIs accessed via reflection (DisplayManagerGlobal.getDisplayInfo, WifiDisplayStatus, AppOps project_media/project_audio). It is positioned as a research counterpart to ScreenshotFaker (an LSPosed/Shizuku-based tool that forges/bypasses screenshot detection), illustrating the attacker/defender dynamic around screen-capture evasion on Android, including detection of adb shell screencap/screenrecord, freeform/mini-window attribution, and accessibility-overlay/screen-reader channel abuse detection.
What it is
ScreenshotDetector is an Android application-layer tool that detects screenshots, screen recording, audio recording, and casting/mirroring. The summary names the APIs; what it omits is the version boundaries, the permissions each detection requires, and the inference logic where AOSP hides the responsible app. Those are what an engineer evaluating detection reliability needs.
How it works
Detection paths degrade by Android version and granted permission, not uniformly:
- Key-press screenshots:
ScreenCaptureCallbackon Android 14+. On Android 11–13 it needs this app's Accessibility service to observeKEYCODE_SCREENSHOTfrom the global key stream — and only while the app is foregrounded. The fallback across versions is MediaStore attribution: a SystemUI writer row is annotated as a key-press screenshot. - Audio/recorder attribution: AOSP strips the recorder's identity, so
AudioManagerdetects that recording happens but not who. The source is suspected via "most-recently-used app × microphone permission × foreground-service start," with system-flow apps (Settings, launcher, permission dialog) excluded. With Accessibility enabled, real-time window events replace the "Usage access" dependency. The page states this suspicion may be inaccurate. - Recording/casting service: crosses two independent facts rather than naming heuristics — an app with an ongoing foreground-service notification that also owns a virtual display (
DisplayInfo.ownerPackageName) or holds persistentproject_mediaconsent. Android 14+ forces MediaProjection services to keep an ongoing notification, so a live recorder satisfies both.
flowchart TD
A[Ongoing foreground-service notification] --> C{Same package?}
B[Owns virtual display OR holds project_media consent] --> C
C -->|yes| D[Report as recorder/caster<br/>package name shown]
C -->|no| E[Not flagged]- Shell/ADB captures: a MediaStore row whose writer attribution is
com.android.shellis treated as a factual shell-channel capture (adb shell screencap/screenrecord), reported on separate cards. Because the write path and filename are unconstrained, the scan ignores screenshot/recording naming features — it coversDownload/and non-primary volumes.
Preconditions
- Recording/casting service detection requires Notification access.
- Key-press detection on Android 11–13 and improved audio attribution require this app's Accessibility service.
DisplayInfoandWifiDisplayStatusare hidden APIs reached by reflection;owner_package_namecross-app visibility "varies by ROM and degrades gracefully."- A 15-second lookback query at registration catches events just before the app opened.
Caveats
The author states this plainly: it is application-layer only, with limited capability against system-framework-level behavior, and is "intended as an auxiliary detection reference." The audio source suspicion can be wrong. Attribution visibility depends on the ROM. It is positioned as the research counterpart to ScreenshotFaker — treat it as a signal aggregator, not a guarantee.
Organisations named here
- Shizuku
Technologies named here
- ScreenshotDetector
- Android
- ScreenshotFaker
- LSPosed
- AOSP
- Xiaomi ROM
- ColorOS
Techniques named here
- Key-press screenshot detection
- Screen recording detection
- Audio recording detection
- Recording/casting service detection
- Screen mirroring detection
- Display attribution
- Miracast status detection
- MediaProjection monitoring
- Persistent projection consent detection
- Media library monitoring
- Shell / ADB screenshot detection
- Shell / ADB screen recording detection
- Device environment security checks
- Two-channel presentation classification
- Third-party capability-surface checks
- Screen-reader channel checks
- Dock / desktop mode detection
- File monitoring
- Accessibility overlay detection
- Auxiliary casting/mirroring detection
- Suspicious behavior detection
- Floating window detection
- Freeform window detection
- Focus loss detection
- Incomplete window presentation detection
- ScreenshotFaker feature detection
Related in Mobile Security
thomasbuilds/Spectre
