summaryrefslogtreecommitdiffstats
path: root/twinstall.cpp
diff options
context:
space:
mode:
authorEthan Yonker <dees_troy@teamw.in>2016-08-27 05:22:24 +0200
committerEthan Yonker <dees_troy@teamw.in>2016-08-27 05:22:26 +0200
commit072c8d82dd5718e02bd44479e14e25fb52f13261 (patch)
treede2ad908cf89e4209c63d0432d65caf2a03bd4ab /twinstall.cpp
parentFix compatibility across the board (diff)
downloadandroid_bootable_recovery-072c8d82dd5718e02bd44479e14e25fb52f13261.tar
android_bootable_recovery-072c8d82dd5718e02bd44479e14e25fb52f13261.tar.gz
android_bootable_recovery-072c8d82dd5718e02bd44479e14e25fb52f13261.tar.bz2
android_bootable_recovery-072c8d82dd5718e02bd44479e14e25fb52f13261.tar.lz
android_bootable_recovery-072c8d82dd5718e02bd44479e14e25fb52f13261.tar.xz
android_bootable_recovery-072c8d82dd5718e02bd44479e14e25fb52f13261.tar.zst
android_bootable_recovery-072c8d82dd5718e02bd44479e14e25fb52f13261.zip
Diffstat (limited to 'twinstall.cpp')
-rw-r--r--twinstall.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/twinstall.cpp b/twinstall.cpp
index 83cd383bc..485eb6065 100644
--- a/twinstall.cpp
+++ b/twinstall.cpp
@@ -255,6 +255,8 @@ static int Run_Update_Binary(const char *path, ZipArchive *Zip, int* wipe_cache)
*wipe_cache = 1;
} else if (strcmp(command, "clear_display") == 0) {
// Do nothing, not supported by TWRP
+ } else if (strcmp(command, "log") == 0) {
+ printf("%s\n", strtok(NULL, "\n"));
} else {
LOGERR("unknown command [%s]\n", command);
}
@@ -330,12 +332,18 @@ extern "C" int TWinstall_zip(const char* path, int* wipe_cache) {
sysReleaseMap(&map);
return INSTALL_CORRUPT;
}
+ time_t start, stop;
+ time(&start);
ret_val = Run_Update_Binary(path, &Zip, wipe_cache);
+ time(&stop);
+ int total_time = (int) difftime(stop, start);
if (ret_val == INSTALL_CORRUPT) {
// If no updater binary is found, check for ui.xml
ret_val = Install_Theme(path, &Zip);
if (ret_val == INSTALL_CORRUPT)
gui_msg(Msg(msg::kError, "no_updater_binary=Could not find '{1}' in the zip file.")(ASSUMED_UPDATE_BINARY_NAME));
+ } else {
+ LOGINFO("Install took %i second(s).\n", total_time);
}
sysReleaseMap(&map);
return ret_val;