diff options
Diffstat (limited to 'cmds')
-rw-r--r-- | cmds/installd/commands.c | 16 | ||||
-rw-r--r-- | cmds/keystore/keystore_get.h | 8 |
2 files changed, 8 insertions, 16 deletions
diff --git a/cmds/installd/commands.c b/cmds/installd/commands.c index 654ee68..b8ba3f6 100644 --- a/cmds/installd/commands.c +++ b/cmds/installd/commands.c @@ -389,9 +389,10 @@ int get_size(const char *pkgname, const char *apkpath, int cachesize = 0; /* count the source apk as code -- but only if it's not - * on the /system partition + * on the /system partition and its not on the sdcard. */ - if (strncmp(apkpath, "/system", 7) != 0) { + if (strncmp(apkpath, "/system", 7) != 0 && + strncmp(apkpath, SDCARD_DIR_PREFIX, 7) != 0) { if (stat(apkpath, &s) == 0) { codesize += stat_size(&s); } @@ -403,17 +404,6 @@ int get_size(const char *pkgname, const char *apkpath, codesize += stat_size(&s); } } - - /* count the source apk as code -- but only if it's not - * installed on the sdcard - */ - if (strncmp(apkpath, SDCARD_DIR_PREFIX, 7) != 0) { - if (stat(apkpath, &s) == 0) { - codesize += stat_size(&s); - } - } - - /* count the cached dexfile as code */ if (!create_cache_path(path, apkpath)) { if (stat(path, &s) == 0) { diff --git a/cmds/keystore/keystore_get.h b/cmds/keystore/keystore_get.h index 8330f8e..141f69b 100644 --- a/cmds/keystore/keystore_get.h +++ b/cmds/keystore/keystore_get.h @@ -32,9 +32,11 @@ extern "C" { #endif /* This function is provided for native components to get values from keystore. - * Users are required to link against libcutils. The lengths of keys and values - * are limited to KEYSTORE_MESSAGE_SIZE. This function returns the length of - * the requested value or -1 if something goes wrong. */ + * Users are required to link against libcutils. Keys are values are 8-bit safe. + * The first two arguments are the key and its length. The third argument + * specifies the buffer to store the retrieved value, which must be an array of + * KEYSTORE_MESSAGE_SIZE bytes. This function returns the length of the value or + * -1 if an error happens. */ static int keystore_get(const char *key, int length, char *value) { uint8_t bytes[2] = {length >> 8, length}; |