Enforcement Module
Theenforcement-module operates as the primary security auditor for the React Native application. It establishes a JSI bridge for inspecting deeply nested OS configurations that standard React Native permission libraries are incapable of accurately evaluating.
Auditing Protocol
ThecheckAllPermissions function executes a comprehensive state evaluation across critical Android systems:
- Accessibility Services: Validates
Settings.Secure.ENABLED_ACCESSIBILITY_SERVICESto guarantee the Blocker module is actively armed within the OS layer. - Draw Overlays: Verifies
canDrawOverlaysprivileges, an absolute requirement for rendering the un-dismissable full-screen penalty UI. - Location Constraints: Validates that GPS permissions are explicitly set to “Allow all the time” (
ACCESS_BACKGROUND_LOCATION). A standard “Allow while using” configuration is structurally rejected, as Android OS background tracking termination would initiate an inescapable fail-closed blockout sequence. - Battery Optimization: Confirms the application is whitelisted from Android Doze Mode execution limits.
- Device Administration: Inspects the
DevicePolicyManagerto verify anti-uninstall protections are bound to the package.
Settings Routing Infrastructure
Because OEMs (Samsung, Xiaomi, OnePlus) continuously alter their Settings menu architectures, standard Android intents frequently fail or misdirect users. TheopenSettings function provides specialized deep-linking to route the user directly to the correct permission configuration page across diverse hardware variants.