diff --git a/Ext4Crypt.cpp b/Ext4Crypt.cpp index 09c33a0..7d65364 100644 --- a/Ext4Crypt.cpp +++ b/Ext4Crypt.cpp @@ -534,7 +534,12 @@ bool e4crypt_destroy_user_key(userid_t user_id) { for (auto const path: get_ce_key_paths(get_ce_key_directory_path(user_id))) { success &= android::vold::destroyKey(path); } - success &= android::vold::destroyKey(get_de_key_path(user_id)); + auto de_key_path = get_de_key_path(user_id); + if (path_exists(de_key_path)) { + success &= android::vold::destroyKey(de_key_path); + } else { + LOG(INFO) << "Not present so not erasing: " << de_key_path; + } } return success; }