From cacf65446dde64dc47c9a4d9a6af002f564274ea Mon Sep 17 00:00:00 2001 From: Steve Kondik Date: Wed, 10 Jun 2015 13:02:50 -0700 Subject: updater: Add LZMA support to blockimg * This adds support for LZMA compressed blockimages. The space savings from doing this is significant and will reduce our CDN costs by quite a bit. * I'll spend the saved $$$ on beer. Change-Id: I6679220aaa29592fe6bbccd4136f0c239e45e2ae --- updater/Android.mk | 2 +- updater/blockimg.c | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) (limited to 'updater') diff --git a/updater/Android.mk b/updater/Android.mk index 6e224fb..470eb5d 100644 --- a/updater/Android.mk +++ b/updater/Android.mk @@ -41,7 +41,7 @@ endif LOCAL_STATIC_LIBRARIES += $(TARGET_RECOVERY_UPDATER_LIBS) $(TARGET_RECOVERY_UPDATER_EXTRA_LIBS) LOCAL_STATIC_LIBRARIES += libapplypatch libedify libmtdutils libminzip libz -LOCAL_STATIC_LIBRARIES += libmincrypt libbz +LOCAL_STATIC_LIBRARIES += libmincrypt libbz libxz LOCAL_STATIC_LIBRARIES += libcutils liblog libc LOCAL_STATIC_LIBRARIES += libselinux tune2fs_static_libraries := \ diff --git a/updater/blockimg.c b/updater/blockimg.c index a93bfcb..be56fbd 100644 --- a/updater/blockimg.c +++ b/updater/blockimg.c @@ -341,7 +341,12 @@ static bool receive_new_data(const unsigned char* data, int size, void* cookie) static void* unzip_new_data(void* cookie) { NewThreadInfo* nti = (NewThreadInfo*) cookie; - mzProcessZipEntryContents(nti->za, nti->entry, receive_new_data, nti); + if (strncmp(".xz", nti->entry->fileName + (nti->entry->fileNameLen - 3), 3) == 0) { + mzProcessZipEntryContentsXZ(nti->za, nti->entry, receive_new_data, nti); + } else { + mzProcessZipEntryContents(nti->za, nti->entry, receive_new_data, nti); + } + return NULL; } -- cgit v1.1