19066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project/*
29066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project**
39066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project** Copyright 2008, The Android Open Source Project
49066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project**
59066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project** Licensed under the Apache License, Version 2.0 (the "License");
69066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project** you may not use this file except in compliance with the License.
79066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project** You may obtain a copy of the License at
89066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project**
99066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project**     http://www.apache.org/licenses/LICENSE-2.0
109066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project**
119066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project** Unless required by applicable law or agreed to in writing, software
129066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project** distributed under the License is distributed on an "AS IS" BASIS,
139066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
149066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project** See the License for the specific language governing permissions and
159066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project** limitations under the License.
169066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project*/
179066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project
189066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project#define LOG_TAG "installd"
199066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project
209066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project#include <stdio.h>
219066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project#include <stdlib.h>
223e319a9962434e1fae86b2180ad210170f02c152Kenny Root#include <stdint.h>
233e319a9962434e1fae86b2180ad210170f02c152Kenny Root#include <inttypes.h>
249066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project#include <sys/stat.h>
259066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project#include <dirent.h>
269066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project#include <unistd.h>
279066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project#include <ctype.h>
289066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project#include <fcntl.h>
299066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project#include <errno.h>
309066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project#include <utime.h>
319066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project#include <sys/socket.h>
329066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project#include <sys/types.h>
339066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project#include <sys/wait.h>
349066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project
358ea0dc6a89b011d4f478c0c8192570d69cf7ce79Jeff Sharkey#include <cutils/fs.h>
369066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project#include <cutils/sockets.h>
379066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project#include <cutils/log.h>
389066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project#include <cutils/properties.h>
395b1ada2562c17921adf6a62ea62bcb445160983cJeff Sharkey#include <cutils/multiuser.h>
409066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project
419066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project#include <private/android_filesystem_config.h>
429066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project
439066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project#if INCLUDE_SYS_MOUNT_FOR_STATFS
449066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project#include <sys/mount.h>
459066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project#else
469066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project#include <sys/statfs.h>
479066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project#endif
489066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project
499066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project#define SOCKET_PATH "installd"
509066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project
519066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project
529066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project/* elements combined with a valid package name to form paths */
539066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project
5486c9584559439504fc57ece2ccd9b6cbd568430cKenny Root#define PRIMARY_USER_PREFIX    "data/"
5586c9584559439504fc57ece2ccd9b6cbd568430cKenny Root#define SECONDARY_USER_PREFIX  "user/"
5686c9584559439504fc57ece2ccd9b6cbd568430cKenny Root
579066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project#define PKG_DIR_POSTFIX        ""
589066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project
599066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project#define PKG_LIB_POSTFIX        "/lib"
609066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project
619066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project#define CACHE_DIR_POSTFIX      "/cache"
629066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project
6386c9584559439504fc57ece2ccd9b6cbd568430cKenny Root#define APP_SUBDIR             "app/" // sub-directory under ANDROID_DATA
649066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project
659bbd70a96397bd5f1445ad6c21977fccfb350dfaKenny Root#define APP_LIB_SUBDIR         "app-lib/" // sub-directory under ANDROID_DATA
669bbd70a96397bd5f1445ad6c21977fccfb350dfaKenny Root
67197a0c82a1fbf337ec0a85d36b6b89c3d6e8a0acDianne Hackborn#define MEDIA_SUBDIR           "media/" // sub-directory under ANDROID_DATA
68197a0c82a1fbf337ec0a85d36b6b89c3d6e8a0acDianne Hackborn
699066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project/* other handy constants */
709066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project
7186c9584559439504fc57ece2ccd9b6cbd568430cKenny Root#define PRIVATE_APP_SUBDIR     "app-private/" // sub-directory under ANDROID_DATA
729066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project
7386c9584559439504fc57ece2ccd9b6cbd568430cKenny Root#define DALVIK_CACHE_PREFIX    "/data/dalvik-cache/"
7486c9584559439504fc57ece2ccd9b6cbd568430cKenny Root#define DALVIK_CACHE_POSTFIX   "/classes.dex"
759066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project
76b858dfda5012a1040927ed62c3bb856c3294d882Dianne Hackborn#define UPDATE_COMMANDS_DIR_PREFIX  "/system/etc/updatecmds/"
779066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project
789066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project#define PKG_NAME_MAX  128   /* largest allowed package name */
799066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project#define PKG_PATH_MAX  256   /* max size of any path we use */
809066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project
81742a67127366c376fdf188ff99ba30b27d3bf90cAmith Yamasani#define PER_USER_RANGE ((uid_t)100000)   /* range of uids per user
82742a67127366c376fdf188ff99ba30b27d3bf90cAmith Yamasani                                            uid = persona * PER_USER_RANGE + appid */
83742a67127366c376fdf188ff99ba30b27d3bf90cAmith Yamasani
8486c9584559439504fc57ece2ccd9b6cbd568430cKenny Root/* data structures */
8586c9584559439504fc57ece2ccd9b6cbd568430cKenny Root
8686c9584559439504fc57ece2ccd9b6cbd568430cKenny Roottypedef struct {
8786c9584559439504fc57ece2ccd9b6cbd568430cKenny Root    char* path;
8886c9584559439504fc57ece2ccd9b6cbd568430cKenny Root    size_t len;
8986c9584559439504fc57ece2ccd9b6cbd568430cKenny Root} dir_rec_t;
9086c9584559439504fc57ece2ccd9b6cbd568430cKenny Root
9186c9584559439504fc57ece2ccd9b6cbd568430cKenny Roottypedef struct {
9286c9584559439504fc57ece2ccd9b6cbd568430cKenny Root    size_t count;
9386c9584559439504fc57ece2ccd9b6cbd568430cKenny Root    dir_rec_t* dirs;
9486c9584559439504fc57ece2ccd9b6cbd568430cKenny Root} dir_rec_array_t;
9586c9584559439504fc57ece2ccd9b6cbd568430cKenny Root
9686c9584559439504fc57ece2ccd9b6cbd568430cKenny Rootextern dir_rec_t android_app_dir;
9786c9584559439504fc57ece2ccd9b6cbd568430cKenny Rootextern dir_rec_t android_app_private_dir;
989bbd70a96397bd5f1445ad6c21977fccfb350dfaKenny Rootextern dir_rec_t android_app_lib_dir;
9986c9584559439504fc57ece2ccd9b6cbd568430cKenny Rootextern dir_rec_t android_data_dir;
10086c9584559439504fc57ece2ccd9b6cbd568430cKenny Rootextern dir_rec_t android_asec_dir;
101197a0c82a1fbf337ec0a85d36b6b89c3d6e8a0acDianne Hackbornextern dir_rec_t android_media_dir;
10286c9584559439504fc57ece2ccd9b6cbd568430cKenny Rootextern dir_rec_array_t android_system_dirs;
1039066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project
104197a0c82a1fbf337ec0a85d36b6b89c3d6e8a0acDianne Hackborntypedef struct cache_dir_struct {
105197a0c82a1fbf337ec0a85d36b6b89c3d6e8a0acDianne Hackborn    struct cache_dir_struct* parent;
106197a0c82a1fbf337ec0a85d36b6b89c3d6e8a0acDianne Hackborn    int32_t childCount;
107197a0c82a1fbf337ec0a85d36b6b89c3d6e8a0acDianne Hackborn    int32_t hiddenCount;
108197a0c82a1fbf337ec0a85d36b6b89c3d6e8a0acDianne Hackborn    int32_t deleted;
109197a0c82a1fbf337ec0a85d36b6b89c3d6e8a0acDianne Hackborn    char name[];
110197a0c82a1fbf337ec0a85d36b6b89c3d6e8a0acDianne Hackborn} cache_dir_t;
111197a0c82a1fbf337ec0a85d36b6b89c3d6e8a0acDianne Hackborn
112197a0c82a1fbf337ec0a85d36b6b89c3d6e8a0acDianne Hackborntypedef struct {
113197a0c82a1fbf337ec0a85d36b6b89c3d6e8a0acDianne Hackborn    cache_dir_t* dir;
114197a0c82a1fbf337ec0a85d36b6b89c3d6e8a0acDianne Hackborn    time_t modTime;
115197a0c82a1fbf337ec0a85d36b6b89c3d6e8a0acDianne Hackborn    char name[];
116197a0c82a1fbf337ec0a85d36b6b89c3d6e8a0acDianne Hackborn} cache_file_t;
117197a0c82a1fbf337ec0a85d36b6b89c3d6e8a0acDianne Hackborn
118197a0c82a1fbf337ec0a85d36b6b89c3d6e8a0acDianne Hackborntypedef struct {
119197a0c82a1fbf337ec0a85d36b6b89c3d6e8a0acDianne Hackborn    size_t numDirs;
120197a0c82a1fbf337ec0a85d36b6b89c3d6e8a0acDianne Hackborn    size_t availDirs;
121197a0c82a1fbf337ec0a85d36b6b89c3d6e8a0acDianne Hackborn    cache_dir_t** dirs;
122197a0c82a1fbf337ec0a85d36b6b89c3d6e8a0acDianne Hackborn    size_t numFiles;
123197a0c82a1fbf337ec0a85d36b6b89c3d6e8a0acDianne Hackborn    size_t availFiles;
124197a0c82a1fbf337ec0a85d36b6b89c3d6e8a0acDianne Hackborn    cache_file_t** files;
125197a0c82a1fbf337ec0a85d36b6b89c3d6e8a0acDianne Hackborn    size_t numCollected;
126197a0c82a1fbf337ec0a85d36b6b89c3d6e8a0acDianne Hackborn    void* memBlocks;
127197a0c82a1fbf337ec0a85d36b6b89c3d6e8a0acDianne Hackborn    int8_t* curMemBlockAvail;
128197a0c82a1fbf337ec0a85d36b6b89c3d6e8a0acDianne Hackborn    int8_t* curMemBlockEnd;
129197a0c82a1fbf337ec0a85d36b6b89c3d6e8a0acDianne Hackborn} cache_t;
130197a0c82a1fbf337ec0a85d36b6b89c3d6e8a0acDianne Hackborn
1319066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project/* util.c */
1329066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project
13386c9584559439504fc57ece2ccd9b6cbd568430cKenny Rootint create_pkg_path_in_dir(char path[PKG_PATH_MAX],
13486c9584559439504fc57ece2ccd9b6cbd568430cKenny Root                                const dir_rec_t* dir,
13586c9584559439504fc57ece2ccd9b6cbd568430cKenny Root                                const char* pkgname,
13686c9584559439504fc57ece2ccd9b6cbd568430cKenny Root                                const char* postfix);
13786c9584559439504fc57ece2ccd9b6cbd568430cKenny Root
1389066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Projectint create_pkg_path(char path[PKG_PATH_MAX],
1399066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project                    const char *pkgname,
14086c9584559439504fc57ece2ccd9b6cbd568430cKenny Root                    const char *postfix,
14186c9584559439504fc57ece2ccd9b6cbd568430cKenny Root                    uid_t persona);
14286c9584559439504fc57ece2ccd9b6cbd568430cKenny Root
1430b285499db739ba50f2f839d633e763c70e67f96Amith Yamasaniint create_persona_path(char path[PKG_PATH_MAX],
1440b285499db739ba50f2f839d633e763c70e67f96Amith Yamasani                    uid_t persona);
1450b285499db739ba50f2f839d633e763c70e67f96Amith Yamasani
1465b1ada2562c17921adf6a62ea62bcb445160983cJeff Sharkeyint create_persona_media_path(char path[PKG_PATH_MAX], userid_t userid);
1475b1ada2562c17921adf6a62ea62bcb445160983cJeff Sharkey
148ad757e9b36d6bc6b8e39be00612d0e60863aaafcKenny Rootint create_move_path(char path[PKG_PATH_MAX],
149ad757e9b36d6bc6b8e39be00612d0e60863aaafcKenny Root                     const char* pkgname,
150ad757e9b36d6bc6b8e39be00612d0e60863aaafcKenny Root                     const char* leaf,
151ad757e9b36d6bc6b8e39be00612d0e60863aaafcKenny Root                     uid_t persona);
152ad757e9b36d6bc6b8e39be00612d0e60863aaafcKenny Root
15386c9584559439504fc57ece2ccd9b6cbd568430cKenny Rootint is_valid_package_name(const char* pkgname);
1549066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project
1559066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Projectint create_cache_path(char path[PKG_PATH_MAX], const char *src);
1569066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project
1579066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Projectint delete_dir_contents(const char *pathname,
1589066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project                        int also_delete_dir,
1599066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project                        const char *ignore);
1609066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project
1619066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Projectint delete_dir_contents_fd(int dfd, const char *name);
1629066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project
163197a0c82a1fbf337ec0a85d36b6b89c3d6e8a0acDianne Hackbornint lookup_media_dir(char basepath[PATH_MAX], const char *dir);
164197a0c82a1fbf337ec0a85d36b6b89c3d6e8a0acDianne Hackborn
165197a0c82a1fbf337ec0a85d36b6b89c3d6e8a0acDianne Hackbornint64_t data_disk_free();
166197a0c82a1fbf337ec0a85d36b6b89c3d6e8a0acDianne Hackborn
167197a0c82a1fbf337ec0a85d36b6b89c3d6e8a0acDianne Hackborncache_t* start_cache_collection();
168197a0c82a1fbf337ec0a85d36b6b89c3d6e8a0acDianne Hackborn
169197a0c82a1fbf337ec0a85d36b6b89c3d6e8a0acDianne Hackbornvoid add_cache_files(cache_t* cache, const char *basepath, const char *cachedir);
170197a0c82a1fbf337ec0a85d36b6b89c3d6e8a0acDianne Hackborn
171197a0c82a1fbf337ec0a85d36b6b89c3d6e8a0acDianne Hackbornvoid clear_cache_files(cache_t* cache, int64_t free_size);
172197a0c82a1fbf337ec0a85d36b6b89c3d6e8a0acDianne Hackborn
173197a0c82a1fbf337ec0a85d36b6b89c3d6e8a0acDianne Hackbornvoid finish_cache_collection(cache_t* cache);
174197a0c82a1fbf337ec0a85d36b6b89c3d6e8a0acDianne Hackborn
17586c9584559439504fc57ece2ccd9b6cbd568430cKenny Rootint validate_system_app_path(const char* path);
17686c9584559439504fc57ece2ccd9b6cbd568430cKenny Root
17786c9584559439504fc57ece2ccd9b6cbd568430cKenny Rootint get_path_from_env(dir_rec_t* rec, const char* var);
17886c9584559439504fc57ece2ccd9b6cbd568430cKenny Root
17986c9584559439504fc57ece2ccd9b6cbd568430cKenny Rootint get_path_from_string(dir_rec_t* rec, const char* path);
18086c9584559439504fc57ece2ccd9b6cbd568430cKenny Root
18186c9584559439504fc57ece2ccd9b6cbd568430cKenny Rootint copy_and_append(dir_rec_t* dst, const dir_rec_t* src, const char* suffix);
18286c9584559439504fc57ece2ccd9b6cbd568430cKenny Root
18386c9584559439504fc57ece2ccd9b6cbd568430cKenny Rootint validate_apk_path(const char *path);
18486c9584559439504fc57ece2ccd9b6cbd568430cKenny Root
18586c9584559439504fc57ece2ccd9b6cbd568430cKenny Rootint append_and_increment(char** dst, const char* src, size_t* dst_size);
18686c9584559439504fc57ece2ccd9b6cbd568430cKenny Root
1870b285499db739ba50f2f839d633e763c70e67f96Amith Yamasanichar *build_string2(char *s1, char *s2);
1880b285499db739ba50f2f839d633e763c70e67f96Amith Yamasanichar *build_string3(char *s1, char *s2, char *s3);
1890b285499db739ba50f2f839d633e763c70e67f96Amith Yamasani
1905b1ada2562c17921adf6a62ea62bcb445160983cJeff Sharkeyint ensure_dir(const char* path, mode_t mode, uid_t uid, gid_t gid);
191a3e90798b7ad3ed62e5b31842c699b2f98bd457bKenny Rootint ensure_media_user_dirs(userid_t userid);
1925b1ada2562c17921adf6a62ea62bcb445160983cJeff Sharkey
1939066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project/* commands.c */
1949066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project
19535ab3ad61fcc349380d7e7f2fcf9a0dfbf76ae11Kenny Rootint install(const char *pkgname, uid_t uid, gid_t gid);
1960b285499db739ba50f2f839d633e763c70e67f96Amith Yamasaniint uninstall(const char *pkgname, uid_t persona);
19735ab3ad61fcc349380d7e7f2fcf9a0dfbf76ae11Kenny Rootint renamepkg(const char *oldpkgname, const char *newpkgname);
198d0c5f515c05d05c9d24971695337daf9d6ce409cDianne Hackbornint fix_uid(const char *pkgname, uid_t uid, gid_t gid);
1990b285499db739ba50f2f839d633e763c70e67f96Amith Yamasaniint delete_user_data(const char *pkgname, uid_t persona);
2000b285499db739ba50f2f839d633e763c70e67f96Amith Yamasaniint make_user_data(const char *pkgname, uid_t uid, uid_t persona);
2010b285499db739ba50f2f839d633e763c70e67f96Amith Yamasaniint delete_persona(uid_t persona);
202742a67127366c376fdf188ff99ba30b27d3bf90cAmith Yamasaniint clone_persona_data(uid_t src_persona, uid_t target_persona, int copy);
20354289b8b4a110cc1ae106d79785cc762a2aebd6eAmith Yamasaniint delete_cache(const char *pkgname, uid_t persona);
2049066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Projectint move_dex(const char *src, const char *dst);
2059066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Projectint rm_dex(const char *path);
2069066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Projectint protect(char *pkgname, gid_t gid);
2070c3804950236fe170ebf6cc7a5f1e3e305b8f315Dianne Hackbornint get_size(const char *pkgname, int persona, const char *apkpath, const char *fwdlock_apkpath,
208292f8bc9d1b790ab975a87a842c7fabc908b97e0Dianne Hackborn             const char *asecpath, int64_t *codesize, int64_t *datasize, int64_t *cachesize,
209292f8bc9d1b790ab975a87a842c7fabc908b97e0Dianne Hackborn             int64_t *asecsize);
2103e319a9962434e1fae86b2180ad210170f02c152Kenny Rootint free_cache(int64_t free_size);
2119066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Projectint dexopt(const char *apk_path, uid_t uid, int is_public);
212b858dfda5012a1040927ed62c3bb856c3294d882Dianne Hackbornint movefiles();
213a3e90798b7ad3ed62e5b31842c699b2f98bd457bKenny Rootint linklib(const char* target, const char* source, int userId);
214