diff options
author | James Christopher Adduono <jc@adduono.com> | 2016-10-25 08:18:32 +0200 |
---|---|---|
committer | James Christopher Adduono <jc@adduono.com> | 2016-11-05 20:48:43 +0100 |
commit | 5c3950716e5c7c6279efd5f3f338d6d22e5215e2 (patch) | |
tree | eac6d63ac558644ba313e73fe5e96134e18361ef /twinstall.cpp | |
parent | Fix image flashing (diff) | |
download | android_bootable_recovery-5c3950716e5c7c6279efd5f3f338d6d22e5215e2.tar android_bootable_recovery-5c3950716e5c7c6279efd5f3f338d6d22e5215e2.tar.gz android_bootable_recovery-5c3950716e5c7c6279efd5f3f338d6d22e5215e2.tar.bz2 android_bootable_recovery-5c3950716e5c7c6279efd5f3f338d6d22e5215e2.tar.lz android_bootable_recovery-5c3950716e5c7c6279efd5f3f338d6d22e5215e2.tar.xz android_bootable_recovery-5c3950716e5c7c6279efd5f3f338d6d22e5215e2.tar.zst android_bootable_recovery-5c3950716e5c7c6279efd5f3f338d6d22e5215e2.zip |
Diffstat (limited to 'twinstall.cpp')
-rw-r--r-- | twinstall.cpp | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/twinstall.cpp b/twinstall.cpp index c2f98febc..50d286c45 100644 --- a/twinstall.cpp +++ b/twinstall.cpp @@ -296,9 +296,18 @@ extern "C" int TWinstall_zip(const char* path, int* wipe_cache) { gui_msg("check_for_md5=Checking for MD5 file..."); twrpDigest md5sum; md5sum.setfn(path); - int md5_return = md5sum.verify_md5digest(); - if (md5_return == -2) { // md5 did not match - LOGERR("Aborting zip install\n"); + switch (md5sum.verify_md5digest()) { + case MD5_OK: + gui_msg(Msg("md5_matched=MD5 matched for '{1}'.")(path)); + break; + case MD5_NOT_FOUND: + gui_msg("no_md5=Skipping MD5 check: no MD5 file found"); + break; + case MD5_FILE_UNREADABLE: + LOGERR("Skipping MD5 check: MD5 file unreadable\n"); + break; + case MD5_MATCH_FAIL: // md5 did not match + LOGERR("Aborting zip install: MD5 verification failed\n"); return INSTALL_CORRUPT; } } |