diff --git a/cmds/installd/commands.c b/cmds/installd/commands.c index e544be722..8e14a2c08 100644 --- a/cmds/installd/commands.c +++ b/cmds/installd/commands.c @@ -421,7 +421,7 @@ int rm_dex(const char *path) } int get_size(const char *pkgname, int persona, const char *apkpath, - const char *fwdlock_apkpath, const char *asecpath, + const char *libdirpath, const char *fwdlock_apkpath, const char *asecpath, int64_t *_codesize, int64_t *_datasize, int64_t *_cachesize, int64_t* _asecsize) { @@ -460,8 +460,8 @@ int get_size(const char *pkgname, int persona, const char *apkpath, } /* add in size of any libraries */ - if (!create_pkg_path_in_dir(path, &android_app_lib_dir, pkgname, PKG_DIR_POSTFIX)) { - d = opendir(path); + if (libdirpath != NULL && libdirpath[0] != '!') { + d = opendir(libdirpath); if (d != NULL) { dfd = dirfd(d); codesize += calculate_dir_size(dfd); diff --git a/cmds/installd/installd.c b/cmds/installd/installd.c index 230899bfb..c918633f3 100644 --- a/cmds/installd/installd.c +++ b/cmds/installd/installd.c @@ -84,7 +84,7 @@ static int do_get_size(char **arg, char reply[REPLY_MAX]) int res = 0; /* pkgdir, persona, apkpath */ - res = get_size(arg[0], atoi(arg[1]), arg[2], arg[3], arg[4], + res = get_size(arg[0], atoi(arg[1]), arg[2], arg[3], arg[4], arg[5], &codesize, &datasize, &cachesize, &asecsize); /* @@ -138,7 +138,7 @@ struct cmdinfo cmds[] = { { "fixuid", 3, do_fixuid }, { "freecache", 1, do_free_cache }, { "rmcache", 2, do_rm_cache }, - { "getsize", 5, do_get_size }, + { "getsize", 6, do_get_size }, { "rmuserdata", 2, do_rm_user_data }, { "movefiles", 0, do_movefiles }, { "linklib", 3, do_linklib }, diff --git a/cmds/installd/installd.h b/cmds/installd/installd.h index 033d5a32a..fbfc87660 100644 --- a/cmds/installd/installd.h +++ b/cmds/installd/installd.h @@ -203,9 +203,9 @@ int delete_cache(const char *pkgname, uid_t persona); int move_dex(const char *src, const char *dst); int rm_dex(const char *path); int protect(char *pkgname, gid_t gid); -int get_size(const char *pkgname, int persona, const char *apkpath, const char *fwdlock_apkpath, - const char *asecpath, int64_t *codesize, int64_t *datasize, int64_t *cachesize, - int64_t *asecsize); +int get_size(const char *pkgname, int persona, const char *apkpath, const char *libdirpath, + const char *fwdlock_apkpath, const char *asecpath, int64_t *codesize, + int64_t *datasize, int64_t *cachesize, int64_t *asecsize); int free_cache(int64_t free_size); int dexopt(const char *apk_path, uid_t uid, int is_public); int movefiles();