From 830fc758b90e936e1d1f05eba7239fdfcfda047d Mon Sep 17 00:00:00 2001 From: vvb2060 Date: Fri, 1 Nov 2024 00:13:16 +0800 Subject: [PATCH] init: Use apex dir to determine whether 2SI --- native/src/init/getinfo.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/native/src/init/getinfo.cpp b/native/src/init/getinfo.cpp index 7de8a63bd..9ab9ec8d1 100644 --- a/native/src/init/getinfo.cpp +++ b/native/src/init/getinfo.cpp @@ -236,6 +236,9 @@ bool check_two_stage() { return true; if (access("/system/bin/init", F_OK) == 0) 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 mmap_data init(backup_init()); return init.contains("selinux_setup");