manager: check module status before executing action or WebUI#3179
Merged
Conversation
u9521
commented
Jan 23, 2026
Contributor
- When a module is disabled, pending update, or pending uninstallation, run action scripts or start webui are not allowed.
- Uninstalling a module does not delete shortcuts, as restoring the uninstallation does not restore shortcuts either.
- Refactor `ModuleViewModel` to extract `loadModuleList` for manual loading. - Add validation in `ExecuteModuleAction` and `WebUIActivity` to check if a module exists, is enabled, and is not pending removal/update before proceeding. - Add strings for "no such module" and "module unavailable" errors (with translations). - Remove redundant shortcut deletion logic during module uninstallation as it is handled elsewhere. Signed-off-by: u9521 <63995396+u9521@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request enhances module management by adding status validation before executing module actions or starting WebUI. The changes prevent users from accessing disabled, pending update, or pending removal modules, improving the stability and user experience of the application.
Changes:
- Added module status validation in WebUIActivity and ExecuteModuleAction to check if modules are enabled and not pending updates or removal
- Extracted module loading logic into a reusable
loadModuleList()function in ModuleViewModel - Removed automatic shortcut deletion during module uninstallation
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| manager/app/src/main/res/values/strings.xml | Added English error message strings for missing and unavailable modules |
| manager/app/src/main/res/values-zh-rCN/strings.xml | Added Chinese translations for the new error message strings |
| manager/app/src/main/java/me/weishu/kernelsu/ui/webui/WebUIActivity.kt | Added module status validation before starting WebUI, shows appropriate error messages and exits if module is unavailable |
| manager/app/src/main/java/me/weishu/kernelsu/ui/viewmodel/ModuleViewModel.kt | Refactored module loading logic by extracting loadModuleList() function to reduce code duplication |
| manager/app/src/main/java/me/weishu/kernelsu/ui/screen/Module.kt | Removed automatic shortcut deletion when uninstalling modules |
| manager/app/src/main/java/me/weishu/kernelsu/ui/screen/ExecuteModuleAction.kt | Added module status validation before executing action scripts, shows appropriate error messages and exits if module is unavailable |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: u9521 <63995396+u9521@users.noreply.github.com>
Collaborator
|
模块待更新阶段启动 webui 这种应该不影响吧🤔 |
Signed-off-by: u9521 <63995396+u9521@users.noreply.github.com>
Contributor
Author
更新待重启的时候,模块的action,webui虽然是旧的,但module.prop是新的,假设module跨版本更新时有兼容处理,eg. 更新配置文件,但action,webui可能不能处理这个 |
YuKongA
approved these changes
Jan 24, 2026
u9521
added a commit
to u9521/KernelSU
that referenced
this pull request
Jan 24, 2026
…3179) - When a module is disabled, pending update, or pending uninstallation, run action scripts or start webui are not allowed. - Uninstalling a module does not delete shortcuts, as restoring the uninstallation does not restore shortcuts either. --------- Signed-off-by: u9521 <63995396+u9521@users.noreply.github.com>
KOWX712
pushed a commit
to KOWX712/KernelSU
that referenced
this pull request
Jan 25, 2026
…3179) - When a module is disabled, pending update, or pending uninstallation, run action scripts or start webui are not allowed. - Uninstalling a module does not delete shortcuts, as restoring the uninstallation does not restore shortcuts either. --------- Signed-off-by: u9521 <63995396+u9521@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.