Browse Source

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>
master
Jason A. Donenfeld 4 years ago
parent
commit
fd573f6c1c
1 changed files with 2 additions and 0 deletions
  1. +2
    -0
      app/src/main/java/com/wireguard/android/util/ToolsInstaller.java

+ 2
- 0
app/src/main/java/com/wireguard/android/util/ToolsInstaller.java View File

@@ -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();
}



Loading…
Cancel
Save