Skip to content

Add root lock mode, battery optimization prompt, and onboarding/UX improvements - #46

Open
nellocarotenuto wants to merge 6 commits into
modelorona:mainfrom
nellocarotenuto:main
Open

Add root lock mode, battery optimization prompt, and onboarding/UX improvements#46
nellocarotenuto wants to merge 6 commits into
modelorona:mainfrom
nellocarotenuto:main

Conversation

@nellocarotenuto

Copy link
Copy Markdown

New features

Root lock mode (opt-in, rooted devices only)

  • New RootLock implementation that locks by injecting KEYCODE_POWER through a persistent su shell — the screen turns off instantly with no lock-screen flicker, exactly like a physical power button press.
  • Detected rooted devices get a lock method choice (Accessibility / Root) in settings plus a one-time prompt; root verification (su -c id) runs off the main thread with a generous timeout for the superuser grant dialog.
  • Every root path falls back to the accessibility lock on failure. With root mode enabled, the widget and Quick Settings tile can lock even without the accessibility service.
  • Root state is re-checked on every app resume, and the su detection includes a which su fallback.
  • README + in-app About section document the mount-namespace caveat (root managers expose su only at process start) and the force-close/pre-grant workarounds.

Battery optimization prompt

  • One-time prompt (after the accessibility service is active) asking for a battery optimization exemption, so the service isn't suspended in the background. Falls back to the settings list if the direct exemption dialog is unavailable.

Onboarding & UX improvements

  • The onboarding widget step now triggers the system widget-pin dialog (requestPinAppWidget) directly via an "Add Widget" button, instead of only describing manual steps; launchers without pin support keep the old instructions.
  • Opening system accessibility settings now highlights (flashes) TapLock's entry via the :settings:fragment_args_key extras, so users find the right row immediately. Applied to the permission dialog, onboarding, and the Quick Settings tile fallback.
  • New widget ripple effect toggle and layout adjustments.

All strings added in both English and Spanish.

Verification

  • ./gradlew assembleDebug + manual testing on a physical device (onboarding flow, widget pinning, root lock with Magisk, accessibility settings highlight).

- Added detailed KDoc comments to various classes and functions to improve code readability and maintainability.
- Updated `TapLockAppRules.kt` with explanations for app exclusion rules and package management.
- Enhanced `TapLockBatteryOptimization.kt` with comments on intent builders for battery optimization.
- Improved documentation in `TapLockEdgeZones.kt`, `TapLockFeedback.kt`, `TapLockFloatingButtonConfig.kt`, `TapLockLockZone.kt`, `TapLockStatusBarZone.kt`, `TapLockTileService.kt`, `TapLockWidgetProvider.kt`, `TapLockWidgetStyle.kt`, `TapZoneMode.kt`, `Utils.kt`, `VibrationHelper.kt`, and `WidgetComponents.kt` to clarify functionality and usage.
- Added comments to `Theme.kt` to describe the app-wide theme configuration.
- Updated README with instructions for root option visibility.
- Enhanced root detection logic in RootLock.kt.
- Added root note string to InfoSection and onboarding flow.
- Updated accessibility settings intent for better user experience.
- Translated new strings for root lock mode in both English and Spanish.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant