summaryrefslogtreecommitdiffstats
path: root/uncrypt/uncrypt.c
diff options
context:
space:
mode:
authorDoug Zongker <dougz@google.com>2014-09-05 17:22:12 +0200
committerThe Android Automerger <android-build@google.com>2014-09-05 22:06:47 +0200
commitf9bc2a544d5189ef9279edb8b5d67913eec53855 (patch)
tree7c233011fdcaec52fdbb8d88a4f1f07f22ca1c4d /uncrypt/uncrypt.c
parentmerge in lmp-release history after reset to 5f875bf57739bf0b5c2d182173513233bdb71ab8 (diff)
downloadandroid_bootable_recovery-f9bc2a544d5189ef9279edb8b5d67913eec53855.tar
android_bootable_recovery-f9bc2a544d5189ef9279edb8b5d67913eec53855.tar.gz
android_bootable_recovery-f9bc2a544d5189ef9279edb8b5d67913eec53855.tar.bz2
android_bootable_recovery-f9bc2a544d5189ef9279edb8b5d67913eec53855.tar.lz
android_bootable_recovery-f9bc2a544d5189ef9279edb8b5d67913eec53855.tar.xz
android_bootable_recovery-f9bc2a544d5189ef9279edb8b5d67913eec53855.tar.zst
android_bootable_recovery-f9bc2a544d5189ef9279edb8b5d67913eec53855.zip
Diffstat (limited to 'uncrypt/uncrypt.c')
-rw-r--r--uncrypt/uncrypt.c21
1 files changed, 9 insertions, 12 deletions
diff --git a/uncrypt/uncrypt.c b/uncrypt/uncrypt.c
index 07e5ae665..189fa57e1 100644
--- a/uncrypt/uncrypt.c
+++ b/uncrypt/uncrypt.c
@@ -160,8 +160,6 @@ char* parse_recovery_command_file()
int count = 0;
char temp[1024];
-
-
FILE* f = fopen(RECOVERY_COMMAND_FILE, "r");
if (f == NULL) {
return NULL;
@@ -405,16 +403,15 @@ int main(int argc, char** argv)
ALOGI("encryptable: %s\n", encryptable ? "yes" : "no");
ALOGI(" encrypted: %s\n", encrypted ? "yes" : "no");
- if (!encryptable) {
- // If the file is on a filesystem that doesn't support
- // encryption (eg, /cache), then leave it alone.
- //
- // TODO: change this to be !encrypted -- if the file is on
- // /data but /data isn't encrypted, we don't need to use the
- // block map mechanism. We do for now so as to get more
- // testing of it (since most dogfood devices aren't
- // encrypted).
-
+ // Recovery supports installing packages from 3 paths: /cache,
+ // /data, and /sdcard. (On a particular device, other locations
+ // may work, but those are three we actually expect.)
+ //
+ // 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) {
+ // path does not start with "/data/"; leave it alone.
unlink(RECOVERY_COMMAND_FILE_TMP);
} else {
ALOGI("writing block map %s", map_file);