Skip to content

Repository files navigation

Shizuku Shortcuts

Platform Language UI minSdk Shizuku

Tiny launcher shortcuts, home-screen widgets, and custom shell actions for Android through Shizuku.

The app ships with four built-in actions:

  • open notifications
  • open Quick Settings
  • take screenshot
  • screen off

It can run them directly from the compact home screen with Try, pin them as launcher shortcuts with Pin, place them as home-screen widgets, and add local custom shell actions such as cmd statusbar expand-notifications without the adb shell prefix.

Caution

This project was developed with heavy use of AI assistance, including OpenAI Codex.

Screenshots

English Arabic (RTL)
Home (actions + status)
Home (EN)
Home (الصفحة الرئيسية)
Home (AR)

What This App Does

  • Opens the notification shade with cmd statusbar expand-notifications
  • Opens Quick Settings with cmd statusbar expand-settings
  • Falls back to service call statusbar 1 for notifications on older ROMs when needed
  • Lets you add local custom shell actions that run through the same Shizuku user-service path
  • Keeps built-in static launcher shortcuts and publishes custom dynamic shortcuts to the launcher long-press menu
  • Supports pinned launcher shortcuts for both built-ins and custom actions
  • Supports a unified home-screen widget: each widget instance can be configured to one built-in or custom action
  • Routes widget taps through the disposable trampoline into an internal dispatch service and shows a rebind prompt if a linked custom action is removed
  • Shows one clear Shizuku readiness status with the next required action
  • Lets you Try, Edit, Pin, or Delete custom actions from the home screen
  • Shows the active action and rejects concurrent dispatch instead of queueing duplicate commands
  • Supports manual backup/restore for custom actions via Android file picker (replace-all restore)
  • Exports backup files as JSON with timestamped default names like shizuku-custom-actions-backup-20260404-153045.json
  • Supports Android dynamic colors on Android 12+ with a fixed fallback palette on older versions
  • Supports English and Arabic with RTL
  • Uses Android app language settings, not an in-app language picker

Requirements

  • Android minSdk 26
  • Shizuku installed and running
  • Shizuku permission granted to this app

Architecture

Core pieces:

  • MainActivity: launcher orchestration, backup/restore contracts, and action callbacks
  • MainScreen: condensed Compose UI with one readiness status, inline guidance, action rows, and dialogs
  • ShortcutDispatchActivity: disposable launcher-shortcut trampoline
  • ShortcutDispatchService: internal lifecycle-independent shortcut/widget execution
  • AppShizukuManager: binder state, permission flow, and user-service binding
  • PrivilegedStatusBarService: Shizuku user service binder
  • AppCustomActionsRepository: local custom-action persistence in one SharedPreferences JSON payload
  • CustomActionsBackup: backup file naming, JSON serialization/parsing, and SAF read/write helpers
  • ActionCatalog and DynamicShortcutSync: merged lookup plus custom dynamic shortcut publishing
  • ActionPerformer: shell command execution and fallback logic
  • ActionWidgetProvider, ActionWidgetConfigureActivity, ActionWidgetRenderer, and WidgetBindingsRepository: widget lifecycle, selection UI, rendering, and per-widget action binding

Runtime flow:

  1. User taps Try in the app, launches a static/dynamic/pinned shortcut, or taps a configured widget
  2. The app checks Shizuku availability and permission
  3. The app binds the Shizuku user service
  4. The user service runs either the built-in argv command or sh -c for a custom shell action
  5. The app returns silently or shows a short toast on failure

Calling From Other Apps

Notifications and Quick Settings can also be triggered by other apps such as Tasker because ShortcutDispatchActivity is exported. Sensitive and custom actions require a private token embedded in shortcuts and widgets created by the app.

Use an explicit intent to:

  • package: com.yshalsager.shizukushortcuts
  • class: com.yshalsager.shizukushortcuts.ShortcutDispatchActivity

Built-in actions support either the intent action or the extra_action_id extra.

Open notifications:

adb shell am start \
  -n com.yshalsager.shizukushortcuts/.ShortcutDispatchActivity \
  -a com.yshalsager.shizukushortcuts.action.EXPAND_NOTIFICATIONS

Open Quick Settings:

adb shell am start \
  -n com.yshalsager.shizukushortcuts/.ShortcutDispatchActivity \
  -a com.yshalsager.shizukushortcuts.action.EXPAND_QUICK_SETTINGS

You can also use the shared extra instead:

adb shell am start \
  -n com.yshalsager.shizukushortcuts/.ShortcutDispatchActivity \
  --es extra_action_id expand_notifications

Current built-in ids:

  • expand_notifications
  • expand_quick_settings

Notes:

  • Shizuku still needs to be running and permission must already be granted
  • screenshot, screen-off, and custom actions are not exposed through the public intent API

Implementation details live in docs/implementation-walkthrough.md.

Build

This project uses mise for tool management.

# Build debug APK
./gradlew :app:assembleDebug

# Run unit tests
./gradlew :app:testDebugUnitTest

# Run lint
./gradlew :app:lintDebug

# Build Android test APK
./gradlew :app:assembleDebugAndroidTest

# Run regular instrumentation tests on a connected device
./gradlew :app:connectedDebugAndroidTest \
  -Pandroid.testInstrumentationRunnerArguments.notPackage=com.yshalsager.shizukushortcuts.screenshots

Fastlane And Metadata

This repo includes:

  • fastlane/metadata/android/en-US
  • fastlane/metadata/android/ar
  • screenshot assets under fastlane/metadata/android/*/images/phoneScreenshots
  • fastlane lanes for metadata validation, screenshot capture, and Play upload

Useful commands:

# Install fastlane
bundle install

# Validate fastlane metadata
bundle exec fastlane android validate_metadata

# Capture screenshots
bundle exec fastlane android capture_screenshots

CI

GitHub Actions included in this repo:

  • ci.yml: unit tests, lint, debug/release builds, API 34 instrumentation tests, metadata validation
  • screenshots.yml: emulator-based fastlane screenshot capture
  • release.yml: build release APK and attach it to GitHub releases

License

GPL-3.0-only. See LICENSE.

About

Launcher shortcuts and custom shell actions via Shizuku.

Topics

Resources

Stars

73 stars

Watchers

0 watching

Forks

Releases

Sponsor this project

Packages

Used by

Contributors

Languages