diff options
author | Dees_Troy <dees_troy@teamw.in> | 2012-09-19 20:30:17 +0200 |
---|---|---|
committer | Dees_Troy <dees_troy@teamw.in> | 2012-09-19 20:37:33 +0200 |
commit | cfb63ae2b11dc5b9a7e0231a489131523114e7de (patch) | |
tree | 1c625c2d24fde213c5c9b8c8f537b33ac0d1ddc9 /adb_install.cpp | |
parent | Cleanup extra-functions (diff) | |
download | android_bootable_recovery-cfb63ae2b11dc5b9a7e0231a489131523114e7de.tar android_bootable_recovery-cfb63ae2b11dc5b9a7e0231a489131523114e7de.tar.gz android_bootable_recovery-cfb63ae2b11dc5b9a7e0231a489131523114e7de.tar.bz2 android_bootable_recovery-cfb63ae2b11dc5b9a7e0231a489131523114e7de.tar.lz android_bootable_recovery-cfb63ae2b11dc5b9a7e0231a489131523114e7de.tar.xz android_bootable_recovery-cfb63ae2b11dc5b9a7e0231a489131523114e7de.tar.zst android_bootable_recovery-cfb63ae2b11dc5b9a7e0231a489131523114e7de.zip |
Diffstat (limited to 'adb_install.cpp')
-rw-r--r-- | adb_install.cpp | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/adb_install.cpp b/adb_install.cpp index 12bce1cca..f5ba89c3f 100644 --- a/adb_install.cpp +++ b/adb_install.cpp @@ -33,6 +33,7 @@ extern "C" { #include "minadbd/adb.h" #include "twinstall.h" +#include "data.h" int TWinstall_zip(const char* path, int* wipe_cache); } @@ -86,6 +87,7 @@ apply_from_adb(RecoveryUI* ui_, int* wipe_cache, const char* install_file) { execl("/sbin/recovery", "recovery", "--adbd", NULL); _exit(-1); } + DataManager_SetIntValue("tw_child_pid", child); int status; // TODO(dougz): there should be a way to cancel waiting for a // package (by pushing some button combo on the device). For now @@ -108,5 +110,17 @@ apply_from_adb(RecoveryUI* ui_, int* wipe_cache, const char* install_file) { } return INSTALL_ERROR; } - return TWinstall_zip(ADB_SIDELOAD_FILENAME, wipe_cache); + char zip_file[255]; + if (strncmp(ADB_SIDELOAD_FILENAME, "/tmp", 4) == 0) { + char command[255]; + sprintf(zip_file, "%s/%s", DataManager_GetCurrentStoragePath(), "sideload.zip"); + ui->Print("Copying zip to '%s'\n", zip_file); + sprintf(command, "cp %s %s", ADB_SIDELOAD_FILENAME, zip_file); + system(command); + sprintf(command, "rm %s", ADB_SIDELOAD_FILENAME); + system(command); + } else { + strcpy(zip_file, ADB_SIDELOAD_FILENAME); + } + return TWinstall_zip(zip_file, wipe_cache); } |