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 | fd573f6c1c37bcfcd09237dfcd55e08b1e0eaff9 (patch) | |
tree | d31f9de9d69f3d51f7b34c20a5a83cb9eb813381 /app/src/main | |
parent | 1235e966d2afc24b50086d6b6455d24083643211 (diff) |
ToolsInstaller: restrict to only main app usage
We don't want lots of different packages fighting over who gets to
install the tools.
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'app/src/main')
-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(); } |