More MD5 verification error handling
Distinguish between skipped md5 verification cases: - .md5/.md5sum file not found - .md5/.md5sum file unreadable Move MD5 error messages to twrpDigest Change-Id: I912e3d9ebe64e78bed76eab8aa468d619b45972f
This commit is contained in:
committed by
Gerrit Code Review
parent
fc966505e5
commit
d5c1a9220d
+3
-7
@@ -260,14 +260,10 @@ extern "C" int TWinstall_zip(const char* path, int* wipe_cache) {
|
||||
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("Zip MD5 does not match.\nUnable to install zip.\n");
|
||||
if (md5_return == -2) { // md5 did not match
|
||||
LOGERR("Aborting zip install\n");
|
||||
return INSTALL_CORRUPT;
|
||||
} else if (md5_return == -1) {
|
||||
gui_print("Skipping MD5 check: no MD5 file found.\n");
|
||||
} else if (md5_return == 0)
|
||||
gui_print("Zip MD5 matched.\n"); // MD5 found and matched.
|
||||
}
|
||||
|
||||
#ifndef TW_OEM_BUILD
|
||||
DataManager::GetValue(TW_SIGNED_ZIP_VERIFY_VAR, zip_verify);
|
||||
|
||||
Reference in New Issue
Block a user