From adfd8e247b0283afde426407889cbef434cbe4ae Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Tue, 6 Jun 2023 03:07:14 +0200 Subject: [PATCH] tunnel: account for recent magisk using UID in sql Signed-off-by: Jason A. Donenfeld --- .../src/main/java/com/wireguard/android/util/RootShell.java | 4 ++-- 1 file 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) {