From c37a2e61ed13715b481b260d403c5aeef42f7c15 Mon Sep 17 00:00:00 2001 From: topjohnwu Date: Mon, 17 Apr 2017 16:32:41 +0800 Subject: [PATCH] Set context manually --- su_socket.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/su_socket.c b/su_socket.c index 742acce59..69c090d16 100644 --- a/su_socket.c +++ b/su_socket.c @@ -11,6 +11,7 @@ #include #include #include +#include #include "magisk.h" #include "utils.h" @@ -40,6 +41,9 @@ int socket_create_temp(char *path, size_t len) { xbind(fd, (struct sockaddr*) &sun, sizeof(sun)); xlisten(fd, 1); + // Set context to su_device, so apps can access it + setfilecon(sun.sun_path, "u:object_r:su_device:s0"); + return fd; }