From 185baeeb7940f7b88f96143f849b80069dd1b8a9 Mon Sep 17 00:00:00 2001 From: Chris Soyars Date: Fri, 26 Feb 2010 02:45:55 -0500 Subject: [PATCH] Added ability to wipe_data and update_package at the same time. This will be needed for a future project I am working on, OpenUpdater. --- recovery.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/recovery.c b/recovery.c index 6b16470..1f2c83f 100644 --- a/recovery.c +++ b/recovery.c @@ -515,6 +515,13 @@ main(int argc, char **argv) } if (update_package != NULL) { + if (wipe_data && erase_root("DATA:")) status = INSTALL_ERROR; + status = install_package(update_package); + if (status != INSTALL_SUCCESS) ui_print("Installation aborted.\n"); + } else if (update_package != NULL && wipe_data) { + if (device_wipe_data()) status = INSTALL_ERROR; + if (erase_root("DATA:")) status = INSTALL_ERROR; + if (wipe_cache && erase_root("CACHE:")) status = INSTALL_ERROR; status = install_package(update_package); if (status != INSTALL_SUCCESS) ui_print("Installation aborted.\n"); } else if (wipe_data) { @@ -545,4 +552,4 @@ main(int argc, char **argv) int get_allow_toggle_display() { return allow_display_toggle; -} \ No newline at end of file +}