summaryrefslogtreecommitdiffhomepage
path: root/tunnel/src/main
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2023-06-06 03:07:14 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2023-06-06 03:08:59 +0200
commitadfd8e247b0283afde426407889cbef434cbe4ae (patch)
treed43e664c42bdde46c8b028fef51dd11eb9aeca85 /tunnel/src/main
parente9243c403ad7c80c87c632e3e4f0cf70ff959b18 (diff)
tunnel: account for recent magisk using UID in sql
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'tunnel/src/main')
-rw-r--r--tunnel/src/main/java/com/wireguard/android/util/RootShell.java4
1 files changed, 2 insertions, 2 deletions
diff --git a/tunnel/src/main/java/com/wireguard/android/util/RootShell.java b/tunnel/src/main/java/com/wireguard/android/util/RootShell.java
index e123733b..c61695de 100644
--- a/tunnel/src/main/java/com/wireguard/android/util/RootShell.java
+++ b/tunnel/src/main/java/com/wireguard/android/util/RootShell.java
@@ -46,8 +46,8 @@ public class RootShell {
final String packageName = context.getPackageName();
if (packageName.contains("'"))
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 package_name='%s'\" >/dev/null 2>&1; id -u\n",
- packageName, localBinaryDir, localTemporaryDir, packageName);
+ 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());
}
private static boolean isExecutableInPath(final String name) {