blob: 5962108c9f7e3cf4fa82c63ae3e9dd9455652700 [file] [log] [blame]
Mårten Kongstad83ab0d72015-03-20 12:57:36 +01001
Colin Cross13221c92014-02-11 18:04:44 -08002#ifndef _IDMAP_H_
3#define _IDMAP_H_
4
5#define LOG_TAG "idmap"
6
7#include <utils/Log.h>
Mårten Kongstad83ab0d72015-03-20 12:57:36 +01008#include <utils/Vector.h>
Colin Cross13221c92014-02-11 18:04:44 -08009
10#include <errno.h>
11#include <stdio.h>
12
13#ifndef TEMP_FAILURE_RETRY
14// Used to retry syscalls that can return EINTR.
15#define TEMP_FAILURE_RETRY(exp) ({ \
16 typeof (exp) _rc; \
17 do { \
18 _rc = (exp); \
19 } while (_rc == -1 && errno == EINTR); \
20 _rc; })
21#endif
22
23int idmap_create_path(const char *target_apk_path, const char *overlay_apk_path,
24 const char *idmap_path);
25
26int idmap_create_fd(const char *target_apk_path, const char *overlay_apk_path, int fd);
27
Jaekyun Seok71693e62017-05-18 00:10:57 +090028int idmap_verify_fd(const char *target_apk_path, const char *overlay_apk_path, int fd);
29
Jaekyun Seok7de2f9c2017-03-02 12:45:10 +090030// Regarding target_package_name: the idmap_scan implementation should
31// be able to extract this from the manifest in target_apk_path,
32// simplifying the external API.
33int idmap_scan(const char *target_package_name, const char *target_apk_path,
34 const char *idmap_dir, const android::Vector<const char *> *overlay_dirs);
35
Colin Cross13221c92014-02-11 18:04:44 -080036int idmap_inspect(const char *idmap_path);
37
38#endif // _IDMAP_H_