From be936303368c68a2c6e096c0c56288fdba13779a Mon Sep 17 00:00:00 2001
From: Pawit Pornkitprasan
Date: Tue, 27 Jan 2015 22:29:39 +0700
Subject: [PATCH] recovery: uncrypt: fix compatibility with CWM
CWM and other older recoveries do not support block map, so avoid
using it when possible
Change-Id: I49a04676ca5193db31c87418a5760727648745f0
---
uncrypt/uncrypt.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/uncrypt/uncrypt.c b/uncrypt/uncrypt.c
index 7fb0989..6bc4f51 100644
--- a/uncrypt/uncrypt.c
+++ b/uncrypt/uncrypt.c
@@ -423,7 +423,10 @@ int main(int argc, char** argv)
// On /data we want to convert the file to a block map so that we
// can read the package without mounting the partition. On /cache
// and /sdcard we leave the file alone.
- if (strncmp(path, "/data/", 6) != 0) {
+ //
+ // HACK: ignore above: block map is only used with encryption device
+ // for compatibility with older recoveries
+ if (!encrypted || strncmp(path, "/data/", 6) != 0) {
// path does not start with "/data/"; leave it alone.
unlink(RECOVERY_COMMAND_FILE_TMP);
} else {
--
2.3.5