Skip to content

Comments

manager/userspace: Add desktop shortcut support for module action/webui#3159

Merged
YuKongA merged 17 commits intomainfrom
shortcut
Jan 18, 2026
Merged

manager/userspace: Add desktop shortcut support for module action/webui#3159
YuKongA merged 17 commits intomainfrom
shortcut

Conversation

@YuKongA
Copy link
Collaborator

@YuKongA YuKongA commented Jan 16, 2026

This pull request introduces shortcut support for module actions and WebUI, refactors intent handling for shortcuts and ZIP installations, and adds related UI and logic improvements. The changes enable users to create, manage, and launch shortcuts for module actions and WebUI directly from the app, and provide a better experience when interacting with shortcuts and external intents.

Shortcut Support & UI Integration

  • Added logic and UI for creating, previewing, and deleting shortcuts for module actions and WebUI in ModulePager. This includes dialog management, icon selection, and shortcut existence checks. (manager/app/src/main/java/me/weishu/kernelsu/ui/screen/Module.kt) [1] [2]
  • Ensured shortcuts are deleted when uninstalling a module, preventing orphaned shortcuts. (manager/app/src/main/java/me/weishu/kernelsu/ui/screen/Module.kt)

Intent Handling Refactor

  • Refactored ZIP file installation and shortcut intent handling into separate composable functions (ZipFileIntentHandler and new ShortcutIntentHandler), improving code organization and intent processing. (manager/app/src/main/java/me/weishu/kernelsu/ui/MainActivity.kt) [1] [2] [3] [4]
  • Added support for launching module actions and WebUI via shortcut intents, including navigation and activity launch logic. (manager/app/src/main/java/me/weishu/kernelsu/ui/MainActivity.kt, manager/app/src/main/AndroidManifest.xml) [1] [2]

Module Action Screen Improvements

  • Improved ExecuteModuleActionScreen to handle shortcut launches: shows a toast on success and closes the activity if launched from a shortcut, otherwise pops back the navigation stack. (manager/app/src/main/java/me/weishu/kernelsu/ui/screen/ExecuteModuleAction.kt) [1] [2]

Miscellaneous UI Updates

  • Reduced beyondViewportPageCount in HorizontalPager for performance and UX tuning. (manager/app/src/main/java/me/weishu/kernelsu/ui/MainActivity.kt)
  • Added various imports and minor UI improvements to support new shortcut features. (manager/app/src/main/java/me/weishu/kernelsu/ui/screen/Module.kt) [1] [2] [3] [4] [5] [6]

These changes collectively enhance module interaction by allowing users to create and use shortcuts for module actions and WebUI, streamline intent processing, and improve the overall user experience.

Introduces functionality to create desktop shortcuts for module actions and WebUI, including custom icon selection and permission handling for various manufacturers. Updates UI components to allow shortcut creation, adds relevant strings, and improves shortcut intent handling in MainActivity and WebUIActivity. Also refactors network response handling for OkHttp to use non-null body access.
Introduces the 'actionIcon' property in module definitions, allowing modules to specify a custom icon for actions. Updates the backend to resolve and validate the icon path, and updates the UI and shortcut logic to display and use the custom icon if provided. Documentation in all supported languages is updated to describe the new 'actionIcon' property.
Copilot AI review requested due to automatic review settings January 16, 2026 09:23
@YuKongA YuKongA changed the title manager/userspace: Add desktop shortcut support for module`s action/webui manager/userspace: Add desktop shortcut support for module action/webui Jan 16, 2026

This comment was marked as outdated.

This comment was marked as outdated.

KOWX712 added a commit to ZG089/Re-Malwack that referenced this pull request Jan 17, 2026
KOWX712 added a commit to KernelSU-Next/KPatch-Next-Module that referenced this pull request Jan 17, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 25 out of 26 changed files in this pull request and generated 6 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@YuKongA YuKongA merged commit 2dddfa2 into main Jan 18, 2026
19 checks passed
@YuKongA YuKongA deleted the shortcut branch January 18, 2026 09:44
KOWX712 pushed a commit to KOWX712/KernelSU that referenced this pull request Jan 18, 2026
…ui (tiann#3159)

This pull request introduces shortcut support for module actions and
WebUI, refactors intent handling for shortcuts and ZIP installations,
and adds related UI and logic improvements. The changes enable users to
create, manage, and launch shortcuts for module actions and WebUI
directly from the app, and provide a better experience when interacting
with shortcuts and external intents.

* Added logic and UI for creating, previewing, and deleting shortcuts
for module actions and WebUI in `ModulePager`. This includes dialog
management, icon selection, and shortcut existence checks.
(`manager/app/src/main/java/me/weishu/kernelsu/ui/screen/Module.kt`)
[[1]](diffhunk://#diff-cfdfea0f5a45b575f8c36e9ede05b01d0107c2ae1bf3636997c7f2c2c9606068R250-R345)
[[2]](diffhunk://#diff-cfdfea0f5a45b575f8c36e9ede05b01d0107c2ae1bf3636997c7f2c2c9606068R500-R520)
* Ensured shortcuts are deleted when uninstalling a module, preventing
orphaned shortcuts.
(`manager/app/src/main/java/me/weishu/kernelsu/ui/screen/Module.kt`)

* Refactored ZIP file installation and shortcut intent handling into
separate composable functions (`ZipFileIntentHandler` and new
`ShortcutIntentHandler`), improving code organization and intent
processing.
(`manager/app/src/main/java/me/weishu/kernelsu/ui/MainActivity.kt`)
[[1]](diffhunk://#diff-7154eee2760a97c41821ee2b6e0f8b57d0f51dfa81492cf61075c78a66488276L125-R137)
[[2]](diffhunk://#diff-7154eee2760a97c41821ee2b6e0f8b57d0f51dfa81492cf61075c78a66488276L290-R304)
[[3]](diffhunk://#diff-7154eee2760a97c41821ee2b6e0f8b57d0f51dfa81492cf61075c78a66488276L319-R328)
[[4]](diffhunk://#diff-7154eee2760a97c41821ee2b6e0f8b57d0f51dfa81492cf61075c78a66488276R350-R388)
* Added support for launching module actions and WebUI via shortcut
intents, including navigation and activity launch logic.
(`manager/app/src/main/java/me/weishu/kernelsu/ui/MainActivity.kt`,
`manager/app/src/main/AndroidManifest.xml`)
[[1]](diffhunk://#diff-7154eee2760a97c41821ee2b6e0f8b57d0f51dfa81492cf61075c78a66488276R350-R388)
[[2]](diffhunk://#diff-d4cb309a1213382fd4fd361e3254579e2e7dca6f0559ec308bea5c9047317c92R47)

* Improved `ExecuteModuleActionScreen` to handle shortcut launches:
shows a toast on success and closes the activity if launched from a
shortcut, otherwise pops back the navigation stack.
(`manager/app/src/main/java/me/weishu/kernelsu/ui/screen/ExecuteModuleAction.kt`)
[[1]](diffhunk://#diff-a60bd690dbe7fa6c4d7e78cdc54bcf4b08ac27f297ce2afa25202b74308791d5R91-R95)
[[2]](diffhunk://#diff-a60bd690dbe7fa6c4d7e78cdc54bcf4b08ac27f297ce2afa25202b74308791d5L110-R132)

* Reduced `beyondViewportPageCount` in `HorizontalPager` for performance
and UX tuning.
(`manager/app/src/main/java/me/weishu/kernelsu/ui/MainActivity.kt`)
* Added various imports and minor UI improvements to support new
shortcut features.
(`manager/app/src/main/java/me/weishu/kernelsu/ui/screen/Module.kt`)
[[1]](diffhunk://#diff-cfdfea0f5a45b575f8c36e9ede05b01d0107c2ae1bf3636997c7f2c2c9606068R20-R22)
[[2]](diffhunk://#diff-cfdfea0f5a45b575f8c36e9ede05b01d0107c2ae1bf3636997c7f2c2c9606068R40)
[[3]](diffhunk://#diff-cfdfea0f5a45b575f8c36e9ede05b01d0107c2ae1bf3636997c7f2c2c9606068R74-R83)
[[4]](diffhunk://#diff-cfdfea0f5a45b575f8c36e9ede05b01d0107c2ae1bf3636997c7f2c2c9606068R125-R133)
[[5]](diffhunk://#diff-cfdfea0f5a45b575f8c36e9ede05b01d0107c2ae1bf3636997c7f2c2c9606068R148-R152)
[[6]](diffhunk://#diff-cfdfea0f5a45b575f8c36e9ede05b01d0107c2ae1bf3636997c7f2c2c9606068R164-R168)

These changes collectively enhance module interaction by allowing users
to create and use shortcuts for module actions and WebUI, streamline
intent processing, and improve the overall user experience.
Prslc added a commit to Prslc/APatch that referenced this pull request Jan 19, 2026
- Add long-press interaction on module items to create desktop shortcuts.
- Support both module action and WebUI shortcuts, with automatic type detection.
- Provide a shortcut creation dialog with name editing and custom icon selection.
- Allow updating or deleting existing shortcuts directly from the dialog.
- Handle shortcut launches properly by routing to action execution or WebUI.
- Ensure shortcut-triggered actions exit correctly without affecting navigation stack.
- Clean up related shortcuts automatically when a module is uninstalled.

Reference
[1] tiann/KernelSU#3159
[2] tiann/KernelSU@2dddfa2
[3] https://github.com/tiann/KernelSU/blob/main/manager/app/src/main/java/me/weishu/kernelsu/ui/util/module/Shortcut.kt

Co-authored-by: YuKongA <[email protected]>
Signed-off-by: Prslc <[email protected]>
KOWX712 added a commit to KernelSU-Next/KPatch-Next-Module that referenced this pull request Jan 20, 2026
KOWX712 added a commit to KernelSU-Next/KPatch-Next-Module that referenced this pull request Jan 20, 2026
PhuScam pushed a commit to PhuScam/KernelSU that referenced this pull request Feb 5, 2026
…ui (tiann#3159)

This pull request introduces shortcut support for module actions and
WebUI, refactors intent handling for shortcuts and ZIP installations,
and adds related UI and logic improvements. The changes enable users to
create, manage, and launch shortcuts for module actions and WebUI
directly from the app, and provide a better experience when interacting
with shortcuts and external intents.

### Shortcut Support & UI Integration

* Added logic and UI for creating, previewing, and deleting shortcuts
for module actions and WebUI in `ModulePager`. This includes dialog
management, icon selection, and shortcut existence checks.
(`manager/app/src/main/java/me/weishu/kernelsu/ui/screen/Module.kt`)
[[1]](diffhunk://#diff-cfdfea0f5a45b575f8c36e9ede05b01d0107c2ae1bf3636997c7f2c2c9606068R250-R345)
[[2]](diffhunk://#diff-cfdfea0f5a45b575f8c36e9ede05b01d0107c2ae1bf3636997c7f2c2c9606068R500-R520)
* Ensured shortcuts are deleted when uninstalling a module, preventing
orphaned shortcuts.
(`manager/app/src/main/java/me/weishu/kernelsu/ui/screen/Module.kt`)

### Intent Handling Refactor

* Refactored ZIP file installation and shortcut intent handling into
separate composable functions (`ZipFileIntentHandler` and new
`ShortcutIntentHandler`), improving code organization and intent
processing.
(`manager/app/src/main/java/me/weishu/kernelsu/ui/MainActivity.kt`)
[[1]](diffhunk://#diff-7154eee2760a97c41821ee2b6e0f8b57d0f51dfa81492cf61075c78a66488276L125-R137)
[[2]](diffhunk://#diff-7154eee2760a97c41821ee2b6e0f8b57d0f51dfa81492cf61075c78a66488276L290-R304)
[[3]](diffhunk://#diff-7154eee2760a97c41821ee2b6e0f8b57d0f51dfa81492cf61075c78a66488276L319-R328)
[[4]](diffhunk://#diff-7154eee2760a97c41821ee2b6e0f8b57d0f51dfa81492cf61075c78a66488276R350-R388)
* Added support for launching module actions and WebUI via shortcut
intents, including navigation and activity launch logic.
(`manager/app/src/main/java/me/weishu/kernelsu/ui/MainActivity.kt`,
`manager/app/src/main/AndroidManifest.xml`)
[[1]](diffhunk://#diff-7154eee2760a97c41821ee2b6e0f8b57d0f51dfa81492cf61075c78a66488276R350-R388)
[[2]](diffhunk://#diff-d4cb309a1213382fd4fd361e3254579e2e7dca6f0559ec308bea5c9047317c92R47)

### Module Action Screen Improvements

* Improved `ExecuteModuleActionScreen` to handle shortcut launches:
shows a toast on success and closes the activity if launched from a
shortcut, otherwise pops back the navigation stack.
(`manager/app/src/main/java/me/weishu/kernelsu/ui/screen/ExecuteModuleAction.kt`)
[[1]](diffhunk://#diff-a60bd690dbe7fa6c4d7e78cdc54bcf4b08ac27f297ce2afa25202b74308791d5R91-R95)
[[2]](diffhunk://#diff-a60bd690dbe7fa6c4d7e78cdc54bcf4b08ac27f297ce2afa25202b74308791d5L110-R132)

### Miscellaneous UI Updates

* Reduced `beyondViewportPageCount` in `HorizontalPager` for performance
and UX tuning.
(`manager/app/src/main/java/me/weishu/kernelsu/ui/MainActivity.kt`)
* Added various imports and minor UI improvements to support new
shortcut features.
(`manager/app/src/main/java/me/weishu/kernelsu/ui/screen/Module.kt`)
[[1]](diffhunk://#diff-cfdfea0f5a45b575f8c36e9ede05b01d0107c2ae1bf3636997c7f2c2c9606068R20-R22)
[[2]](diffhunk://#diff-cfdfea0f5a45b575f8c36e9ede05b01d0107c2ae1bf3636997c7f2c2c9606068R40)
[[3]](diffhunk://#diff-cfdfea0f5a45b575f8c36e9ede05b01d0107c2ae1bf3636997c7f2c2c9606068R74-R83)
[[4]](diffhunk://#diff-cfdfea0f5a45b575f8c36e9ede05b01d0107c2ae1bf3636997c7f2c2c9606068R125-R133)
[[5]](diffhunk://#diff-cfdfea0f5a45b575f8c36e9ede05b01d0107c2ae1bf3636997c7f2c2c9606068R148-R152)
[[6]](diffhunk://#diff-cfdfea0f5a45b575f8c36e9ede05b01d0107c2ae1bf3636997c7f2c2c9606068R164-R168)

These changes collectively enhance module interaction by allowing users
to create and use shortcuts for module actions and WebUI, streamline
intent processing, and improve the overall user experience.
PhuScam pushed a commit to PhuScam/KernelSU that referenced this pull request Feb 18, 2026
…ui (tiann#3159)

This pull request introduces shortcut support for module actions and
WebUI, refactors intent handling for shortcuts and ZIP installations,
and adds related UI and logic improvements. The changes enable users to
create, manage, and launch shortcuts for module actions and WebUI
directly from the app, and provide a better experience when interacting
with shortcuts and external intents.

### Shortcut Support & UI Integration

* Added logic and UI for creating, previewing, and deleting shortcuts
for module actions and WebUI in `ModulePager`. This includes dialog
management, icon selection, and shortcut existence checks.
(`manager/app/src/main/java/me/weishu/kernelsu/ui/screen/Module.kt`)
[[1]](diffhunk://#diff-cfdfea0f5a45b575f8c36e9ede05b01d0107c2ae1bf3636997c7f2c2c9606068R250-R345)
[[2]](diffhunk://#diff-cfdfea0f5a45b575f8c36e9ede05b01d0107c2ae1bf3636997c7f2c2c9606068R500-R520)
* Ensured shortcuts are deleted when uninstalling a module, preventing
orphaned shortcuts.
(`manager/app/src/main/java/me/weishu/kernelsu/ui/screen/Module.kt`)

### Intent Handling Refactor

* Refactored ZIP file installation and shortcut intent handling into
separate composable functions (`ZipFileIntentHandler` and new
`ShortcutIntentHandler`), improving code organization and intent
processing.
(`manager/app/src/main/java/me/weishu/kernelsu/ui/MainActivity.kt`)
[[1]](diffhunk://#diff-7154eee2760a97c41821ee2b6e0f8b57d0f51dfa81492cf61075c78a66488276L125-R137)
[[2]](diffhunk://#diff-7154eee2760a97c41821ee2b6e0f8b57d0f51dfa81492cf61075c78a66488276L290-R304)
[[3]](diffhunk://#diff-7154eee2760a97c41821ee2b6e0f8b57d0f51dfa81492cf61075c78a66488276L319-R328)
[[4]](diffhunk://#diff-7154eee2760a97c41821ee2b6e0f8b57d0f51dfa81492cf61075c78a66488276R350-R388)
* Added support for launching module actions and WebUI via shortcut
intents, including navigation and activity launch logic.
(`manager/app/src/main/java/me/weishu/kernelsu/ui/MainActivity.kt`,
`manager/app/src/main/AndroidManifest.xml`)
[[1]](diffhunk://#diff-7154eee2760a97c41821ee2b6e0f8b57d0f51dfa81492cf61075c78a66488276R350-R388)
[[2]](diffhunk://#diff-d4cb309a1213382fd4fd361e3254579e2e7dca6f0559ec308bea5c9047317c92R47)

### Module Action Screen Improvements

* Improved `ExecuteModuleActionScreen` to handle shortcut launches:
shows a toast on success and closes the activity if launched from a
shortcut, otherwise pops back the navigation stack.
(`manager/app/src/main/java/me/weishu/kernelsu/ui/screen/ExecuteModuleAction.kt`)
[[1]](diffhunk://#diff-a60bd690dbe7fa6c4d7e78cdc54bcf4b08ac27f297ce2afa25202b74308791d5R91-R95)
[[2]](diffhunk://#diff-a60bd690dbe7fa6c4d7e78cdc54bcf4b08ac27f297ce2afa25202b74308791d5L110-R132)

### Miscellaneous UI Updates

* Reduced `beyondViewportPageCount` in `HorizontalPager` for performance
and UX tuning.
(`manager/app/src/main/java/me/weishu/kernelsu/ui/MainActivity.kt`)
* Added various imports and minor UI improvements to support new
shortcut features.
(`manager/app/src/main/java/me/weishu/kernelsu/ui/screen/Module.kt`)
[[1]](diffhunk://#diff-cfdfea0f5a45b575f8c36e9ede05b01d0107c2ae1bf3636997c7f2c2c9606068R20-R22)
[[2]](diffhunk://#diff-cfdfea0f5a45b575f8c36e9ede05b01d0107c2ae1bf3636997c7f2c2c9606068R40)
[[3]](diffhunk://#diff-cfdfea0f5a45b575f8c36e9ede05b01d0107c2ae1bf3636997c7f2c2c9606068R74-R83)
[[4]](diffhunk://#diff-cfdfea0f5a45b575f8c36e9ede05b01d0107c2ae1bf3636997c7f2c2c9606068R125-R133)
[[5]](diffhunk://#diff-cfdfea0f5a45b575f8c36e9ede05b01d0107c2ae1bf3636997c7f2c2c9606068R148-R152)
[[6]](diffhunk://#diff-cfdfea0f5a45b575f8c36e9ede05b01d0107c2ae1bf3636997c7f2c2c9606068R164-R168)

These changes collectively enhance module interaction by allowing users
to create and use shortcuts for module actions and WebUI, streamline
intent processing, and improve the overall user experience.
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