From ebfadcc4576ddb292c444eaed0cfede2b9edee6e Mon Sep 17 00:00:00 2001 From: LoveSy Date: Mon, 9 Mar 2026 10:11:21 +0800 Subject: [PATCH] Fix module install showing script help due to unescaped single quotes The command passed to busybox `script -c '...'` contained embedded single quotes (from echo and file path), breaking the outer quoting. Escape them with the standard POSIX `'\''` technique before wrapping. Made-with: Cursor --- .../main/java/com/topjohnwu/magisk/terminal/TerminalProcess.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/apk/src/main/java/com/topjohnwu/magisk/terminal/TerminalProcess.kt b/app/apk/src/main/java/com/topjohnwu/magisk/terminal/TerminalProcess.kt index 185c32495..76adbf351 100644 --- a/app/apk/src/main/java/com/topjohnwu/magisk/terminal/TerminalProcess.kt +++ b/app/apk/src/main/java/com/topjohnwu/magisk/terminal/TerminalProcess.kt @@ -35,10 +35,11 @@ fun runSuCommand(emulator: TerminalEmulator, command: String): Boolean { val cols = emulator.mColumns val rows = emulator.mRows val wrappedCmd = "export TERM=xterm-256color; stty cols $cols rows $rows 2>/dev/null; $command" + val escapedCmd = wrappedCmd.replace("'", "'\\''") val process = ProcessBuilder( "su", "-c", - "$busyboxPath script -q -c '$wrappedCmd' /dev/null" + "$busyboxPath script -q -c '$escapedCmd' /dev/null" ).redirectErrorStream(true).start() process.outputStream.close()