Skip to content

manager: check module status before executing action or WebUI#3179

Merged
YuKongA merged 3 commits into
tiann:mainfrom
u9521:check-module
Jan 24, 2026
Merged

manager: check module status before executing action or WebUI#3179
YuKongA merged 3 commits into
tiann:mainfrom
u9521:check-module

Conversation

@u9521

@u9521 u9521 commented Jan 23, 2026

Copy link
Copy Markdown
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>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

Comment thread manager/app/src/main/java/me/weishu/kernelsu/ui/webui/WebUIActivity.kt Outdated
Comment thread manager/app/src/main/java/me/weishu/kernelsu/ui/screen/ExecuteModuleAction.kt Outdated
Signed-off-by: u9521 <63995396+u9521@users.noreply.github.com>
@YuKongA

YuKongA commented Jan 24, 2026

Copy link
Copy Markdown
Collaborator

模块待更新阶段启动 webui 这种应该不影响吧🤔

Signed-off-by: u9521 <63995396+u9521@users.noreply.github.com>
@u9521

u9521 commented Jan 24, 2026

Copy link
Copy Markdown
Contributor Author

模块待更新阶段启动 webui 这种应该不影响吧🤔

更新待重启的时候,模块的action,webui虽然是旧的,但module.prop是新的,假设module跨版本更新时有兼容处理,eg. 更新配置文件,但action,webui可能不能处理这个
更新的时候顺便把创建快捷方式禁用了,万一模块更新后没有action,webui了,创建的快捷方式也没啥意义

@YuKongA YuKongA merged commit bf6fe41 into tiann:main Jan 24, 2026
@u9521 u9521 deleted the check-module branch January 24, 2026 05:09
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>
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.

3 participants