summaryrefslogtreecommitdiffstats
path: root/partitionmanager.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 /partitionmanager.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--partitionmanager.cpp17
1 files changed, 12 insertions, 5 deletions
diff --git a/partitionmanager.cpp b/partitionmanager.cpp
index 5f8b66a3a..5d75d3212 100644
--- a/partitionmanager.cpp
+++ b/partitionmanager.cpp
@@ -1596,7 +1596,7 @@ int TWPartitionManager::Decrypt_Device(string Password) {
efs = 0;
#ifdef TW_EXTERNAL_STORAGE_PATH
TWPartition* sdcard = Find_Partition_By_Path(EXPAND(TW_EXTERNAL_STORAGE_PATH));
- if (sdcard) {
+ if (sdcard && sdcard->Mount(false)) {
property_set("ro.crypto.external_encrypted", "1");
property_set("ro.crypto.external_blkdev", sdcard->Actual_Block_Device.c_str());
} else {
@@ -1639,12 +1639,19 @@ int TWPartitionManager::Decrypt_Device(string Password) {
emmc->Setup_File_System(false);
ui_print("Internal SD successfully decrypted, new block device: '%s'\n", crypto_blkdev_sd);
}
-
+#endif //ifdef CRYPTO_SD_FS_TYPE
#ifdef TW_EXTERNAL_STORAGE_PATH
- sdcard->Is_Decrypted = true;
- sdcard->Setup_File_System(false);
+ char is_external_decrypted[255];
+ property_get("ro.crypto.external_use_ecryptfs", is_external_decrypted, "0");
+ if (strcmp(is_external_decrypted, "1") == 0) {
+ sdcard->Is_Decrypted = true;
+ sdcard->EcryptFS_Password = Password;
+ sdcard->Decrypted_Block_Device = sdcard->Actual_Block_Device;
+ } else {
+ sdcard->Is_Decrypted = false;
+ sdcard->Decrypted_Block_Device = "";
+ }
#endif //ifdef TW_EXTERNAL_STORAGE_PATH
-#endif //ifdef CRYPTO_SD_FS_TYPE
// Sleep for a bit so that the device will be ready
sleep(1);