aboutsummaryrefslogtreecommitdiffstats
path: root/recovery.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'recovery.cpp')
-rw-r--r--recovery.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/recovery.cpp b/recovery.cpp
index 3ecd5db..72ce09e 100644
--- a/recovery.cpp
+++ b/recovery.cpp
@@ -635,6 +635,9 @@ static bool erase_volume(const char* volume, bool force = false) {
copy_logs();
}
+ ui->SetBackground(RecoveryUI::NONE);
+ ui->SetProgressType(RecoveryUI::EMPTY);
+
return (result == 0);
}
@@ -837,11 +840,19 @@ static bool wipe_data(int should_confirm, Device* device, bool force = false) {
modified_flash = true;
ui->Print("\n-- Wiping data...\n");
- bool success =
+ bool success;
+retry:
+ success =
device->PreWipeData() &&
erase_volume("/data", force) &&
erase_volume("/cache") &&
device->PostWipeData();
+ if (!success && !force) {
+ if (!should_confirm || yes_no(device, "Wipe failed, format instead?", " THIS CAN NOT BE UNDONE!")) {
+ force = true;
+ goto retry;
+ }
+ }
ui->Print("Data wipe %s.\n", success ? "complete" : "failed");
return success;
}