ShizuStore

Shizuku Shortcuts

yshalsager

0.5.0 · GitHub

Download APK
Customization Android 8.0+ 1 month ago GPL-3.0
49 ShizuStore
3.5k GitHub
72 Stars
1 MB Size

More about this app

Create launcher shortcuts for shell commands

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.

Close

How Shizuku is used

Can open notification shade and Quick Settings, take screenshots, turn screen off and run custom shell commands via `Shizuku shell commands`.

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

Shizuku is used to run privileged shell commands from launcher shortcuts, widgets and in-app try buttons.

  • Open notification shade: lets the user expand notifications from a shortcut using the cmd statusbar expand-notifications shell command through Shizuku, with service call statusbar 1 as a fallback.
  • Open Quick Settings: lets the user expand Quick Settings from a shortcut using the cmd statusbar expand-settings shell command through Shizuku.
  • Take screenshot: triggers a screenshot from a shortcut by simulating the screenshot key with the input keyevent 120 shell command through Shizuku.
  • Turn screen off: turns the screen off from a shortcut by simulating the sleep key with the input keyevent 223 shell command through Shizuku.
  • Run custom commands: runs a shell command the user types and saves as a custom action using sh -c through Shizuku, launched from its shortcut.

Android APIs or commands used

  • cmd statusbar expand-notifications
  • service call statusbar 1
  • cmd statusbar expand-settings
  • input keyevent 120
  • input keyevent 223
  • sh -c
  • timeout -k .25 5

Notable details

Custom commands time out after about five seconds and their captured output is bounded, so long running commands are reported as timed out.

Close

Changelog

What's new for version 0.5.0

Shizuku Shortcuts v0.5.0

This release focuses on safer external dispatch, more reliable privileged actions, resilient custom-action storage, and accessible controls.

Highlights

  • Protects screenshots, screen-off, and custom shell actions with a per-install authorization token while keeping notification and Quick Settings actions available to Tasker and similar apps.
  • Moves accepted actions into an internal service so shortcut launches can finish immediately without interrupting bounded execution.
  • Adds timeouts and output limits for shell commands and Shizuku service calls, clearer failure diagnostics, and protection against concurrent execution.
  • Hardens cold-start dispatch, malformed persistence, backup/restore limits, durable replacement, dynamic shortcut reconciliation, and package-upgrade migration.
  • Uses the non-toggle KEYCODE_SLEEP path for screen-off actions.
  • Adds custom-action delete undo, safer shell-command editing, and clearer restore impact summaries.
  • Improves TalkBack semantics, readiness status, touch targets, large-text behavior, RTL presentation, widget contrast, and widget resizing.
  • Compiles against Android 37 and updates the Android/Kotlin/Compose dependency stack.

External integrations

The following public actions remain available without a token:

  • com.yshalsager.shizukushortcuts.action.EXPAND_NOTIFICATIONS
  • com.yshalsager.shizukushortcuts.action.EXPAND_QUICK_SETTINGS

Sensitive built-in and custom actions now require authorization generated by this installation. Backups intentionally do not transfer that authorization.

Full changelog: https://github.com/yshalsager/ShizukuShortcuts/compare/v0.4.0...v0.5.0

Close

Permissions

2 permissions requested

  • com.yshalsager.shizukushortcuts.DYNAMIC_RECEIVER_NOT_EXPORTED_PERMISSION
  • moe.shizuku.manager.permission.API_V23
Close

Sources

2 sources

0.5.0 Universal GitHub · com.yshalsager.shizukushortcuts
Selected Download
0.5.0-debug GitHub · com.yshalsager.shizukushortcuts.debug
Download