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 /gui/action.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 'gui/action.cpp')
-rw-r--r-- | gui/action.cpp | 34 |
1 files changed, 30 insertions, 4 deletions
diff --git a/gui/action.cpp b/gui/action.cpp index 5118b4c29..4114bf0aa 100644 --- a/gui/action.cpp +++ b/gui/action.cpp @@ -1057,16 +1057,42 @@ LOGE("TODO: Implement ORS support\n"); simulate_progress_bar(); } else { int wipe_cache = 0; + string Command; + + if (!PartitionManager.Mount_Current_Storage(true)) { + operation_end(1, simulate); + return 0; + } + if (TWFunc::Path_Exists(ADB_SIDELOAD_FILENAME)) { + Command = "rm "; + Command += ADB_SIDELOAD_FILENAME; + system(Command.c_str()); + } + Command = "touch "; + Command += ADB_SIDELOAD_FILENAME; + system(Command.c_str()); ui_print("Starting ADB sideload feature...\n"); - system("touch /tmp/update.zip"); - ret = apply_from_adb(ui, &wipe_cache, "/tmp/last_install"); - LOGI("Result was: %i\n", ret); + ret = apply_from_adb(ui, &wipe_cache, "/tmp/install_log"); if (ret != 0) - ret = 1; + ret = 1; // failure + else if (wipe_cache) + PartitionManager.Wipe_By_Path("/cache"); } operation_end(ret, simulate); return 0; } + if (function == "adbsideloadcancel") + { + int child_pid; + string Command; + Command = "rm "; + Command += ADB_SIDELOAD_FILENAME; + system(Command.c_str()); + DataManager::GetValue("tw_child_pid", child_pid); + ui_print("Cancelling ADB sideload...\n"); + kill(child_pid, SIGTERM); + return 0; + } } else { |