diff options
-rw-r--r-- | crypto/vold_decrypt/vold_decrypt.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/crypto/vold_decrypt/vold_decrypt.cpp b/crypto/vold_decrypt/vold_decrypt.cpp index ded4e7b67..707466e4c 100644 --- a/crypto/vold_decrypt/vold_decrypt.cpp +++ b/crypto/vold_decrypt/vold_decrypt.cpp @@ -1013,14 +1013,14 @@ int Vold_Decrypt_Core(const string& Password) { return VD_ERR_PASSWORD_EMPTY; } - // Mount system and check for vold and vdc - if (!PartitionManager.Mount_By_Path("/system", true)) { + // Mount ANDROID_ROOT and check for vold and vdc + if (!PartitionManager.Mount_By_Path(PartitionManager.Get_Android_Root_Path(), true)) { return VD_ERR_UNABLE_TO_MOUNT_SYSTEM; - } else if (!TWFunc::Path_Exists("/system/bin/vold")) { - LOGINFO("ERROR: /system/bin/vold not found, aborting.\n"); + } else if ((!TWFunc::Path_Exists("/system/bin/vold")) && (!TWFunc::Path_Exists(PartitionManager.Get_Android_Root_Path() + "/system/bin/vold"))) { + LOGINFO("ERROR: vold not found, aborting.\n"); return VD_ERR_MISSING_VOLD; - } else if (!TWFunc::Path_Exists("/system/bin/vdc")) { - LOGINFO("ERROR: /system/bin/vdc not found, aborting.\n"); + } else if ((!TWFunc::Path_Exists("/system/bin/vdc")) && (!TWFunc::Path_Exists(PartitionManager.Get_Android_Root_Path() + "/system/bin/vdc"))) { + LOGINFO("ERROR: vdc not found, aborting.\n"); return VD_ERR_MISSING_VDC; } @@ -1109,11 +1109,11 @@ int Vold_Decrypt_Core(const string& Password) { if (is_fstab_symlinked) Restore_Recovery_Fstab(); - if (!PartitionManager.UnMount_By_Path("/system", true)) { - // PartitionManager failed to unmount /system, this should not happen, + if (!PartitionManager.UnMount_By_Path(PartitionManager.Get_Android_Root_Path(), true)) { + // PartitionManager failed to unmount ANDROID_ROOT, this should not happen, // but in case it does, do a lazy unmount - LOGINFO("WARNING: system could not be unmounted normally!\n"); - umount2("/system", MNT_DETACH); + LOGINFO("WARNING: '%s' could not be unmounted normally!\n", PartitionManager.Get_Android_Root_Path().c_str()); + umount2(PartitionManager.Get_Android_Root_Path().c_str(), MNT_DETACH); } LOGINFO("Finished.\n"); |