aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKoushik Dutta <koush@koushikdutta.com>2013-04-11 13:37:21 -0700
committerKoushik Dutta <koush@koushikdutta.com>2013-04-11 13:37:21 -0700
commitfb5a9a9fab085785a22127f712944ac82fe4b133 (patch)
tree558d77d03e7bf70f58ad0f259807bc0dcc38c3a0
parentfba8e1618c86c2b6ae571c6ed1f19f776fde4ab7 (diff)
downloadbootable_recovery-fb5a9a9fab085785a22127f712944ac82fe4b133.zip
bootable_recovery-fb5a9a9fab085785a22127f712944ac82fe4b133.tar.gz
bootable_recovery-fb5a9a9fab085785a22127f712944ac82fe4b133.tar.bz2
allow sideload to be triggered via /cache/recovery command for eat
Change-Id: I36996ceea831160830815c1b267328f307bbd906
-rw-r--r--recovery.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/recovery.c b/recovery.c
index 6e50541..0f56d0e 100644
--- a/recovery.c
+++ b/recovery.c
@@ -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