summaryrefslogtreecommitdiffstats
path: root/partition.cpp
diff options
context:
space:
mode:
authorDees_Troy <dees_troy@teamw.in>2013-01-09 19:42:36 +0100
committerDees_Troy <dees_troy@teamw.in>2013-01-09 19:44:25 +0100
commit85f44ed751461d0368edbf5662c4ebc584078804 (patch)
treef9ccb3f7ad143778321a4d2bcd9a8c60204cd4eb /partition.cpp
parentAdd libtar to TWRP instead of using busybox tar (diff)
downloadandroid_bootable_recovery-85f44ed751461d0368edbf5662c4ebc584078804.tar
android_bootable_recovery-85f44ed751461d0368edbf5662c4ebc584078804.tar.gz
android_bootable_recovery-85f44ed751461d0368edbf5662c4ebc584078804.tar.bz2
android_bootable_recovery-85f44ed751461d0368edbf5662c4ebc584078804.tar.lz
android_bootable_recovery-85f44ed751461d0368edbf5662c4ebc584078804.tar.xz
android_bootable_recovery-85f44ed751461d0368edbf5662c4ebc584078804.tar.zst
android_bootable_recovery-85f44ed751461d0368edbf5662c4ebc584078804.zip
Diffstat (limited to '')
-rw-r--r--partition.cpp22
1 files changed, 20 insertions, 2 deletions
diff --git a/partition.cpp b/partition.cpp
index 7eac409f4..4a7a90023 100644
--- a/partition.cpp
+++ b/partition.cpp
@@ -44,6 +44,9 @@
extern "C" {
#include "mtdutils/mtdutils.h"
#include "mtdutils/mounts.h"
+#ifdef TW_INCLUDE_CRYPTO_SAMSUNG
+ #include "crypto/libcrypt_samsung/include/libcrypt_samsung.h"
+#endif
}
using namespace std;
@@ -87,6 +90,9 @@ TWPartition::TWPartition(void) {
Fstab_File_System = "";
Format_Block_Size = 0;
Ignore_Blkid = false;
+#ifdef TW_INCLUDE_CRYPTO_SAMSUNG
+ EcryptFS_Password = "";
+#endif
}
TWPartition::~TWPartition(void) {
@@ -684,9 +690,9 @@ bool TWPartition::Mount(bool Display_Error) {
return false;
} else
return true;
- } else if (Fstab_File_System == "exfat") {
+ } else if (Current_File_System == "exfat" && TWFunc::Path_Exists("/sbin/exfat-fuse")) {
string cmd = "/sbin/exfat-fuse " + Actual_Block_Device + " " + Mount_Point;
- LOGI("cmd: %s\n", cmd.c_str());
+ LOGI("cmd: %s\n", cmd.c_str());
string result;
if (TWFunc::Exec_Cmd(cmd, result) != 0)
return false;
@@ -698,6 +704,18 @@ bool TWPartition::Mount(bool Display_Error) {
LOGI("Actual block device: '%s', current file system: '%s'\n", Actual_Block_Device.c_str(), Current_File_System.c_str());
return false;
} else {
+#ifdef TW_INCLUDE_CRYPTO_SAMSUNG
+ if (EcryptFS_Password.size() > 0) {
+ if (mount_ecryptfs_drive(EcryptFS_Password.c_str(), Mount_Point.c_str(), Mount_Point.c_str(), 0) != 0) {
+ if (Display_Error)
+ LOGE("Unable to mount ecryptfs for '%s'\n", Mount_Point.c_str());
+ else
+ LOGI("Unable to mount ecryptfs for '%s'\n", Mount_Point.c_str());
+ } else {
+ LOGI("Successfully mounted ecryptfs for '%s'\n", Mount_Point.c_str());
+ }
+ }
+#endif
if (Removable)
Update_Size(Display_Error);