diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2020-03-09 05:07:27 -0600 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2020-03-09 05:07:27 -0600 |
commit | b3981d3c903aed60a463faf9a48135b5a89d79c2 (patch) | |
tree | d31f9de9d69f3d51f7b34c20a5a83cb9eb813381 | |
parent | fd6ace34f09a15703beaa08c7f8171ccc8a0a1b8 (diff) |
ToolsInstaller: restrict to only main app usage
We don't want lots of different packages fighting over who gets to
install the tools.
-rw-r--r-- | app/src/main/java/com/wireguard/android/util/ToolsInstaller.java | 2 |
1 files changed, 2 insertions, 0 deletions
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(); } |