Update adb sideload feature
Change-Id: Ib503d0e87434e1a28430779302d6565211c26592
diff --git a/twinstall.cpp b/twinstall.cpp
index 595c4d2..4e478d4 100644
--- a/twinstall.cpp
+++ b/twinstall.cpp
@@ -257,14 +257,22 @@
string strpath = path;
ZipArchive Zip;
- gui_print("Installing '%s'...\nChecking for MD5 file...\n", path);
- md5sum.setfn(strpath);
- md5_return = md5sum.verify_md5digest();
- if (md5_return == -2) { // md5 did not match
- LOGERR("Aborting zip install\n");
+ if (strcmp(path, "error") == 0) {
+ LOGERR("Failed to get adb sideload file: '%s'\n", path);
return INSTALL_CORRUPT;
}
+ gui_print("Installing '%s'...\n", path);
+ if (strlen(path) < 9 || strncmp(path, "/sideload", 9) != 0) {
+ gui_print("Checking for MD5 file...\n");
+ md5sum.setfn(strpath);
+ md5_return = md5sum.verify_md5digest();
+ if (md5_return == -2) { // md5 did not match
+ LOGERR("Aborting zip install\n");
+ return INSTALL_CORRUPT;
+ }
+ }
+
#ifndef TW_OEM_BUILD
DataManager::GetValue(TW_SIGNED_ZIP_VERIFY_VAR, zip_verify);
#endif