idmap.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. #ifndef _IDMAP_H_
  2. #define _IDMAP_H_
  3. #define LOG_TAG "idmap"
  4. #include <utils/Log.h>
  5. #include <utils/Vector.h>
  6. #include <errno.h>
  7. #include <stdio.h>
  8. #ifndef TEMP_FAILURE_RETRY
  9. // Used to retry syscalls that can return EINTR.
  10. #define TEMP_FAILURE_RETRY(exp) ({ \
  11. typeof (exp) _rc; \
  12. do { \
  13. _rc = (exp); \
  14. } while (_rc == -1 && errno == EINTR); \
  15. _rc; })
  16. #endif
  17. int idmap_create_path(const char *target_apk_path, const char *overlay_apk_path,
  18. const char *idmap_path);
  19. int idmap_create_fd(const char *target_apk_path, const char *overlay_apk_path, int fd);
  20. int idmap_verify_fd(const char *target_apk_path, const char *overlay_apk_path, int fd);
  21. // Regarding target_package_name: the idmap_scan implementation should
  22. // be able to extract this from the manifest in target_apk_path,
  23. // simplifying the external API.
  24. int idmap_scan(const char *target_package_name, const char *target_apk_path,
  25. const char *idmap_dir, const android::Vector<const char *> *overlay_dirs);
  26. int idmap_inspect(const char *idmap_path);
  27. #endif // _IDMAP_H_