init: Use apex dir to determine whether 2SI

This commit is contained in:
vvb2060 2024-11-01 00:13:16 +08:00 committed by John Wu
parent 0f3cfef278
commit 830fc758b9

View File

@ -236,6 +236,9 @@ bool check_two_stage() {
return true; return true;
if (access("/system/bin/init", F_OK) == 0) if (access("/system/bin/init", F_OK) == 0)
return true; return true;
// Use the apex folder to determine whether 2SI (Android 10+)
if (access("/apex", F_OK) == 0)
return true;
// If we still have no indication, parse the original init and see what's up // If we still have no indication, parse the original init and see what's up
mmap_data init(backup_init()); mmap_data init(backup_init());
return init.contains("selinux_setup"); return init.contains("selinux_setup");