summaryrefslogtreecommitdiffstats
path: root/twinstall.cpp
diff options
context:
space:
mode:
authorEthan Yonker <dees_troy@teamw.in>2014-11-08 00:19:07 +0100
committerEthan Yonker <dees_troy@teamw.in>2014-11-08 00:25:46 +0100
commit24813426b9cf6d4a79e5da68008d1a4532e6c710 (patch)
treea7acec7a7c25379eed6caa207e008ec6029afdb5 /twinstall.cpp
parentFix zip install (diff)
downloadandroid_bootable_recovery-24813426b9cf6d4a79e5da68008d1a4532e6c710.tar
android_bootable_recovery-24813426b9cf6d4a79e5da68008d1a4532e6c710.tar.gz
android_bootable_recovery-24813426b9cf6d4a79e5da68008d1a4532e6c710.tar.bz2
android_bootable_recovery-24813426b9cf6d4a79e5da68008d1a4532e6c710.tar.lz
android_bootable_recovery-24813426b9cf6d4a79e5da68008d1a4532e6c710.tar.xz
android_bootable_recovery-24813426b9cf6d4a79e5da68008d1a4532e6c710.tar.zst
android_bootable_recovery-24813426b9cf6d4a79e5da68008d1a4532e6c710.zip
Diffstat (limited to '')
-rw-r--r--twinstall.cpp18
1 files changed, 13 insertions, 5 deletions
diff --git a/twinstall.cpp b/twinstall.cpp
index 595c4d2a6..4e478d408 100644
--- a/twinstall.cpp
+++ b/twinstall.cpp
@@ -257,14 +257,22 @@ extern "C" int TWinstall_zip(const char* path, int* wipe_cache) {
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