summaryrefslogtreecommitdiffstats
path: root/partition.cpp
diff options
context:
space:
mode:
authorEthan Yonker <dees_troy@teamw.in>2014-12-20 22:38:29 +0100
committermaxwen <max.weninger@gmail.com>2014-12-21 23:30:17 +0100
commitd79d9bceb36cebbcb926e414155489c6ce8fb741 (patch)
tree34a692a812da666be2b2b6dbaace17ce084c48c7 /partition.cpp
parentMTP add/remove storage instead of disabling MTP (diff)
downloadandroid_bootable_recovery-d79d9bceb36cebbcb926e414155489c6ce8fb741.tar
android_bootable_recovery-d79d9bceb36cebbcb926e414155489c6ce8fb741.tar.gz
android_bootable_recovery-d79d9bceb36cebbcb926e414155489c6ce8fb741.tar.bz2
android_bootable_recovery-d79d9bceb36cebbcb926e414155489c6ce8fb741.tar.lz
android_bootable_recovery-d79d9bceb36cebbcb926e414155489c6ce8fb741.tar.xz
android_bootable_recovery-d79d9bceb36cebbcb926e414155489c6ce8fb741.tar.zst
android_bootable_recovery-d79d9bceb36cebbcb926e414155489c6ce8fb741.zip
Diffstat (limited to '')
-rw-r--r--partition.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/partition.cpp b/partition.cpp
index b20367f77..409a688d5 100644
--- a/partition.cpp
+++ b/partition.cpp
@@ -1371,6 +1371,15 @@ bool TWPartition::Wipe_Encryption() {
Has_Data_Media = false;
Decrypted_Block_Device = "";
+#ifdef TW_INCLUDE_CRYPTO
+ if (Is_Decrypted) {
+ if (!UnMount(true))
+ return false;
+ if (delete_crypto_blk_dev("userdata") != 0) {
+ LOGERR("Error deleting crypto block device, continuing anyway.\n");
+ }
+ }
+#endif
Is_Decrypted = false;
Is_Encrypted = false;
Find_Actual_Block_Device();
@@ -1381,6 +1390,7 @@ bool TWPartition::Wipe_Encryption() {
if (Mount(false))
PartitionManager.Add_MTP_Storage(MTP_Storage_ID);
}
+ DataManager::SetValue(TW_IS_ENCRYPTED, 0);
#ifndef TW_OEM_BUILD
gui_print("You may need to reboot recovery to be able to use /data again.\n");
#endif