18ba8cc7192c975645d8c74de30390938ecfd528
The current implementation of KSU manager's output screen simply prints `[H[J` when the `clear` command is used (in both the flashing module & action button screen) instead of clearing the screen: <img src="https://github.com/user-attachments/assets/c30ceb87-13ac-4ba6-a7c5-045564e83181" width="300" /> This limits the ability of shell scripts to purely textual & linear outputs, and prevents more flexible outputs such as a refreshing progress bar or even a progress circle for long running scripts. The current implementation moreover limits the output to 65536 bytes for the String `text`, causing the app to hang once this limit has been reached for scripts with more verbose outputs. This PR fixes these issues by allowing for usage of the `clear` command in shell scripts to clear the screen. It works by checking if the current output line starts with "[H[J", which is the default output of the `clear` command in KSU's busybox, and clears the previous outputs if there is a match. This should work universally since the `clear` command defaults to this implementation when ran in KSU manager. A working example can be seen below, where the `clear` command is heavily used (24 times a second) to test for performance & reliability of the code: https://github.com/user-attachments/assets/c45fb6f1-1b40-4b67-8837-4d9a00429715 Tested-by: backslashxx
English | Español | 简体中文 | 繁體中文 | 日本語 | 한국어 | Polski | Português (Brasil) | Türkçe | Русский | Tiếng Việt | Indonesia | עברית | हिंदी | Italiano
KernelSU
A Kernel-based root solution for Android devices.
Features
- Kernel-based
suand root access management. - Module system based on OverlayFS.
- App Profile: Lock up the root power in a cage.
Compatibility State
KernelSU officially supports Android GKI 2.0 devices (kernel 5.10+). Older kernels (4.14+) are also compatible, but the kernel will have to be built manually.
With this, WSA, ChromeOS, and container-based Android are all supported.
Currently, only arm64-v8a and x86_64 are supported.
Usage
Translation
To help translate KernelSU or improve existing translations, please use Weblate. PR of Manager's translation is no longer accepted, because it will conflict with Weblate.
Discussion
- Telegram: @KernelSU
Security
For information on reporting security vulnerabilities in KernelSU, see SECURITY.md.
License
- Files under the
kerneldirectory are GPL-2.0-only. - All other parts except the
kerneldirectory are GPL-3.0-or-later.
Credits
- kernel-assisted-superuser: the KernelSU idea.
- Magisk: the powerful root tool.
- genuine: apk v2 signature validation.
- Diamorphine: some rootkit skills.
Languages
Kotlin
67.1%
C
20%
Rust
11.1%
Shell
0.9%
Makefile
0.4%
Other
0.4%