diff options
-rw-r--r-- | recovery.c | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -56,6 +56,7 @@ static const struct option OPTIONS[] = { { "wipe_data", no_argument, NULL, 'w' }, { "wipe_cache", no_argument, NULL, 'c' }, { "show_text", no_argument, NULL, 't' }, + { "sideload", no_argument, NULL, 'l' }, { NULL, 0, NULL, 0 }, }; @@ -854,6 +855,7 @@ main(int argc, char **argv) { const char *send_intent = NULL; const char *update_package = NULL; int wipe_data = 0, wipe_cache = 0; + int sideload = 0; LOGI("Checking arguments.\n"); int arg; @@ -869,6 +871,7 @@ main(int argc, char **argv) { break; case 'c': wipe_cache = 1; break; case 't': ui_show_text(1); break; + case 'l': sideload = 1; break; case '?': LOGE("Invalid command argument\n"); continue; @@ -928,6 +931,13 @@ main(int argc, char **argv) { } else if (wipe_cache) { if (wipe_cache && erase_volume("/cache")) status = INSTALL_ERROR; if (status != INSTALL_SUCCESS) ui_print("Cache wipe failed.\n"); + } else if (sideload) { + signature_check_enabled = 0; + ui_set_show_text(1); + if (0 == apply_from_adb()) { + status = INSTALL_SUCCESS; + ui_set_show_text(0); + } } else { LOGI("Checking for extendedcommand...\n"); status = INSTALL_ERROR; // No command specified |