ShieldNotify: Privacy-First Notification Shield & App Locker
Notification previews on our phone lockscreen frequently leak private chat contents. Even with lockscreen previews turned off, opening a sensitive messaging app when passing your phone to a friend can compromise your privacy.
ShieldNotify is an ultra-premium, native Android application built with Kotlin and Jetpack Compose designed to secure sensitive apps and intercept private push notifications before they can be seen.
dYO? Visit the repository
🔒 Primary Features
- Notification Interception: Actively intercepts incoming notifications from protected apps (like WhatsApp, Telegram, or Discord), replacing private message bodies with custom placeholders (e.g. "1 new message").
- Universal Biometric Locker: Monitors the foreground application stream and launches an impenetrable biometric verification prompt (Fingerprint or Face Unlock) when a secured package opens.
- Instant Relocking: Listens for system screen-off events to immediately relock all protected applications, ensuring no access leaks.
- Anti-Uninstall Mode: Links to Android Device Administrator privileges to prevent unauthorized users from deleting the application to bypass lock screens.
🛠️ The Tech Stack
- UI Framework: Jetpack Compose implementing Material 3 layout components.
- Language: Kotlin, leveraging Coroutines and Flows for state updates.
- Dependency Injection: Hilt / Dagger for modular architectures.
- Persistence: Room Database with robust schema migration rules and DataStore.
- Android System APIs:
NotificationListenerServicefor push capture,UsageStatsManagerfor foreground app detection, and AndroidX Biometric prompt APIs.
🚀 Key Engineering Challenges
Reliable Foreground Monitoring
Unlike standard systems, security applications cannot afford lag in launching locking screens. I implemented a lightweight foreground tracking loop using the UsageStatsManager API. By optimizing dispatcher execution contexts in Kotlin Coroutines, I minimized tracking checks down to millisecond increments without causing CPU spikes or battery drains.
Notification Service Lifecycle
Android frequently terminates background services to free up memory. To ensure notification interception remains active constantly, ShieldNotify runs a persistent NotificationListenerService inside a persistent foreground worker model, displaying a subtle notification indicator to guarantee background execution.
🎓 What I Learned
ShieldNotify offered me a deep dive into the Android system security layer. Through this project, I mastered:
- Constructing reliable background foreground services and listener structures.
- Integrating biometric locks using the AndroidX Biometric library.
- Working with Device Policy rules and administrative system privileges.
- Managing lifecycle events, process termination, and auto-restart flags.
