SELinux can be assumed for Android 4.4+

Change-Id: I7410a0c8e439eec90a955ee9201efd9a92bb9635
This commit is contained in:
Matt Mower
2017-01-18 12:40:26 -06:00
committed by Ethan Yonker
parent a0cd91d317
commit 874136434a
15 changed files with 61 additions and 152 deletions
+4 -6
View File
@@ -65,10 +65,8 @@ extern "C" {
#define CRYPT_FOOTER_OFFSET 0x4000
#endif
}
#ifdef HAVE_SELINUX
#include "selinux/selinux.h"
#include <selinux/selinux.h>
#include <selinux/label.h>
#endif
#ifdef HAVE_CAPABILITIES
#include <sys/capability.h>
#include <sys/xattr.h>
@@ -1910,7 +1908,7 @@ bool TWPartition::Wipe_EXT4() {
if (!UnMount(true))
return false;
#if defined(HAVE_SELINUX) && defined(USE_EXT4)
#if defined(USE_EXT4)
int ret;
char *secontext = NULL;
@@ -2619,14 +2617,14 @@ void TWPartition::Recreate_Media_Folder(void) {
#ifdef TW_INTERNAL_STORAGE_PATH
mkdir(EXPAND(TW_INTERNAL_STORAGE_PATH), 0770);
#endif
#ifdef HAVE_SELINUX
// Afterwards, we will try to set the
// default metadata that we were hopefully able to get during
// early boot.
tw_set_default_metadata(Media_Path.c_str());
if (!Internal_path.empty())
tw_set_default_metadata(Internal_path.c_str());
#endif
// Toggle mount to ensure that "internal sdcard" gets mounted
PartitionManager.UnMount_By_Path(Symlink_Mount_Point, true);
PartitionManager.Mount_By_Path(Symlink_Mount_Point, true);