mirror of
https://github.com/topjohnwu/Magisk.git
synced 2025-12-10 05:52:04 +00:00
Add hijack sepolicy support for rootfs devices
On older Android versions, pre-mounting selinuxfs will lead to errors, so we have to use a different method to block init's control flow. Since all devices that falls in this catagory must both: 1. Be Android 8.0 - 9.0 2. Have early mount fstab in its device tree We can actually use the same FIFO trick, but this time not on selinuxfs, but on the read-only device tree nodes in sysfs or procfs. By mocking the fstab/compatible node in the device tree, we can block init when it attempts to do early mount; at that point, we can then mock selinuxfs as we normally would, successfully hijack and inject patched sepolicy.
This commit is contained in:
@@ -108,12 +108,6 @@ static int test_main(int argc, char *argv[]) {
|
||||
}
|
||||
#endif // ENABLE_TEST
|
||||
|
||||
static int magisk_proxy_main(int argc, char *argv[]) {
|
||||
auto init = make_unique<MagiskProxy>(argv);
|
||||
init->start();
|
||||
return 1;
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
umask(0);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user