summaryrefslogtreecommitdiffhomepage
path: root/app/src
diff options
context:
space:
mode:
authorHarsh Shandilya <me@msfjarvis.dev>2018-12-29 15:31:26 +0100
committerJason A. Donenfeld <Jason@zx2c4.com>2019-02-14 11:03:41 +0100
commit69c6fa0a2452ae3d8cb5df4c9a0b62fb66ef1b2c (patch)
tree0704ac54f25b5f9f92c942d146766466a9e42a63 /app/src
parentc3e63df7b551eccd39de86293f7c3d62f85ebbcd (diff)
ToolsInstaller: Use chcon over restorecon
restorecon probes file_contexts to get the context to be applied to the file. /sbin/.magisk does not exist in file_contexts for obvious reasons so restorecon always fails. Use chcon directly with the system_file context to allow contexts to be applied. Suggested-by: Chris Renshaw <osm0sis@outlook.com> Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
Diffstat (limited to 'app/src')
-rw-r--r--app/src/main/java/com/wireguard/android/util/ToolsInstaller.java2
1 files changed, 1 insertions, 1 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 94e2bdc3..1317a90a 100644
--- a/app/src/main/java/com/wireguard/android/util/ToolsInstaller.java
+++ b/app/src/main/java/com/wireguard/android/util/ToolsInstaller.java
@@ -123,7 +123,7 @@ public final class ToolsInstaller {
script.append("touch /sbin/.core/img/wireguard/auto_mount; ");
for (final String[] names : EXECUTABLES) {
final File destination = new File("/sbin/.core/img/wireguard" + INSTALL_DIR, names[1]);
- script.append(String.format("cp '%s' '%s'; chmod 755 '%s'; restorecon '%s' || true; ",
+ 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));
}
script.append("trap - INT TERM EXIT;");