From b3981d3c903aed60a463faf9a48135b5a89d79c2 Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Mon, 9 Mar 2020 05:07:27 -0600 Subject: ToolsInstaller: restrict to only main app usage We don't want lots of different packages fighting over who gets to install the tools. --- app/src/main/java/com/wireguard/android/util/ToolsInstaller.java | 2 ++ 1 file changed, 2 insertions(+) (limited to 'app/src/main/java') diff --git a/app/src/main/java/com/wireguard/android/util/ToolsInstaller.java b/app/src/main/java/com/wireguard/android/util/ToolsInstaller.java index 89607768..ac18cabf 100644 --- a/app/src/main/java/com/wireguard/android/util/ToolsInstaller.java +++ b/app/src/main/java/com/wireguard/android/util/ToolsInstaller.java @@ -105,6 +105,8 @@ public final class ToolsInstaller { } public int install() throws RootShellException, IOException { + if (!context.getPackageName().startsWith("com.wireguard.")) + throw new SecurityException("The tools may only be installed system-wide from the main WireGuard app."); return willInstallAsMagiskModule() ? installMagisk() : installSystem(); } -- cgit v1.2.3