summaryrefslogtreecommitdiffhomepage
path: root/app/src/main
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2019-02-14 11:19:08 +0100
committerJason A. Donenfeld <Jason@zx2c4.com>2019-02-14 11:59:10 +0100
commit32287c60c4ad888bb59ea8312589c6ddca770197 (patch)
tree3816e846b7c1224a91451323fa1fc0a05fbb5559 /app/src/main
parent69c6fa0a2452ae3d8cb5df4c9a0b62fb66ef1b2c (diff)
ToolsInstaller: Require Magisk 18
People installing magisk modules are people capable of updating Magisk. No need to leave around old compat cruft. 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.java12
1 files changed, 6 insertions, 6 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 1317a90a..6012cf77 100644
--- a/app/src/main/java/com/wireguard/android/util/ToolsInstaller.java
+++ b/app/src/main/java/com/wireguard/android/util/ToolsInstaller.java
@@ -117,12 +117,12 @@ public final class ToolsInstaller {
private int installMagisk() throws NoRootException {
final StringBuilder script = new StringBuilder("set -ex; ");
- script.append("trap 'rm -rf /sbin/.core/img/wireguard' INT TERM EXIT; ");
- script.append(String.format("rm -rf /sbin/.core/img/wireguard/; mkdir -p /sbin/.core/img/wireguard%s; ", INSTALL_DIR));
- script.append(String.format("printf 'name=WireGuard Command Line Tools\nversion=%s\nversionCode=%s\nauthor=zx2c4\ndescription=Command line tools for WireGuard\nminMagisk=1500\n' > /sbin/.core/img/wireguard/module.prop; ", BuildConfig.VERSION_NAME, BuildConfig.VERSION_CODE));
- script.append("touch /sbin/.core/img/wireguard/auto_mount; ");
+ script.append("trap 'rm -rf /sbin/ecore/img/wireguard' INT TERM EXIT; ");
+ script.append(String.format("rm -rf /sbin/.magisk/img/wireguard/; mkdir -p /sbin/.magisk/img/wireguard%s; ", INSTALL_DIR));
+ script.append(String.format("printf 'name=WireGuard Command Line Tools\nversion=%s\nversionCode=%s\nauthor=zx2c4\ndescription=Command line tools for WireGuard\nminMagisk=1500\n' > /sbin/.magisk/img/wireguard/module.prop; ", BuildConfig.VERSION_NAME, BuildConfig.VERSION_CODE));
+ script.append("touch /sbin/.magisk/img/wireguard/auto_mount; ");
for (final String[] names : EXECUTABLES) {
- final File destination = new File("/sbin/.core/img/wireguard" + INSTALL_DIR, names[1]);
+ final File destination = new File("/sbin/.magisk/img/wireguard" + INSTALL_DIR, names[1]);
script.append(String.format("cp '%s' '%s'; chmod 755 '%s'; chcon 'u:object_r:system_file:s0' '%s' || true; ",
new File(nativeLibraryDir, names[0]), destination, destination, destination));
}
@@ -179,7 +179,7 @@ public final class ToolsInstaller {
synchronized (lock) {
if (installAsMagiskModule == null) {
try {
- installAsMagiskModule = Application.getRootShell().run(null, "[ -d /sbin/.core/mirror -a -d /sbin/.core/img -a ! -f /cache/.disable_magisk ]") == OsConstants.EXIT_SUCCESS;
+ installAsMagiskModule = Application.getRootShell().run(null, "[ -d /sbin/.magisk/mirror -a -d /sbin/.magisk/img -a ! -f /cache/.disable_magisk ]") == OsConstants.EXIT_SUCCESS;
} catch (final Exception ignored) {
installAsMagiskModule = false;
}