From fd5ad91d266a77be785d291cfbd8b8b4994b4486 Mon Sep 17 00:00:00 2001 From: topjohnwu Date: Fri, 4 Sep 2020 06:06:03 -0700 Subject: [PATCH] Proper 2SI detection --- native/jni/init/getinfo.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/native/jni/init/getinfo.cpp b/native/jni/init/getinfo.cpp index 5d6734eac..3a2812c6a 100644 --- a/native/jni/init/getinfo.cpp +++ b/native/jni/init/getinfo.cpp @@ -182,6 +182,9 @@ void load_kernel_info(cmdline *cmd) { bool check_two_stage() { if (access("/apex", F_OK) == 0) return true; - auto init = raw_data::mmap_ro("/init"); + if (access("/system/bin/init", F_OK) == 0) + return true; + // If we still have no indication, parse the original init and see what's up + auto init = raw_data::mmap_ro("/.backup/init"); return init.find("selinux_setup"); }