From 32287c60c4ad888bb59ea8312589c6ddca770197 Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Thu, 14 Feb 2019 11:19:08 +0100 Subject: 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 --- .../main/java/com/wireguard/android/util/ToolsInstaller.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'app/src/main/java/com/wireguard/android') 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; } -- cgit v1.2.3