summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEthan Yonker <dees_troy@teamw.in>2015-11-04 18:58:27 +0100
committerDees Troy <dees_troy@teamw.in>2015-11-05 20:08:02 +0100
commita1de1496a936be088f03add87144a8fcbe94d0e3 (patch)
tree59ecc575a81aab2b82ffc2ab3e42fe65bf965f63
parentTreat /vendor like /system for read only (diff)
downloadandroid_bootable_recovery-a1de1496a936be088f03add87144a8fcbe94d0e3.tar
android_bootable_recovery-a1de1496a936be088f03add87144a8fcbe94d0e3.tar.gz
android_bootable_recovery-a1de1496a936be088f03add87144a8fcbe94d0e3.tar.bz2
android_bootable_recovery-a1de1496a936be088f03add87144a8fcbe94d0e3.tar.lz
android_bootable_recovery-a1de1496a936be088f03add87144a8fcbe94d0e3.tar.xz
android_bootable_recovery-a1de1496a936be088f03add87144a8fcbe94d0e3.tar.zst
android_bootable_recovery-a1de1496a936be088f03add87144a8fcbe94d0e3.zip
Diffstat (limited to '')
-rw-r--r--partitionmanager.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/partitionmanager.cpp b/partitionmanager.cpp
index ad17fe4a6..945a96cc2 100644
--- a/partitionmanager.cpp
+++ b/partitionmanager.cpp
@@ -1436,12 +1436,10 @@ void TWPartitionManager::Update_System_Details(void) {
int TWPartitionManager::Decrypt_Device(string Password) {
#ifdef TW_INCLUDE_CRYPTO
int ret_val, password_len;
- char crypto_blkdev[255], cPassword[255];
+ char crypto_state[PROPERTY_VALUE_MAX], crypto_blkdev[PROPERTY_VALUE_MAX], cPassword[255];
size_t result;
std::vector<TWPartition*>::iterator iter;
- property_set("ro.crypto.state", "encrypted");
-
// Mount any partitions that need to be mounted for decrypt
for (iter = Partitions.begin(); iter != Partitions.end(); iter++) {
if ((*iter)->Mount_To_Decrypt) {
@@ -1449,6 +1447,13 @@ int TWPartitionManager::Decrypt_Device(string Password) {
}
}
+ property_get("ro.crypto.state", crypto_state, "error");
+ if (strcmp(crypto_state, "error") == 0) {
+ property_set("ro.crypto.state", "encrypted");
+ // Sleep for a bit so that services can start if needed
+ sleep(1);
+ }
+
strcpy(cPassword, Password.c_str());
int pwret = cryptfs_check_passwd(cPassword);