apexd: Add logic to validate content of a shim apex

Allowed entries:
* apex_manifest.json - must be a regular file with 0644 permissions mask
* lost+found - must be an empty folder
* etc - must be a folder containing exactly one file hash.txt
* etc/hash.txt - must be a regular file with 0644 permissions mask

This CL required some boilerplate, mostly to make sure that we are using
non-throwing std::filesystem APIs.
I've left some TODOs to refactor some of the boilerplate, e.g. add a way
to use range-based for loop over directory in a non-throwing way.

Test: apexservice_test
Bug: 128625955
Change-Id: I0ee7c34e365f977a627981beac116bd35af08612
7 files changed
tree: 4c159ef993fe2520a56ed3013f63792779ecacef
  1. apexd/
  2. apexer/
  3. proto/
  4. shim/
  5. tests/
  6. OWNERS
  7. PREUPLOAD.cfg