ALERTA360 Personal Security App
A sophisticated mobile personal safety application designed to protect users precisely when they cannot protect themselves. ALERTA360 introduces breakthrough innovations including silent activation via hardware buttons, a fake shutdown mode that continues recording even when the device appears powered off, and real-time multi-modal evidence streaming. Built with Flutter and native Kotlin for Android, the app targets urban citizens in high-risk situations including taxi passengers, delivery workers, and individuals facing domestic threats.
Key Features
-
Silent Emergency Activation - Implemented hardware-level volume button pattern detection (3 rapid presses within 1.5 seconds) that triggers protection without any visible screen interaction, allowing users to activate emergencies discreetly while the phone remains in their pocket or held casually
-
Fake Shutdown Mode - Engineered a stealth protection feature that displays a convincing device shutdown animation while secretly continuing audio recording and GPS transmission, transforming a seemingly powered-off phone into an undetectable tracking and evidence-gathering device
-
Guardian Shield UI Component - Developed a signature animated breathing shield widget with status-based colors (teal for protected, amber for alert, blue for practice mode) featuring hold-to-activate SOS functionality with haptic feedback and smooth wave animations
-
Emergency State Machine - Architected a robust Riverpod-powered state machine managing the complete emergency lifecycle: idle, activation, grace period countdown, active emergency, recovery verification, and safe confirmation with full crash recovery via Drift persistence
-
Grace Period Cancellation Flow - Implemented a 15-second configurable cancellation window with multiple cancel methods: on-screen button hold (1 second) or silent volume UP 3x pattern for discrete cancellation without alerting nearby threats
-
Practice Mode - Built a safe simulation environment allowing users to test all emergency features including activation patterns, grace periods, and the Guardian Shield interaction without triggering real alerts or notifying emergency contacts
-
Multi-Modal Evidence Collection - Designed architecture for simultaneous capture and streaming of audio, video, GPS location, and contextual metadata with local caching for network failures and automatic retry with exponential backoff
-
Taxi Guardian Integration - Implemented QR code scanning for driver verification with mock data for MVP, associating trip information with emergency records and enabling silent activation during monitored rides
Technical Implementation
Cross-Platform Architecture with Native Integration
The application follows a hybrid Flutter/Kotlin architecture where business logic, UI, and Firebase integration reside in Flutter while performance-critical and OS-level features are implemented in native Kotlin. The boundary is strictly defined through Pigeon-generated type-safe platform channels, ensuring contract integrity between Dart and Kotlin code.
The native layer includes an EmergencyForegroundService that survives app kills and maintains emergency state, a VolumeButtonReceiver for hardware button interception operating even with screen off, and a FakeShutdownActivity that overlays a convincing power-off animation while the background service continues evidence capture. This architecture ensures protection functionality works regardless of UI state.
State Management and Offline-First Design
Riverpod 3.x with code generation powers state management across the app, using AsyncNotifier patterns for complex async flows and StreamProvider for Firebase real-time data. The emergency state machine uses a keepAlive provider ensuring persistence across navigation, with all timers properly registered for disposal to prevent memory leaks.
An offline-first architecture using Drift (SQLite) guarantees evidence is never lost due to network failures. Emergency state persists locally and synchronizes with Firestore when connectivity returns. A 7-day offline grace period (ADR-008) ensures emergency activation works even if Firebase authentication tokens expire, prioritizing user safety over session management.
Volume Button Detection System
The volume button pattern detection operates at the system level through a Kotlin MediaSession implementation that intercepts hardware key events before they reach the system volume control. The detector tracks press timestamps within a configurable window (default 1500ms), firing pattern completion callbacks when the threshold is reached. A reverse pattern (volume UP 3x) enables silent cancellation during grace periods.
Platform channels using Pigeon provide type-safe callbacks from Kotlin to Flutter, triggering the emergency state machine with appropriate activation triggers (volumePattern, sosButton, gestureBackup). The implementation handles edge cases including debouncing rapid triggers, detection while screen is off, and pattern reset after partial matches.
Guardian Shield Component Architecture
The signature Guardian Shield widget implements complex animation choreography using multiple AnimationController instances: a breathing controller for continuous wave animations, a hold controller for SOS activation progress, and a color transition controller for smooth state changes. The implementation uses WidgetsBindingObserver to pause animations when backgrounded for battery efficiency and checks MediaQuery.disableAnimations to respect system accessibility settings.
Three wave layers create a ripple effect using staggered linear animation offsets (0%, 33%, 67%) that expand and fade continuously. A dedicated color transition controller (300ms duration) prevents color oscillation during the main animation cycle. The component supports full accessibility with semantic labels and custom CustomPainter for the circular progress ring during hold gestures.
Firebase Backend Integration
The app integrates with Firebase services for authentication (phone number verification), Firestore (user profiles, emergency records, contact management), Storage (evidence file uploads), and FCM (push notifications to emergency contacts). Firestore collection structure uses a hybrid flat/nested approach with strict snake_case field naming enforced through @JsonKey annotations and security rules that reject camelCase documents.
All Firestore document models use Freezed for immutable state and JSON serialization. Evidence storage follows a date-organized path structure (/evidence/{YYYY-MM}/{emergencyId}/{type}/{file}) enabling easy 90-day retention cleanup. Firebase Security Rules enforce privacy with separate /private/ subcollections for PII and ownership validation for all writes.
Development Workflow
The project follows a feature-first folder structure with controllers, views, state classes, and widgets organized by domain. Build tooling uses Flutter’s standard build system with build_runner orchestrating code generation for Riverpod, Freezed, Drift, and Pigeon in a single command. CI/CD pipelines through GitHub Actions run linting, formatting checks, tests, and build verification on every push.
The native Kotlin codebase follows Android best practices with foreground service type declarations for Android 14+ compliance, proper permission handling for background location and microphone access, and battery optimization exemption guidance for aggressive OEMs like Xiaomi and Huawei.
Business Impact
ALERTA360 addresses a critical gap in personal safety technology: traditional panic apps become useless the moment an attacker sees a phone screen or takes the device. The fake shutdown innovation transforms this dynamic—the victim’s phone becomes a silent witness rather than a vulnerability, continuing to gather evidence even when confiscated.
The unified protection engine architecture proves platform scalability by powering multiple emergency contexts (taxi safety, street theft, covert recording) from a single intelligent system. This positions the app for B2B partnerships with taxi companies, municipalities, and security firms seeking customizable safety solutions for their users or employees.
The MVP targets a 5-minute investor demo showcasing three flows: Taxi Guardian (scan, monitor, silent activate), Street Theft (button pattern, evidence capture), and Fake Shutdown (the “jaw-dropper” climax). Success is measured by investor commitment after experiencing protection that works when users cannot protect themselves.
Security Architecture
Evidence integrity uses SHA-256 hashing at capture time with server-verified timestamps for legal admissibility. Per-session AES-256 encryption keys stored in Android Keystore provide hardware-backed protection for local evidence files. All data in transit uses TLS 1.3 with SRTP for real-time streams.
The threat model addresses fake shutdown detection risks (thermal signatures, LED indicators, network traffic patterns) with documented mitigations. Charging LEDs are disabled during stealth mode, and evidence upload uses chunked transmission with minimal packet frequency. User-configurable activation patterns and owner-only confirmation vibrations prevent pattern predictability attacks.