summaryrefslogtreecommitdiffstats
path: root/twrp.cpp
diff options
context:
space:
mode:
authorDees_Troy <dees_troy@teamw.in>2013-08-17 15:14:43 +0200
committerGerrit Code Review <gerrit@198.50.184.117>2013-08-24 14:42:30 +0200
commita95f55c3ef657411f92c0c00a2e23ceb1d52b851 (patch)
treeca5c779bea6a16f5e1b397c59de80058fe9b7bb0 /twrp.cpp
parentMerge "Fix AOSP decrypt when TouchWiz code is present" into twrp2.5 (diff)
downloadandroid_bootable_recovery-a95f55c3ef657411f92c0c00a2e23ceb1d52b851.tar
android_bootable_recovery-a95f55c3ef657411f92c0c00a2e23ceb1d52b851.tar.gz
android_bootable_recovery-a95f55c3ef657411f92c0c00a2e23ceb1d52b851.tar.bz2
android_bootable_recovery-a95f55c3ef657411f92c0c00a2e23ceb1d52b851.tar.lz
android_bootable_recovery-a95f55c3ef657411f92c0c00a2e23ceb1d52b851.tar.xz
android_bootable_recovery-a95f55c3ef657411f92c0c00a2e23ceb1d52b851.tar.zst
android_bootable_recovery-a95f55c3ef657411f92c0c00a2e23ceb1d52b851.zip
Diffstat (limited to 'twrp.cpp')
-rw-r--r--twrp.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/twrp.cpp b/twrp.cpp
index bc3ce7b6d..04851aaf1 100644
--- a/twrp.cpp
+++ b/twrp.cpp
@@ -46,6 +46,11 @@ extern "C" {
#include "openrecoveryscript.hpp"
#include "variables.h"
+#ifdef HAVE_SELINUX
+#include "selinux/label.h"
+struct selabel_handle *selinux_handle;
+#endif
+
TWPartitionManager PartitionManager;
int Log_Offset;
@@ -90,6 +95,17 @@ int main(int argc, char **argv) {
// Load up all the resources
gui_loadResources();
+#ifdef HAVE_SELINUX
+ struct selinux_opt selinux_options[] = {
+ { SELABEL_OPT_PATH, "/file_contexts" }
+ };
+ selinux_handle = selabel_open(SELABEL_CTX_FILE, selinux_options, 1);
+ if (!selinux_handle)
+ printf("No file contexts for SELinux\n");
+ else
+ printf("SELinux contexts loaded from /file_contexts\n");
+#endif
+
PartitionManager.Mount_By_Path("/cache", true);
string Zip_File, Reboot_Value;