mirror of
https://github.com/topjohnwu/Magisk.git
synced 2025-12-11 22:32:20 +00:00
Support SELinux disabled on debug builds
This commit is contained in:
@@ -66,6 +66,8 @@ static void restore_magiskcon(int dirfd) {
|
||||
}
|
||||
|
||||
void restorecon() {
|
||||
if (!selinux_enabled())
|
||||
return;
|
||||
int fd = xopen(SELINUX_CONTEXT, O_WRONLY | O_CLOEXEC);
|
||||
if (write(fd, ADB_CON, sizeof(ADB_CON)) >= 0)
|
||||
lsetfilecon(SECURE_DIR, ADB_CON);
|
||||
@@ -76,6 +78,8 @@ void restorecon() {
|
||||
}
|
||||
|
||||
void restore_tmpcon() {
|
||||
if (!selinux_enabled())
|
||||
return;
|
||||
if (MAGISKTMP == "/sbin")
|
||||
setfilecon(MAGISKTMP.data(), ROOT_CON);
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user