Skip to content

Releases: jzsalinas/nugon-android

Nugon SOS v1.6 - Versión Hardening

Choose a tag to compare

@jzsalinas jzsalinas released this 30 Jul 13:39

Android 14+ Security Hardening

I have implemented critical security fixes to prevent SecurityException crashes on Android 14+ (API 34) and higher, ensuring a stable experience during the first run and background startup.

Technical Fixes for Modern Android

1. Permission-Aware Service Startup

Android 14 introduced strict requirements for starting Foreground Services (FGS) from the background. We addressed this with:

  • Startup Guard: Removed the immediate service start in MainActivity#onCreate. The monitor now only attempts to start once permissions are confirmed or when the user saves their settings.
  • Strict Location Check: In [EmergencyService.java], the app now verifies that both ACCESS_FINE_LOCATION and ACCESS_BACKGROUND_LOCATION are granted before declaring the location service type.

2. SecurityException Prevention (Graceful Fallback)

If the service is triggered (e.g., via a boot sequence) but the user has not yet granted the "Always Allow" location permission:

  • Fallback Mode: The service starts as a standard foreground service without the location capability. This prevents the app from crashing.
  • Safety First: The app logs a warning indicating that the SOS alert will lack GPS coordinates until the required permission is granted, rather than failing catastrophically.

3. Race Condition Resolution

Fixed a race condition where the app would attempt to start the monitoring service while the permission dialog was still visible to the user, which is now a fatal error in the latest Android versions.

Verification Summary

Manual Reliability Check

  1. Fresh Install: Verified that the app no longer crashes upon the first launch.
  2. Permission Denial: Verified that the app stays running even if location permission is temporarily unavailable, avoiding the SecurityException.
  3. Android 14/15/16 Support: The startForeground logic now uses the exact bitwise flags required by the newest Android Target SDK (36).

Nugon SOS is now fully compatible with the latest Android security enforcements.

Nugon SOS v1.4 - Versión Convivencia Multimedia

Choose a tag to compare

@jzsalinas jzsalinas released this 29 Jul 13:27

Nugon SOS: Final Polish & Multimedia Optimization

Nugon SOS is now a technically mature emergency tool, capable of bypassing Android's deepest power-saving restrictions while coexisting seamlessly with daily phone use and media playback.

Final Technical Architecture

1. The "Stealth" Bypass Engine

To ensure volume buttons work even in Deep Sleep (screen off, unplugged) without showing ugly "Remote Screen" icons during normal use:

  • Dynamic Mode: The app now detects the screen state. The MediaSession and Silent Audio loop only activate when the screen is OFF.
  • Multimedia Coexistence: If music is playing (Spotify/YouTube), Nugon SOS steps back to let the system handle volume normally. The active audio keeps the CPU awake, allowing our AccessibilityService to monitor the buttons without the bypass trick.
  • Universal Observer: A new ContentObserver monitors system volume levels. It detects rapid "jumps" (delta changes) characteristic of a long-press, providing a 100% reliable trigger even if other apps have hijacked the hardware keys.

2. Reliable Haptic Feedback

We solved the "infinite vibration" and "canceled vibration" bugs:

  • Initial Touch: A single, very short 50ms pulse when the button is first touched (only when the screen is off).
  • Settling Delay: A 500ms silent window after detection to let system volume events finish.
  • Final Confirmation: A powerful, continuous 1000ms vibration once the alert is dispatched.

3. Continuous Protection

  • Auto-Start: Implemented both a BootReceiver and an Accessibility Service trigger to ensure Nugon starts automatically after a phone reboot.
  • Persistence: The service runs as a Foreground Service with a silent (IMPORTANCE_LOW) persistent notification.

Key Configuration for Users

Important

Battery Optimization: The user MUST set Nugon SOS to "Unrestricted" in battery settings for these background triggers to work reliably.
Accessibility: The service must be enabled in Settings > Accessibility.

Warning

Volume Blind Spots: For technical reasons, if the volume is already at 0 or 15, the software-based detection won't see any "change". We recommend keeping the volume between levels 3 and 13 for maximum security while the screen is off.

Verification Checklist

  • Works with Screen ON (Accessibility Service).
  • Works with Screen OFF & No Music (MediaSession Bypass).
  • Works with Screen OFF & Music Playing (Universal Volume Observer).
  • Works without USB cable.
  • Volume buttons work normally for sound adjustment.
  • Starts automatically after reboot.

Developed with focus on reliability and user safety.

Nugon SOS v1.3 - Versión Autostart

Choose a tag to compare

@jzsalinas jzsalinas released this 28 Jul 12:06

Automatic Start on Boot

I have implemented a dual-trigger mechanism to ensure Nugon SOS starts automatically whenever the device is rebooted.

Key Changes

1. Boot Receiver

Implemented [BootReceiver.java] and registered it in the [AndroidManifest.xml].

  • Trigger: System-wide ACTION_BOOT_COMPLETED intent.
  • Action: Immediately starts the EmergencyService monitor.

2. Accessibility Service Redundancy

Updated [NugonAccessibilityService.java] to start the monitor inside onServiceConnected().

  • Why?: Android automatically restarts enabled Accessibility Services during boot. This serves as a secondary, highly reliable trigger that often bypasses manufacturer-specific "auto-start" restrictions.

Nugon SOS v1.2 - Versión No Invasiva

Choose a tag to compare

@jzsalinas jzsalinas released this 27 Jul 21:03

Silent Background Monitoring

Optimized the notification priority to ensure Nugon SOS is as non-intrusive as possible.

  • Low Importance: Changed the notification channel to IMPORTANCE_LOW. This prevents the device from beeping or vibrating every time the screen state changes or the phone is unlocked.
  • Alert Once: Configured the notification to only alert the user once, keeping the ongoing protection status silent in the background.

Nugon SOS v1.1 - Versión Inteligente

Choose a tag to compare

@jzsalinas jzsalinas released this 27 Jul 15:34

Nugon SOS is now technically mature, offering a seamless user experience while maintaining robust emergency detection even in the most restrictive Android environments.

Final Optimizations

1. Intelligent "Stealth" Mode

To solve the issue where Nugon SOS would show a "Remote Screen" volume icon during normal use, I implemented a screen-state aware engine:

  • Dynamic Bypass: The MediaSession and Silent Audio loop (needed to bypass deep sleep) now only activate when the screen is OFF.
  • Transparent UX: When the screen is ON, the app releases control, allowing the standard Android volume UI and icons to work normally.
  • Background Persistence: The AccessibilityService remains active at all times, providing seamless transition and constant monitoring.

2. Haptic Language Refinement

Corrected a critical bug where diagnostic vibrations would loop indefinitely.

  • Single Pulse Feedback: The app now gives exactly one short pulse (50ms) when the user starts pressing the button, serving as a silent confirmation that the interaction is being tracked.
  • Clean Countdown: The 1.5-second hold period is now completely silent, followed by a clear, 1-second confirmation vibration once the alert is dispatched.

3. Volume Passthrough

  • Fixed the volume hardware lock. Nugon SOS now programmatically passes volume adjustment requests back to the system. This ensures the user can still change their phone's volume while protected.
  • Implemented a Recursion Guard to prevent the app from triggering its own volume listeners, ensuring stability.

Verification Summary

Manual Reliability Check

  1. Normal Use: Volume buttons show standard icons and change sound correctly.
  2. Deep Sleep: Device on battery, screen off for >30s. Long-press triggers SOS correctly after the first 50ms vibration.
  3. Continuous Support: The "Nugon SOS Activo" notification remains persistent and functional across multiple alerts.

The application is now ready for production-level use.

Nugon SOS v1.0 - Versión Inicial

Choose a tag to compare

@jzsalinas jzsalinas released this 27 Jul 14:45

Nugon SOS is now fully operational and optimized for the most challenging Android power-saving scenarios. It provides a reliable emergency trigger for users with limited time and mobility.

Key Technical Solutions

1. Reliable Hardware Trigger (MediaSession + A11y)

To bypass Android's "Deep Sleep" where volume buttons are normally ignored:

  • MediaSession: We've implemented a silent audio loop linked to a MediaStyle notification. This "tricks" the system into keeping the volume key pipeline open even when the screen is off.
  • Redundancy: The AccessibilityService remains as a secondary listener for when the device is awake, ensuring no press is ever missed.

2. Battery & Persistence (Foreground Service + WakeLock)

  • Indestructible Service: The EmergencyService runs as a Foreground Service with a persistent notification. It stays active 24/7 to monitor for button presses.
  • WakeLock: When a button press is detected, the app acquires a WakeLock to keep the CPU awake during the 1.5s countdown and the subsequent GPS/Network tasks.

3. Multi-Channel Alerting

  • Smart SMS: Uses sendMultipartTextMessage to handle Unicode characters (like "¡") and long URLs without failing.
  • PWA Integration: Sends a rich JSON payload (Sender ID, Message, Lat/Long) to a custom backend for Web Push notifications.

Final UI/UX Polishing

  • Visual Feedback: Buttons in the dashboard change to Green/Orange with White text based on the real-time status of system permissions.
  • Haptic Language:
    • 50ms pulse: Button detected.
    • 1000ms pulse: Alert sent.
  • User Guidance: Added a card with clear instructions for device-specific edge cases.