feature: allow shell & force enable adbd#3298
Conversation
There was a problem hiding this comment.
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=1module parameter fromksuinitbased on a ramdisk marker file. - Add KernelSU kernel-side
allow_shellmodule 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 thisexterninside 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.
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>
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>
Co-Authored-By: KOWX712 <leecc0503@gmail.com> Co-Authored-By: YuKongA <70465933+YuKongA@users.noreply.github.com>
Co-authored-by: KOWX712 <leecc0503@gmail.com> Co-authored-by: YuKongA <70465933+YuKongA@users.noreply.github.com>
Co-authored-by: KOWX712 <leecc0503@gmail.com> Co-authored-by: YuKongA <70465933+YuKongA@users.noreply.github.com>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
|
The variable used in kernel space |
No description provided.