summaryrefslogtreecommitdiffstats
path: root/twinstall.cpp
diff options
context:
space:
mode:
authorbigbiff bigbiff <bigbiff@teamw.in>2019-03-29 00:46:56 +0100
committerDees Troy <dees_troy@teamw.in>2019-04-02 05:42:47 +0200
commit718ab39bc5a6016c5d062e06d3cae34f7b710611 (patch)
tree785b783a64b2e01348ea431beb4ff8394fe09fb1 /twinstall.cpp
parentCorrect return case for context check in /cache/recovery (diff)
downloadandroid_bootable_recovery-718ab39bc5a6016c5d062e06d3cae34f7b710611.tar
android_bootable_recovery-718ab39bc5a6016c5d062e06d3cae34f7b710611.tar.gz
android_bootable_recovery-718ab39bc5a6016c5d062e06d3cae34f7b710611.tar.bz2
android_bootable_recovery-718ab39bc5a6016c5d062e06d3cae34f7b710611.tar.lz
android_bootable_recovery-718ab39bc5a6016c5d062e06d3cae34f7b710611.tar.xz
android_bootable_recovery-718ab39bc5a6016c5d062e06d3cae34f7b710611.tar.zst
android_bootable_recovery-718ab39bc5a6016c5d062e06d3cae34f7b710611.zip
Diffstat (limited to 'twinstall.cpp')
-rwxr-xr-x[-rw-r--r--]twinstall.cpp33
1 files changed, 2 insertions, 31 deletions
diff --git a/twinstall.cpp b/twinstall.cpp
index fa6b8594e..e4b11a7b6 100644..100755
--- a/twinstall.cpp
+++ b/twinstall.cpp
@@ -332,41 +332,12 @@ int TWinstall_zip(const char* path, int* wipe_cache) {
if (strlen(path) < 9 || strncmp(path, "/sideload", 9) != 0) {
string digest_str;
string Full_Filename = path;
- string digest_file = path;
- string defmd5file = digest_file + ".md5sum";
-
- if (TWFunc::Path_Exists(defmd5file)) {
- digest_file += ".md5sum";
- }
- else {
- digest_file += ".md5";
- }
gui_msg("check_for_digest=Checking for Digest file...");
- if (!TWFunc::Path_Exists(digest_file)) {
- gui_msg("no_digest=Skipping Digest check: no Digest file found");
- }
- else {
- if (TWFunc::read_file(digest_file, digest_str) != 0) {
- LOGERR("Skipping MD5 check: MD5 file unreadable\n");
- }
- else {
- twrpDigest *digest = new twrpMD5();
- if (!twrpDigestDriver::stream_file_to_digest(Full_Filename, digest)) {
- delete digest;
- return INSTALL_CORRUPT;
- }
- string digest_check = digest->return_digest_string();
- if (digest_str == digest_check) {
- gui_msg(Msg("digest_matched=Digest matched for '{1}'.")(path));
- }
- else {
+
+ if (!twrpDigestDriver::Check_File_Digest(Full_Filename)) {
LOGERR("Aborting zip install: Digest verification failed\n");
- delete digest;
return INSTALL_CORRUPT;
- }
- delete digest;
- }
}
}