Skip to content

feature: allow shell & force enable adbd#3298

Merged
aviraxp merged 10 commits into
mainfrom
allowshell
Mar 16, 2026
Merged

feature: allow shell & force enable adbd#3298
aviraxp merged 10 commits into
mainfrom
allowshell

Conversation

@5ec1cff

@5ec1cff 5ec1cff commented Mar 15, 2026

Copy link
Copy Markdown
Collaborator

No description provided.

@5ec1cff 5ec1cff requested a review from Copilot March 15, 2026 15:22
@5ec1cff 5ec1cff marked this pull request as draft March 15, 2026 15:23

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 PR adds “rescue-mode” installation options to control whether shell is granted root by default and to force-enable ADB debugging via boot image patching / module parameters, with corresponding Manager UI toggles.

Changes:

  • Add boot-patch CLI flags to inject ramdisk marker/prop files for allowing shell root and enabling ADB debug.
  • Pass an allow_shell=1 module parameter from ksuinit based on a ramdisk marker file.
  • Add KernelSU kernel-side allow_shell module parameter and update allowlist behavior; add Manager UI strings and toggles.

Reviewed changes

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

Show a summary per file
File Description
userspace/ksuinit/src/lib.rs Conditionally passes allow_shell=1 to init_module() when /ksu_allow_shell exists.
userspace/ksud/src/boot_patch.rs Adds --allow-shell, --enable-adbd, and related options; writes marker/prop files into the ramdisk; adds --no-install.
manager/app/src/main/res/values/strings.xml Adds English UI strings for the new install toggles.
manager/app/src/main/res/values-zh-rCN/strings.xml Adds Simplified Chinese UI strings for the new install toggles.
manager/app/src/main/java/me/weishu/kernelsu/ui/util/KsuCli.kt Appends --allow-shell / --enable-adbd flags to the boot-patch command.
manager/app/src/main/java/me/weishu/kernelsu/ui/screen/install/InstallUiState.kt Extends install UI state/actions to include allow-shell and enable-adb selections.
manager/app/src/main/java/me/weishu/kernelsu/ui/screen/install/InstallScreen.kt Adds persisted state + actions for allow-shell and enable-adb toggles.
manager/app/src/main/java/me/weishu/kernelsu/ui/screen/install/InstallMiuix.kt Adds MIUIX checkboxes for the new toggles.
manager/app/src/main/java/me/weishu/kernelsu/ui/screen/install/InstallMaterial.kt Adds Material segmented checkbox items for the new toggles.
manager/app/src/main/java/me/weishu/kernelsu/ui/screen/flash/FlashUtils.kt Extends FlashIt.FlashBoot payload + installBoot() call to carry the new flags.
kernel/ksu.c Introduces allow_shell module param and logs when enabled.
kernel/allowlist.h Declares extern bool allow_shell; for allowlist usage.
kernel/allowlist.c Allows shell UID based on allow_shell and adjusts root-profile selection for shell.
Comments suppressed due to low confidence (1)

kernel/allowlist.h:58

  • The extern bool allow_shell; declaration is placed after the header guard’s closing #endif, so it is not protected by the include guard and will be re-declared on every include. Move this extern inside the guard (before the final #endif) to keep the header well-formed and avoid accidental duplication.
#endif

extern bool allow_shell;


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

You can also share your feedback on Copilot code review. Take the survey.

Comment thread kernel/ksu.c Outdated
Comment thread kernel/allowlist.c Outdated
Comment thread userspace/ksud/src/boot_patch.rs Outdated
Comment thread userspace/ksud/src/boot_patch.rs
Comment thread userspace/ksud/src/boot_patch.rs Outdated
@5ec1cff 5ec1cff requested a review from YuKongA March 16, 2026 02:30
@aviraxp aviraxp marked this pull request as ready for review March 16, 2026 08:57
@aviraxp aviraxp merged commit 5dddcbe into main Mar 16, 2026
21 checks passed
@aviraxp aviraxp deleted the allowshell branch March 16, 2026 08:58
backslashxx added a commit to backslashxx/KernelSU that referenced this pull request Mar 16, 2026
upstream: tiann@5dddcbe tiann#3298

we skip module param for this one, it does not make sense for built-in.

Signed-off-by: backslashxx <118538522+backslashxx@users.noreply.github.com>
backslashxx added a commit to backslashxx/KernelSU that referenced this pull request Mar 16, 2026
upstream: tiann@5dddcbe tiann#3298

we skip module param for this one, it does not make sense for built-in.

Signed-off-by: backslashxx <118538522+backslashxx@users.noreply.github.com>
KOWX712 added a commit to KOWX712/KernelSU that referenced this pull request Mar 16, 2026
Co-Authored-By: KOWX712 <leecc0503@gmail.com>
Co-Authored-By: YuKongA <70465933+YuKongA@users.noreply.github.com>
aviraxp pushed a commit that referenced this pull request Mar 16, 2026
Co-authored-by: KOWX712 <leecc0503@gmail.com>
Co-authored-by: YuKongA <70465933+YuKongA@users.noreply.github.com>
selfmusing pushed a commit to selfmusing/USlenreK that referenced this pull request Mar 16, 2026
Co-authored-by: KOWX712 <leecc0503@gmail.com>
Co-authored-by: YuKongA <70465933+YuKongA@users.noreply.github.com>
selfmusing pushed a commit to selfmusing/USlenreK that referenced this pull request Mar 16, 2026
upstream: tiann@5dddcbe tiann#3298

we skip module param for this one, it does not make sense for built-in.

Signed-off-by: backslashxx <118538522+backslashxx@users.noreply.github.com>
backslashxx added a commit to backslashxx/KernelSU that referenced this pull request Mar 17, 2026
upstream: tiann@5dddcbe tiann#3298

we skip module param for this one, it does not make sense for built-in.

Signed-off-by: backslashxx <118538522+backslashxx@users.noreply.github.com>
backslashxx added a commit to backslashxx/KernelSU that referenced this pull request Mar 17, 2026
upstream: tiann@5dddcbe tiann#3298

we skip module param for this one, it does not make sense for built-in.

Signed-off-by: backslashxx <118538522+backslashxx@users.noreply.github.com>
backslashxx added a commit to backslashxx/KernelSU that referenced this pull request Mar 17, 2026
upstream: tiann@5dddcbe tiann#3298

we skip module param for this one, it does not make sense for built-in.

Signed-off-by: backslashxx <118538522+backslashxx@users.noreply.github.com>
backslashxx added a commit to backslashxx/KernelSU that referenced this pull request Mar 17, 2026
upstream: tiann@5dddcbe tiann#3298

we skip module param for this one, it does not make sense for built-in.

Signed-off-by: backslashxx <118538522+backslashxx@users.noreply.github.com>
backslashxx added a commit to backslashxx/KernelSU that referenced this pull request Mar 17, 2026
upstream: tiann@5dddcbe tiann#3298

we skip module param for this one, it does not make sense for built-in.

Signed-off-by: backslashxx <118538522+backslashxx@users.noreply.github.com>
backslashxx added a commit to backslashxx/KernelSU that referenced this pull request Mar 20, 2026
upstream: tiann@5dddcbe tiann#3298

we skip module param for this one, it does not make sense for built-in.

Signed-off-by: backslashxx <118538522+backslashxx@users.noreply.github.com>
backslashxx added a commit to backslashxx/KernelSU that referenced this pull request Mar 20, 2026
upstream: tiann@5dddcbe tiann#3298

we skip module param for this one, it does not make sense for built-in.

Signed-off-by: backslashxx <118538522+backslashxx@users.noreply.github.com>
backslashxx added a commit to backslashxx/KernelSU that referenced this pull request Mar 20, 2026
upstream: tiann@5dddcbe tiann#3298

we skip module param for this one, it does not make sense for built-in.

Signed-off-by: backslashxx <118538522+backslashxx@users.noreply.github.com>
backslashxx added a commit to backslashxx/KernelSU that referenced this pull request Mar 20, 2026
upstream: tiann@5dddcbe tiann#3298

we skip module param for this one, it does not make sense for built-in.

Signed-off-by: backslashxx <118538522+backslashxx@users.noreply.github.com>
backslashxx added a commit to backslashxx/KernelSU that referenced this pull request Mar 20, 2026
upstream: tiann@5dddcbe tiann#3298

we skip module param for this one, it does not make sense for built-in.

Signed-off-by: backslashxx <118538522+backslashxx@users.noreply.github.com>
backslashxx added a commit to backslashxx/KernelSU that referenced this pull request Mar 20, 2026
upstream: tiann@5dddcbe tiann#3298

we skip module param for this one, it does not make sense for built-in.

Signed-off-by: backslashxx <118538522+backslashxx@users.noreply.github.com>
backslashxx added a commit to backslashxx/KernelSU that referenced this pull request Mar 20, 2026
upstream: tiann@5dddcbe tiann#3298

we skip module param for this one, it does not make sense for built-in.

Signed-off-by: backslashxx <118538522+backslashxx@users.noreply.github.com>
backslashxx added a commit to backslashxx/KernelSU that referenced this pull request Mar 20, 2026
upstream: tiann@5dddcbe tiann#3298

we skip module param for this one, it does not make sense for built-in.

Signed-off-by: backslashxx <118538522+backslashxx@users.noreply.github.com>
backslashxx added a commit to backslashxx/KernelSU that referenced this pull request Mar 20, 2026
upstream: tiann@5dddcbe tiann#3298

we skip module param for this one, it does not make sense for built-in.

Signed-off-by: backslashxx <118538522+backslashxx@users.noreply.github.com>
backslashxx added a commit to backslashxx/KernelSU that referenced this pull request Mar 20, 2026
upstream: tiann@5dddcbe tiann#3298

we skip module param for this one, it does not make sense for built-in.

Signed-off-by: backslashxx <118538522+backslashxx@users.noreply.github.com>
backslashxx added a commit to backslashxx/KernelSU that referenced this pull request Mar 20, 2026
upstream: tiann@5dddcbe tiann#3298

we skip module param for this one, it does not make sense for built-in.

Signed-off-by: backslashxx <118538522+backslashxx@users.noreply.github.com>
backslashxx added a commit to backslashxx/KernelSU that referenced this pull request Mar 20, 2026
upstream: tiann@5dddcbe tiann#3298

we skip module param for this one, it does not make sense for built-in.

Signed-off-by: backslashxx <118538522+backslashxx@users.noreply.github.com>
backslashxx added a commit to backslashxx/KernelSU that referenced this pull request Mar 20, 2026
upstream: tiann@5dddcbe tiann#3298

we skip module param for this one, it does not make sense for built-in.

Signed-off-by: backslashxx <118538522+backslashxx@users.noreply.github.com>
backslashxx added a commit to backslashxx/KernelSU that referenced this pull request Mar 20, 2026
upstream: tiann@5dddcbe tiann#3298

we skip module param for this one, it does not make sense for built-in.

Signed-off-by: backslashxx <118538522+backslashxx@users.noreply.github.com>
backslashxx added a commit to backslashxx/KernelSU that referenced this pull request Mar 20, 2026
upstream: tiann@5dddcbe tiann#3298

we skip module param for this one, it does not make sense for built-in.

Signed-off-by: backslashxx <118538522+backslashxx@users.noreply.github.com>
backslashxx added a commit to backslashxx/KernelSU that referenced this pull request Mar 20, 2026
upstream: tiann@5dddcbe tiann#3298

we skip module param for this one, it does not make sense for built-in.

Signed-off-by: backslashxx <118538522+backslashxx@users.noreply.github.com>
backslashxx added a commit to backslashxx/KernelSU that referenced this pull request Mar 20, 2026
upstream: tiann@5dddcbe tiann#3298

we skip module param for this one, it does not make sense for built-in.

Signed-off-by: backslashxx <118538522+backslashxx@users.noreply.github.com>
backslashxx added a commit to backslashxx/KernelSU that referenced this pull request Mar 20, 2026
upstream: tiann@5dddcbe tiann#3298

we skip module param for this one, it does not make sense for built-in.

Signed-off-by: backslashxx <118538522+backslashxx@users.noreply.github.com>
backslashxx added a commit to backslashxx/KernelSU that referenced this pull request Mar 20, 2026
upstream: tiann@5dddcbe tiann#3298

we skip module param for this one, it does not make sense for built-in.

Signed-off-by: backslashxx <118538522+backslashxx@users.noreply.github.com>
backslashxx added a commit to backslashxx/KernelSU that referenced this pull request Mar 20, 2026
upstream: tiann@5dddcbe tiann#3298

we skip module param for this one, it does not make sense for built-in.

Signed-off-by: backslashxx <118538522+backslashxx@users.noreply.github.com>
backslashxx added a commit to backslashxx/KernelSU that referenced this pull request Mar 20, 2026
upstream: tiann@5dddcbe tiann#3298

we skip module param for this one, it does not make sense for built-in.

Signed-off-by: backslashxx <118538522+backslashxx@users.noreply.github.com>
selfmusing pushed a commit to selfmusing/USlenreK that referenced this pull request Mar 20, 2026
upstream: tiann@5dddcbe tiann#3298

we skip module param for this one, it does not make sense for built-in.

Signed-off-by: backslashxx <118538522+backslashxx@users.noreply.github.com>
backslashxx added a commit to backslashxx/KernelSU that referenced this pull request Mar 21, 2026
upstream: tiann@5dddcbe tiann#3298

we skip module param for this one, it does not make sense for built-in.

Signed-off-by: backslashxx <118538522+backslashxx@users.noreply.github.com>
backslashxx added a commit to backslashxx/KernelSU that referenced this pull request Mar 21, 2026
upstream: tiann@5dddcbe tiann#3298

we skip module param for this one, it does not make sense for built-in.

Signed-off-by: backslashxx <118538522+backslashxx@users.noreply.github.com>
backslashxx added a commit to backslashxx/KernelSU that referenced this pull request Mar 21, 2026
upstream: tiann@5dddcbe tiann#3298

we skip module param for this one, it does not make sense for built-in.

Signed-off-by: backslashxx <118538522+backslashxx@users.noreply.github.com>
backslashxx added a commit to backslashxx/KernelSU that referenced this pull request Mar 21, 2026
upstream: tiann@5dddcbe tiann#3298

we skip module param for this one, it does not make sense for built-in.

Signed-off-by: backslashxx <118538522+backslashxx@users.noreply.github.com>
backslashxx added a commit to backslashxx/KernelSU that referenced this pull request Mar 21, 2026
upstream: tiann@5dddcbe tiann#3298

we skip module param for this one, it does not make sense for built-in.

Signed-off-by: backslashxx <118538522+backslashxx@users.noreply.github.com>
selfmusing pushed a commit to selfmusing/USlenreK that referenced this pull request Mar 21, 2026
upstream: tiann@5dddcbe tiann#3298

we skip module param for this one, it does not make sense for built-in.

Signed-off-by: backslashxx <118538522+backslashxx@users.noreply.github.com>
backslashxx added a commit to backslashxx/KernelSU that referenced this pull request Mar 22, 2026
upstream: tiann@5dddcbe tiann#3298

we skip module param for this one, it does not make sense for built-in.

Signed-off-by: backslashxx <118538522+backslashxx@users.noreply.github.com>
@JingMatrix

JingMatrix commented May 1, 2026

Copy link
Copy Markdown

The variable used in kernel space allow_shell and the variable allowShell used in manager UI are causing unnecessary confusion.
Current naming is a bad choice, as it would imply (though not true) that CONFIG_KSU_DEBUG forces the patching argument --allow-shell.

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.

6 participants