Jaekyun Seok 71693e6683 Add a function to verify if idmap is made from given target/overlay packages
"--verify" will be used to verify if idmap corresponding to given fd is maded
from given target and overlay packages.

Test: building succeeded and tested on sailfish.
Bug: 37179531
Change-Id: Id19bdfd9c61670437f3e1a5c29762ce93586590f
2017-05-18 00:10:57 +09:00

39 lines
1.1 KiB
C

#ifndef _IDMAP_H_
#define _IDMAP_H_
#define LOG_TAG "idmap"
#include <utils/Log.h>
#include <utils/Vector.h>
#include <errno.h>
#include <stdio.h>
#ifndef TEMP_FAILURE_RETRY
// Used to retry syscalls that can return EINTR.
#define TEMP_FAILURE_RETRY(exp) ({ \
typeof (exp) _rc; \
do { \
_rc = (exp); \
} while (_rc == -1 && errno == EINTR); \
_rc; })
#endif
int idmap_create_path(const char *target_apk_path, const char *overlay_apk_path,
const char *idmap_path);
int idmap_create_fd(const char *target_apk_path, const char *overlay_apk_path, int fd);
int idmap_verify_fd(const char *target_apk_path, const char *overlay_apk_path, int fd);
// Regarding target_package_name: the idmap_scan implementation should
// be able to extract this from the manifest in target_apk_path,
// simplifying the external API.
int idmap_scan(const char *target_package_name, const char *target_apk_path,
const char *idmap_dir, const android::Vector<const char *> *overlay_dirs);
int idmap_inspect(const char *idmap_path);
#endif // _IDMAP_H_