KernelSU WebUI Module
KernelSU’s WebUI module allows you to create user interfaces (UIs) for your custom modules. These UIs can be displayed within the KernelSU manager app using WebView. Here are the key points:
Webroot Directory:
- Place your web resource files in the
webroot
subdirectory of your module’s root directory. - Ensure that an
index.html
file exists in this directory; it serves as the entry point for your module’s web page.
- Place your web resource files in the
Permissions and SELinux Context:
- When installing the module, KernelSU automatically sets the permissions and SELinux context for the
webroot
directory. - Avoid manually adjusting permissions unless you’re confident in what you’re doing.
- When installing the module, KernelSU automatically sets the permissions and SELinux context for the
JavaScript API:
- KernelSU provides a JavaScript library (available on npm) that you can use in your web pages.
- Example: Execute a shell command to retrieve a specific configuration or modify a property:
import { exec } from 'kernelsu'; const { errno, stdout } = exec("getprop ro.product.model");
Additional Tips:
- Use
localStorage
for temporary data storage (note that it’s cleared when the Manager App is uninstalled). - For simple pages, consider using ParcelJS for easy packaging (zero configuration).
- Use