diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2023-06-06 03:07:14 +0200 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2023-06-06 03:08:59 +0200 |
commit | adfd8e247b0283afde426407889cbef434cbe4ae (patch) | |
tree | d43e664c42bdde46c8b028fef51dd11eb9aeca85 /tunnel/src/main/java | |
parent | e9243c403ad7c80c87c632e3e4f0cf70ff959b18 (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/java')
-rw-r--r-- | tunnel/src/main/java/com/wireguard/android/util/RootShell.java | 4 |
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) { |