Support Android 11 SELinux paths

This is NOT proper Android 11 support
This commit is contained in:
topjohnwu 2020-02-21 00:49:33 -08:00
parent 3b8ea599f0
commit 0d229dac3b
2 changed files with 9 additions and 0 deletions

View File

@ -83,6 +83,14 @@ static bool check_precompiled(const char *precompiled) {
return false;
}
actual_sha = SYSEXT_POLICY_DIR "system_ext_sepolicy_and_mapping.sha256";
if (access(actual_sha, R_OK) == 0) {
ok = true;
sprintf(compiled_sha, "%s.system_ext_sepolicy_and_mapping.sha256", precompiled);
if (!cmp_sha256(actual_sha, compiled_sha) != 0)
return false;
}
return ok;
}

View File

@ -13,6 +13,7 @@
#define VEND_POLICY_DIR "/vendor/etc/selinux/"
#define PROD_POLICY_DIR "/product/etc/selinux/"
#define ODM_POLICY_DIR "/odm/etc/selinux/"
#define SYSEXT_POLICY_DIR "/system_ext/etc/selinux/"
#define SPLIT_PLAT_CIL PLAT_POLICY_DIR "plat_sepolicy.cil"
#define SEPOL_PROC_DOMAIN "magisk"