summaryrefslogtreecommitdiffstats
path: root/twinstall.cpp
diff options
context:
space:
mode:
authorEthan Yonker <dees_troy@teamw.in>2014-12-10 18:40:43 +0100
committerEthan Yonker <dees_troy@teamw.in>2014-12-10 18:54:02 +0100
commit738be7a3ffec0a4053478d49821c7da9c5fd9ee6 (patch)
tree1c8efbf90b4045d41f7664b0b88a75cff545a729 /twinstall.cpp
parentcrypto: fix build in < 5.0 tree (diff)
downloadandroid_bootable_recovery-738be7a3ffec0a4053478d49821c7da9c5fd9ee6.tar
android_bootable_recovery-738be7a3ffec0a4053478d49821c7da9c5fd9ee6.tar.gz
android_bootable_recovery-738be7a3ffec0a4053478d49821c7da9c5fd9ee6.tar.bz2
android_bootable_recovery-738be7a3ffec0a4053478d49821c7da9c5fd9ee6.tar.lz
android_bootable_recovery-738be7a3ffec0a4053478d49821c7da9c5fd9ee6.tar.xz
android_bootable_recovery-738be7a3ffec0a4053478d49821c7da9c5fd9ee6.tar.zst
android_bootable_recovery-738be7a3ffec0a4053478d49821c7da9c5fd9ee6.zip
Diffstat (limited to 'twinstall.cpp')
-rw-r--r--twinstall.cpp24
1 files changed, 2 insertions, 22 deletions
diff --git a/twinstall.cpp b/twinstall.cpp
index 01bd67278..91a1a3595 100644
--- a/twinstall.cpp
+++ b/twinstall.cpp
@@ -33,15 +33,9 @@
#include "minui/minui.h"
#include "mtdutils/mounts.h"
#include "mtdutils/mtdutils.h"
-#if (ANDROID_VERSION >= 5)
#include "minzip/SysUtil.h"
#include "minzip/Zip.h"
#include "verifier.h"
-#else
-#include "verifierold.h"
-#include "minzipold/SysUtil.h"
-#include "minzipold/Zip.h"
-#endif
#include "variables.h"
#include "data.hpp"
#include "partitions.hpp"
@@ -279,44 +273,30 @@ extern "C" int TWinstall_zip(const char* path, int* wipe_cache) {
#endif
DataManager::SetProgress(0);
-#if (ANDROID_VERSION >= 5)
MemMapping map;
if (sysMapFile(path, &map) != 0) {
LOGERR("Failed to sysMapFile '%s'\n", path);
return -1;
}
-#endif
if (zip_verify) {
gui_print("Verifying zip signature...\n");
-#if (ANDROID_VERSION >= 5)
ret_val = verify_file(map.addr, map.length);
-#else
- ret_val = verify_file(path);
-#endif
if (ret_val != VERIFY_SUCCESS) {
LOGERR("Zip signature verification failed: %i\n", ret_val);
-#if (ANDROID_VERSION >= 5)
sysReleaseMap(&map);
-#endif
return -1;
+ } else {
+ gui_print("Zip signature verified successfully.\n");
}
}
-#if (ANDROID_VERSION >= 5)
ret_val = mzOpenZipArchive(map.addr, map.length, &Zip);
-#else
- ret_val = mzOpenZipArchive(path, &Zip);
-#endif
if (ret_val != 0) {
LOGERR("Zip file is corrupt!\n", path);
-#if (ANDROID_VERSION >= 5)
sysReleaseMap(&map);
-#endif
return INSTALL_CORRUPT;
}
ret_val = Run_Update_Binary(path, &Zip, wipe_cache);
-#if (ANDROID_VERSION >= 5)
sysReleaseMap(&map);
-#endif
return ret_val;
}