Repository navigation
KsuWebUI-SN 1.2-33
·
41 commits
to main
since this release
Tip
Highlights: faster module load, the module console (Eruda) has a new Executions tab that records every command a WebUI runs as root, with its output, exit code and duration.
✨ New
- Executions tab: when Enable console debug is on for a module, its console now has an Executions tab. It lists every
ksu.execandksu.spawncall the WebUI makes, showing the time, the command, a ✓ / ✗ / … status, the exit code and how long it took. Calls that are still running update live. - Call details: tap a call to see the full command, its options, stdout and stderr. Copy command and Copy output buttons are included.
- Search, sort and filter: search across commands and output, switch between Newest first and Oldest first (your choice is remembered), and filter to Failed calls only.
- Export and clear: Export saves all calls as a text file named
KsuWebUI-SN_execution-DD-MM-YYYY_HH-MM.txt. Clear empties the list.
🔁 Changed
- Faster module list: module cards are now prepared in the background right after the app opens, so the list scrolls more smoothly the first time.
- Console debug off: nothing is recorded and the Executions tab is not added, so modules without console debug are unaffected.
⚙️ Under the hood
For developers ⚠️ (Click to expand)
Execution log (ExecLog.kt, new)
ExecLog(enabled): an in-memory log, one per WebUI session.start,out,errandendrecord events, and every method returns immediately whenenabledis false.- Limits: it keeps at most 200 calls, 5,000,000 characters per call and 30,000,000 in total. The oldest calls are dropped first, and a call that hits its cap gets a
truncevent. ExecLogInterface: exposed to JS asksu_exec_logwithevents(after)(returns events newer than a sequence number) andclear(). It is only added when console debug is on for the module.
WebView bridge (WebViewInterface.kt, WebViewHelper.kt)
WebViewInterface(state, log): now takes anExecLog. Bothexecvariants andspawnlog the start, stdout, stderr and exit code.spawnLabel(command, args)builds the display text for spawned commands.initWebView: readsKEY_CONSOLE_MODULESfrom the settings prefs to decide whether the module has console debug on. It creates theExecLogfrom that and addsksu_exec_logonly when it is on.- Injection:
erudaJs("executions")is added to the Eruda startup script aftertheme.
Eruda panel (assets/eruda/executions.js, new)
- Tool: an
eruda.Toolsubclass namedExecutionsthat pollsksu_exec_log.events(lastSeq)every 600 ms, only while the tab is visible. - UI: search, order toggle (kept in
localStorageasksu-exec-order), All / Failed filter, Export and Clear. The tab is moved ahead of Elements, and Elements moves next to Settings. - Export: builds the text file and saves it through
ksu_download.save.
Card prewarming (MainActivity.kt)
prewarmCards(): uses aLooperidle handler to create 6 card view holders and put them in the RecyclerView pool. It is called fromonCreatebefore the first refresh and stops if the activity is destroyed.