mirror of
https://github.com/topjohnwu/Magisk.git
synced 2024-12-22 16:07:39 +00:00
Restore context before copy
fix magiskpolicy context
This commit is contained in:
parent
8b095de04d
commit
c7c9fb9576
@ -40,3 +40,4 @@ bool selinux_enabled();
|
|||||||
void enable_selinux();
|
void enable_selinux();
|
||||||
void restorecon();
|
void restorecon();
|
||||||
void restore_tmpcon();
|
void restore_tmpcon();
|
||||||
|
void restore_databincon();
|
||||||
|
@ -152,6 +152,8 @@ static bool magisk_env() {
|
|||||||
xmkdir(SECURE_DIR "/post-fs-data.d", 0755);
|
xmkdir(SECURE_DIR "/post-fs-data.d", 0755);
|
||||||
xmkdir(SECURE_DIR "/service.d", 0755);
|
xmkdir(SECURE_DIR "/service.d", 0755);
|
||||||
|
|
||||||
|
restore_databincon();
|
||||||
|
|
||||||
if (access(DATABIN "/busybox", X_OK))
|
if (access(DATABIN "/busybox", X_OK))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
@ -74,6 +74,9 @@ void restorecon() {
|
|||||||
close(fd);
|
close(fd);
|
||||||
lsetfilecon(MODULEROOT, SYSTEM_CON);
|
lsetfilecon(MODULEROOT, SYSTEM_CON);
|
||||||
restore_syscon(xopen(MODULEROOT, O_RDONLY | O_CLOEXEC));
|
restore_syscon(xopen(MODULEROOT, O_RDONLY | O_CLOEXEC));
|
||||||
|
}
|
||||||
|
|
||||||
|
void restore_databincon() {
|
||||||
restore_magiskcon(xopen(DATABIN, O_RDONLY | O_CLOEXEC));
|
restore_magiskcon(xopen(DATABIN, O_RDONLY | O_CLOEXEC));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user