mirror of
https://github.com/topjohnwu/Magisk.git
synced 2025-01-13 01:23:37 +00:00
Set context manually
This commit is contained in:
parent
f6d1f1985c
commit
c37a2e61ed
@ -11,6 +11,7 @@
|
|||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
#include <sys/un.h>
|
#include <sys/un.h>
|
||||||
|
#include <selinux/selinux.h>
|
||||||
|
|
||||||
#include "magisk.h"
|
#include "magisk.h"
|
||||||
#include "utils.h"
|
#include "utils.h"
|
||||||
@ -40,6 +41,9 @@ int socket_create_temp(char *path, size_t len) {
|
|||||||
xbind(fd, (struct sockaddr*) &sun, sizeof(sun));
|
xbind(fd, (struct sockaddr*) &sun, sizeof(sun));
|
||||||
xlisten(fd, 1);
|
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;
|
return fd;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user