Skip to content

Commit adfd8e2

Browse files
committed
tunnel: account for recent magisk using UID in sql
Signed-off-by: Jason A. Donenfeld <[email protected]>
1 parent e9243c4 commit adfd8e2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tunnel/src/main/java/com/wireguard/android/util/RootShell.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ public RootShell(final Context context) {
4646
final String packageName = context.getPackageName();
4747
if (packageName.contains("'"))
4848
throw new RuntimeException("Impossibly invalid package name contains a single quote");
49-
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",
50-
packageName, localBinaryDir, localTemporaryDir, packageName);
49+
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",
50+
packageName, localBinaryDir, localTemporaryDir, android.os.Process.myUid());
5151
}
5252

5353
private static boolean isExecutableInPath(final String name) {

0 commit comments

Comments
 (0)