ShizuStore

DozeTap

dhruvanbhalara

1.0.0 · GitHub

Download APK
Power management Android 8.0+ 2 months ago Apache-2.0
65 ShizuStore
127 GitHub
4 Stars
2 MB Size

More about this app

Screen timeout presets that grant WRITE_SECURE_SETTINGS in one tap through Shizuku.

DozeTap

DozeTap App Icon

DozeTap — Effortlessly manage your Android screen timeout with a single tap.

License: Apache 2.0 Platform Min SDK Kotlin Material 3


Overview

Changing the system screen timeout on Android typically requires navigating through multiple settings screens. DozeTap provides direct toggling and preset selection from:

  • Quick Settings Tile: Dynamic canvas-rendered icon displaying active timeout duration (15s, 30s, 1m, 2m, 5m, 10m, 30m, ∞).
  • Glance Home Screen Widgets: Responsive widgets supporting 1x1, 2x1, 4x1, and 4x4 layout sizes.
  • Application Dashboard: Material 3 interface for configuring custom preset orders, dark mode, and quick timeout selection.

Technical Mechanism

Modifying system screen timeout programmatically requires android.permission.WRITE_SETTINGS.

  1. On launch or tile invocation, the application checks Settings.System.canWrite(context).
  2. If permission is missing, the app directs the user to Settings.ACTION_MANAGE_WRITE_SETTINGS.
  3. When granted, timeout updates write directly to Settings.System.SCREEN_OFF_TIMEOUT via Settings.System.putInt().
  4. DozeTapTileService and DozeTapGlanceWidget observe ContentObserver system changes and execute TileService.requestListeningState() for state synchronization.

Permission Requirements

Permission Type Purpose
android.permission.WRITE_SETTINGS System Setting Modifies system screen off timeout (SCREEN_OFF_TIMEOUT).
moe.shizuku.manager.permission.API Optional API Allows one-tap permission granting via active Shizuku service.

Option 1: One-Tap Grant via Shizuku (No PC Required)

  1. Install and start the Shizuku app.
  2. Start the Shizuku service via Wireless Debugging in Android Developer Options (Android 11+).
  3. Open DozeTap -> Tap "Grant via Shizuku" on the home dashboard.

Option 2: Grant Permission via ADB Terminal

# Via AppOps (Recommended)
adb shell appops set com.dhruvanbhalara.dozetap WRITE_SETTINGS allow

# Or via PM Grant
adb shell pm grant com.dhruvanbhalara.dozetap android.permission.WRITE_SETTINGS

Build Instructions

Prerequisites

  • JDK 17+
  • Android SDK (API Level 35 compileSdk, API Level 26 minSdk)

Build APK Variants

This project uses product flavors to separate development and production builds.

git clone https://github.com/dhruvanbhalara/DozeTap.git
cd DozeTap

# Build Dev Debug (Development variant)
./gradlew assembleDevDebug

# Build Prod Release (Production variant)
./gradlew assembleProdRelease

# Build All Variants
./gradlew assemble

Installation

# Install Dev Debug
adb install app/build/outputs/apk/dev/debug/app-dev-debug.apk

# Install Prod Release
adb install app/build/outputs/apk/prod/release/app-prod-release.apk

Run Unit Tests

./gradlew test

Architecture & Technology Stack

  • Architecture: Clean Architecture (Domain, Data, UI, Service, Widget)
  • UI Framework: Jetpack Compose + Material 3
  • Widgets: Jetpack Glance (GlanceAppWidget)
  • System Integration: TileService (Quick Settings API)
  • Persistence: Jetpack DataStore Preferences

Security & Privacy

  • Zero Network Access: AndroidManifest.xml declares no internet permissions.
  • Single Setting Scope: Reads and writes Settings.System.SCREEN_OFF_TIMEOUT only.

License

Distributed under the Apache License 2.0.


Author

Dhruvan Bhalara (@dhruvanbhalara)

Close

How Shizuku is used

Can grant WRITE_SETTINGS in one tap via `appops set WRITE_SETTINGS allow` through Shizuku to enable timeout presets.

This is an AI-assisted analysis of Shizuku-related usages in the app's public source code. It is best effort, so it may not catch every single usage.

How this app uses Shizuku

DozeTap uses Shizuku for one job, granting itself system settings access so timeout presets can be applied without manual setup.

  • Grant settings access instantly: the user can tap once to grant the app WRITE_SETTINGS access, applied with the appops set WRITE_SETTINGS allow shell command run through Shizuku. Once granted, the user can apply screen timeout presets, keep screen on mode and restore the previous timeout using the normal system settings API.

Android APIs or commands used

  • appops set WRITE_SETTINGS allow

Notable details

Without Shizuku the same WRITE_SETTINGS access can still be granted through the system settings screen, the app offers both options in its permission banner.

Close

Changelog

What's new for version 1.0.0

Added

  • Screen Timeout Controls: Easily change how long your device screen stays on before turning off.
  • Quick Settings Tile: Toggle screen timeout directly from your Android notification shade.
  • Home Screen Widgets: Switch screen off durations with a single tap using home screen widgets.
  • Custom Timeouts: Set custom display durations beyond standard Android settings presets.
  • Shizuku Support: Grant required settings permissions using Shizuku without needing a computer or manual ADB commands.
  • Material You Theme: Dynamic theme styling and dark mode support matching your system preferences.
  • Privacy & Offline: Zero network permissions, zero tracking, and completely offline operation.

Full Changelog: https://github.com/dhruvanbhalara/DozeTap/commits/v1.0.0

Close

Permissions

8 permissions requested

  • android.permission.WRITE_SETTINGS
  • android.permission.WAKE_LOCK
  • moe.shizuku.manager.permission.API
  • android.permission.ACCESS_NETWORK_STATE
  • android.permission.RECEIVE_BOOT_COMPLETED
  • android.permission.FOREGROUND_SERVICE
  • com.dhruvanbhalara.dozetap.DYNAMIC_RECEIVER_NOT_EXPORTED_PERMISSION
  • moe.shizuku.manager.permission.API_V23
Close