From 67c381a6faa5711ad85d65038f2349aeccddd283 Mon Sep 17 00:00:00 2001 From: Koushik Dutta Date: Sun, 2 Jan 2011 12:26:35 -0800 Subject: [PATCH] 3.0.0.4. Provide an error message if an Amend zip is provided. Change-Id: Ia740686a138cff01de2c1475acc0abccb18d9c2d --- Android.mk | 2 +- install.c | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/Android.mk b/Android.mk index cd0e067..748f70c 100644 --- a/Android.mk +++ b/Android.mk @@ -26,7 +26,7 @@ LOCAL_MODULE := recovery LOCAL_FORCE_STATIC_EXECUTABLE := true -RECOVERY_VERSION := ClockworkMod Recovery v3.0.0.2 +RECOVERY_VERSION := ClockworkMod Recovery v3.0.0.4 LOCAL_CFLAGS += -DRECOVERY_VERSION="$(RECOVERY_VERSION)" RECOVERY_API_VERSION := 2 LOCAL_CFLAGS += -DRECOVERY_API_VERSION=$(RECOVERY_API_VERSION) diff --git a/install.c b/install.c index 2d8a4cd..ad2c21d 100644 --- a/install.c +++ b/install.c @@ -39,6 +39,7 @@ #define ASSUMED_UPDATE_BINARY_NAME "META-INF/com/google/android/update-binary" +#define ASSUMED_UPDATE_SCRIPT_NAME "META-INF/com/google/android/update-script" #define PUBLIC_KEYS_FILE "/res/keys" // The update binary ask us to install a firmware file on reboot. Set @@ -102,6 +103,16 @@ try_update_binary(const char *path, ZipArchive *zip) { const ZipEntry* binary_entry = mzFindZipEntry(zip, ASSUMED_UPDATE_BINARY_NAME); if (binary_entry == NULL) { + const ZipEntry* update_script_entry = + mzFindZipEntry(zip, ASSUMED_UPDATE_SCRIPT_NAME); + if (update_script_entry != NULL) { + ui_print("Amend scripting (update-script) is no longer supported.\n"); + ui_print("Amend scripting was deprecated by Google in Android 1.5.\n"); + ui_print("It was necessary to remove it when upgrading to the ClockworkMod 3.0 Gingerbread based recovery.\n"); + ui_print("Please switch to Edify scripting (updater-script and update-binary) to create working update zip packages.\n"); + return INSTALL_UPDATE_BINARY_MISSING; + } + mzCloseZipArchive(zip); return INSTALL_UPDATE_BINARY_MISSING; }