tunnel: add quotes around calling package

Judging by the previous check, this was clearly intended.

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
This commit is contained in:
Jason A. Donenfeld 2023-06-08 15:04:39 +02:00
parent e744ce4569
commit a5b4b9c428

View File

@ -46,7 +46,7 @@ public class RootShell {
final String packageName = context.getPackageName(); final String packageName = context.getPackageName();
if (packageName.contains("'")) if (packageName.contains("'"))
throw new RuntimeException("Impossibly invalid package name contains a single quote"); throw new RuntimeException("Impossibly invalid package name contains a single quote");
preamble = String.format("export CALLING_PACKAGE=%s PATH=\"%s:$PATH\" TMPDIR='%s'; magisk --sqlite \"UPDATE policies SET notification=0, logging=0 WHERE uid=%d\" >/dev/null 2>&1; id -u\n", preamble = String.format("export CALLING_PACKAGE='%s' PATH=\"%s:$PATH\" TMPDIR='%s'; magisk --sqlite \"UPDATE policies SET notification=0, logging=0 WHERE uid=%d\" >/dev/null 2>&1; id -u\n",
packageName, localBinaryDir, localTemporaryDir, android.os.Process.myUid()); packageName, localBinaryDir, localTemporaryDir, android.os.Process.myUid());
} }