bryanyee33 54d09f136c Imitate terminal clear command in manager (#2307)
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 "", 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
2024-12-25 16:35:45 +06:00
2024-12-25 04:45:46 +06:00
2024-12-25 16:08:24 +06:00
2024-09-14 21:52:11 +08:00
2024-12-24 23:31:25 +06:00
2024-03-08 10:31:41 +08:00
2024-02-29 20:35:03 +08:00
2022-12-09 22:03:55 +08:00
2023-10-09 22:53:21 +08:00

English | 简体中文

KernelSU Next

logo

A Kernel-based root solution for Android devices.

Latest release Nightly Release License: GPL v2 GitHub License

Features

  1. Kernel-based su and root access management.
  2. Module system based on OverlayFS.
  3. App Profile: Lock up the root power in a cage.

Compatibility State

KernelSU Next officially supports most Android kernels starting from 4.9 upto 6.6.

  • GKI 2.0 (5.10+) kernels can run pre-built images and LKM/KMI.
  • GKI 1.0 (4.19 - 5.4) kernels need to rebuilt with KernelSU driver.
  • EOL (<4.19) kernels also need to be rebuilt with KernelSU driver.

Currently, only arm64-v8a is supported.

Security

For information on reporting security vulnerabilities in KernelSU, see SECURITY.md.

License

Credits

Description
An advanced Kernel based root solution for Android
Readme GPL-3.0 22 MiB
v1.0.8 Latest
2025-06-16 00:00:17 +00:00
Languages
Kotlin 44%
Rust 29.4%
C 16.5%
Java 4.4%
Shell 2.9%
Other 2.7%