From 738be7a3ffec0a4053478d49821c7da9c5fd9ee6 Mon Sep 17 00:00:00 2001 From: Ethan Yonker Date: Wed, 10 Dec 2014 11:40:43 -0600 Subject: Use one mizip for all The new minzip did not compile in older trees due to needing mmap64. For older trees we will just use mmap instead. Remove all files and code pertaining to minzipold. Updater should now build properly in older trees as well. Eliminate use of PLATFORM_VERSION in favor of PLATFORM_SDK_VERSION which should be more consistent and reliable. Change-Id: I38d2b604a73d1b17a2072c7d60e990b81ece0c10 --- gui/Android.mk | 5 ----- gui/blanktimer.cpp | 5 ----- gui/gui.cpp | 5 ----- gui/objects.hpp | 8 -------- gui/pages.cpp | 18 ------------------ gui/pages.hpp | 4 ---- gui/resources.hpp | 4 ---- 7 files changed, 49 deletions(-) (limited to 'gui') diff --git a/gui/Android.mk b/gui/Android.mk index 3502ba95d..479bc76f9 100644 --- a/gui/Android.mk +++ b/gui/Android.mk @@ -81,11 +81,6 @@ ifeq ($(TW_CUSTOM_THEME),) endif endif -# Auto filled build flag -ifeq ($(PLATFORM_VERSION), 5.0.1) - LOCAL_CFLAGS += -DANDROID_VERSION=5 -endif - LOCAL_C_INCLUDES += bionic external/stlport/stlport $(commands_recovery_local_path)/gui/devices/$(DEVICE_RESOLUTION) include $(BUILD_STATIC_LIBRARY) diff --git a/gui/blanktimer.cpp b/gui/blanktimer.cpp index 1b184297b..371d3f126 100644 --- a/gui/blanktimer.cpp +++ b/gui/blanktimer.cpp @@ -40,11 +40,6 @@ extern "C" { #include "../data.hpp" extern "C" { #include "../twcommon.h" -#ifdef HAVE_SELINUX -#include "../minzip/Zip.h" -#else -#include "../minzipold/Zip.h" -#endif } #include "../twrp-functions.hpp" #include "../variables.h" diff --git a/gui/gui.cpp b/gui/gui.cpp index 2c6418e4c..d07c49ff4 100644 --- a/gui/gui.cpp +++ b/gui/gui.cpp @@ -39,11 +39,6 @@ extern "C" { #include "../twcommon.h" #include "../minuitwrp/minui.h" -#ifdef HAVE_SELINUX -#include "../minzip/Zip.h" -#else -#include "../minzipold/Zip.h" -#endif #include } diff --git a/gui/objects.hpp b/gui/objects.hpp index cf20d7e9c..310ba4e26 100644 --- a/gui/objects.hpp +++ b/gui/objects.hpp @@ -28,14 +28,6 @@ #include #include -extern "C" { -#ifdef HAVE_SELINUX -#include "../minzip/Zip.h" -#else -#include "../minzipold/Zip.h" -#endif -} - using namespace rapidxml; #include "../data.hpp" diff --git a/gui/pages.cpp b/gui/pages.cpp index b110e3820..bea39e902 100644 --- a/gui/pages.cpp +++ b/gui/pages.cpp @@ -39,13 +39,8 @@ extern "C" { #include "../twcommon.h" #include "../minuitwrp/minui.h" -#if (ANDROID_VERSION >= 5) #include "../minzip/SysUtil.h" #include "../minzip/Zip.h" -#else -#include "../minzipold/SysUtil.h" -#include "../minzipold/Zip.h" -#endif } #include "rapidxml.hpp" @@ -926,9 +921,7 @@ int PageManager::LoadPackage(std::string name, std::string package, std::string char* xmlFile = NULL; PageSet* pageSet = NULL; int ret; -#if (ANDROID_VERSION >= 5) MemMapping map; -#endif // Open the XML file LOGINFO("Loading package: %s (%s)\n", name.c_str(), package.c_str()); @@ -955,7 +948,6 @@ int PageManager::LoadPackage(std::string name, std::string package, std::string else { LOGINFO("Loading zip theme\n"); -#if (ANDROID_VERSION >= 5) if (!TWFunc::Path_Exists(package)) return -1; if (sysMapFile(package.c_str(), &map) != 0) { @@ -967,12 +959,6 @@ int PageManager::LoadPackage(std::string name, std::string package, std::string sysReleaseMap(&map); return -1; } -#else - if (mzOpenZipArchive(package.c_str(), &zip)) { - LOGERR("Failed to open theme zip.\n"); - return -1; - } -#endif pZip = &zip; const ZipEntry* ui_xml = mzFindZipEntry(&zip, "ui.xml"); if (ui_xml == NULL) @@ -1020,9 +1006,7 @@ int PageManager::LoadPackage(std::string name, std::string package, std::string if (pZip) { mzCloseZipArchive(pZip); -#if (ANDROID_VERSION >= 5) sysReleaseMap(&map); -#endif } return ret; @@ -1030,9 +1014,7 @@ error: LOGERR("An internal error has occurred.\n"); if (pZip) { mzCloseZipArchive(pZip); -#if (ANDROID_VERSION >= 5) sysReleaseMap(&map); -#endif } if (xmlFile) free(xmlFile); diff --git a/gui/pages.hpp b/gui/pages.hpp index 2afbe78b2..f1179f53e 100644 --- a/gui/pages.hpp +++ b/gui/pages.hpp @@ -3,11 +3,7 @@ #ifndef _PAGES_HEADER_HPP #define _PAGES_HEADER_HPP -#ifdef HAVE_SELINUX #include "../minzip/Zip.h" -#else -#include "../minzipold/Zip.h" -#endif typedef struct { unsigned char red; diff --git a/gui/resources.hpp b/gui/resources.hpp index 54a1185c3..f359c55dd 100644 --- a/gui/resources.hpp +++ b/gui/resources.hpp @@ -3,11 +3,7 @@ #ifndef _RESOURCE_HEADER #define _RESOURCE_HEADER -#ifdef HAVE_SELINUX #include "../minzip/Zip.h" -#else -#include "../minzipold/Zip.h" -#endif // Base Objects class Resource -- cgit v1.2.3