ShizuStore

Extend

jqssun

0.0.26 · GitHub

Download APK
Display management Android 8.0+ 2 months ago GPL-3.0 Recommended
326 ShizuStore
4.4k GitHub
172 Stars
2 MB Size

More about this app

Display manager for physical and virtual displays with a built-in virtual touchscreen. Great for use with `scrcpy --new-display` on a PC

Display Manager for Android

Stars GitHub license build release

Extend is an all-purpose Android display manager for any connected physical or virtual display. It can be used standalone or alongside Mirror. It builds on top of Android desktop experience features, and allows you to place any application on any display and drive it with a built-in multi-touch virtual touchpad, an on-screen keyboard, a physical touchscreen, or any external input device connected to Android.

Combined with any supported launcher, it is a full open-source replacement for Samsung DeX, Motorola Smart Connect Mobile Desktop (formerly Ready For), and Honor Easy Projection, with additional features on top.

Get it on Google Play Get it on F-Droid Get it on GitHub

Usage

Using without Shizuku is possible but outside the scope of support. For full feature compatibility, Shizuku is required: enable it in any supported mode (wireless debugging, USB debugging, or root) and grant access to this application. See Shizuku documentation for details.

Using with Mirror

Extend manages physical and virtual displays while Mirror creates them. External displays are picked up automatically through built-in DisplayManager API. For screens that Android cannot reach natively, Mirror registers virtual displays in the same way so DisplayManager recognizes them without any extra integration.

Compatibility

Features

  • Launch any application on any external display in full screen
  • Fully customizable resolution, scaling, DPI, and rotation for any display
  • Reset any per-display configuration back to system defaults
  • Built-in on-screen touchpad and keyboard for controlling any display
  • Touchpad control with support for multi-touch, rotation, and digitizer-only mode
  • Per-device routing from any external input device to any display
  • Back and Home navigation for content running on external displays
  • Turn off the built-in screen while keeping external displays active
  • Managed virtual display mode with customizable on-screen keyboard routing and window behavior, for legacy Android versions
Feature Shizuku Accessibility Min. API
Change resolution R N 26
Change DPI R N 26
Change rotation R N 26
Change mode (FPS) R N 26
Bind input device R N 26 (base)
29 (external device detection)
Managed virtual display O N 26 (base)
33 (TRUSTED or OWN_DISPLAY_GROUP)
34 (DEVICE_DISPLAY_GROUP)
On-screen keyboard routing R N 30 (DisplayImePolicyCompat)
On-screen touchpad overlay R R 26 (TYPE_ACCESSIBILITY_OVERLAY)
30 (getWindowsOnAllDisplays)
Floating button O F 26 (TYPE_APPLICATION_OVERLAY and SYSTEM_ALERT_WINDOW)
Built-in screen off R N 26 (SurfaceControl.setDisplayPowerMode)
35 (IDisplayManager.requestDisplayPower)
Physical-key routing R N 26
Display hotplug monitor I N 26
Input hotplug monitor I N 26
Legend
R Required
O Optional
F Fallback
I Inherited
N Unused

Implementation

This application calls Android's built-in IWindowManager, IDisplayManager, and IInputManager services directly. Per-display configuration is applied with setForcedDisplaySize, setForcedDisplayDensityForUser, freezeDisplayRotation, setDisplayImePolicy, etc. Input routing goes through the IInputManager bridge to associate input devices with any specified display.

flowchart LR
    Extend["Extend (via Shizuku)"]
    WM["IWindowManager<br/>IDisplayManager<br/>IInputManager"]
    Displays["All connected displays<br/><small>(physical + virtual)</small>"]
    Extend --> WM --> Displays

Check out the CI for help on how to create reproducible builds.

Credits

  • Braden Farmer for the use of IWindowManager APIs in SecondScreen
  • Tao Wen for the use of IDisplayManager APIs in connect-screen
  • Genymobile for the use of SurfaceControl APIs in scrcpy
Close

How Shizuku is used

Can manage virtual and physical displays, launch apps on a chosen display and route input via Shizuku with `IDisplayManager`, `IWindowManager` and `IInputManager`.

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

Extend uses Shizuku to manage extra displays, show apps there and route input to them.

  • Create virtual displays: create trusted virtual displays for use with tools like scrcpy through the system display service, with a media projection fallback when Shizuku is unavailable.
  • Adjust resolution and density: apply a chosen width, height and density on a display with forced size and density controls, with timed confirmation and automatic restore.
  • Switch display modes: apply a supported resolution and refresh rate mode as the preferred mode for a display.
  • Launch apps on a display: open installed apps and internal screens fullscreen on the selected display through the system activity service.
  • Route keyboards and mice: bind external keyboards, mice and other input devices to a chosen display by display and port association, using an input dump to match devices to ports.
  • Forward touch input: send touch events received on the phone screen to the selected display through input injection.
  • Control keyboard display: view and change on which display the input method appears.
  • Turn phone screen off: switch the built in screen off while keeping the extra display active, and wake it again with volume keys monitored in the background.
  • Enable touch features: grant its own secure settings permission through Shizuku to turn on its accessibility service without manual settings steps.
  • Inspect running apps: list tasks running on an extra display to show running apps and reconcile the active display, refreshing when tasks change.
  • Export diagnostics: collect system logs through the privileged service and share them as a file.

Android APIs or commands used

  • IDisplayManager.createVirtualDisplay
  • IDisplayManager.getDisplayInfo
  • IDisplayManager.setUserPreferredDisplayMode
  • IDisplayManager.resetUserPreferredDisplayMode
  • IDisplayManager.requestDisplayPower
  • IWindowManager.setForcedDisplaySize
  • IWindowManager.setForcedDisplayDensityForUser
  • IWindowManager.getBaseDisplaySize
  • IWindowManager.getInitialDisplaySize
  • IWindowManager.getDisplayImePolicy
  • IWindowManager.setDisplayImePolicy
  • IInputManager.addUniqueIdAssociationByDescriptor
  • IInputManager.removeUniqueIdAssociationByDescriptor
  • IInputManager.addUniqueIdAssociation
  • IInputManager.removeUniqueIdAssociation
  • IInputManager.addPortAssociation
  • IInputManager.removePortAssociation
  • IInputManager.getInputDeviceIds
  • IInputManager.getInputDevice
  • IInputManager.injectInputEvent
  • IActivityManager.startActivityAsUserWithFeature
  • IActivityManager.startActivity
  • IActivityTaskManager.getAllRootTaskInfosOnDisplay
  • IActivityTaskManager.registerTaskStackListener
  • IPermissionManager.grantRuntimePermission
  • IPackageManager.grantRuntimePermission
  • SurfaceControl.setDisplayPowerMode
  • SurfaceControl.getBuiltInDisplay
  • logcat -d
  • dumpsys input
  • getevent

Notable details

Virtual display creation falls back to media projection when Shizuku is unavailable, and app launching falls back to a normal launch intent. Resolution and density changes ask for confirmation and restore the old value if not confirmed.

Close

Changelog

What's new for version 0.0.26

Close

Permissions

8 permissions requested

  • android.permission.WRITE_SECURE_SETTINGS
  • android.permission.FOREGROUND_SERVICE
  • android.permission.FOREGROUND_SERVICE_MEDIA_PROJECTION
  • android.permission.SYSTEM_ALERT_WINDOW
  • android.permission.POST_NOTIFICATIONS
  • io.github.jqssun.displaymirror.permission.TOUCHSCREEN_BRIDGE
  • moe.shizuku.manager.permission.API_V23
  • io.github.jqssun.displayextend.DYNAMIC_RECEIVER_NOT_EXPORTED_PERMISSION
Close

Sources

2 sources

0.0.26 GitHub · io.github.jqssun.displayextend
Selected Download
0.0.26 F-Droid · io.github.jqssun.displayextend · io.github.jqssun.displayextend
Download