Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b72810e1 authored by Jooyung Han's avatar Jooyung Han
Browse files

BinaryTransparencyService: Fix data apex check

In previous CL (6314b162), the check of
downloaded APEX was incorrect. Before the CL, the check was based on the
path prefix (/data/apex), which identifies "downloaded APEX'.

To support a new APEX feature (mount_before_data), which doesn't use
/data/apex for downloaded APEX, the check should be fixed. The CL
changed the check to use "flags & FLAG_SYSTEM", but somehow, the flag
FLAG_SYSTEM is not set for pre-installed APEXes.

In this CL, the check is modified to check a new path
prefix(/dev/block/dm-) to support mount_before_data.

Verified this manually. The newly installed APEX shows more information
about preinstalled APEX.

  APEX Info [Format: package_name,package_version,content_digest_algorithm:content_digest]:
  com.google.android.runtime,1,CHUNKED_SHA512:14462bbfb243cb2592cc70ecf1d2082ce7274cdb0c2e635d0ea5b33570b259e1f937325c0509c5ba8de7205c910e7ff991a661eeada164088726dc6b73c41a4a
  Is a module: false
  --- Package Installation Info ---
  Current install location: /dev/block/dm-13
  |--> Pre-installed package install location: /system/apex/com.android.runtime.apex
  |--> Pre-installed package content digest: 99147f6e0805bcd51f943fda02cfba89a70212607d2a0755dd3b13ac423659dbb212c05d61857f2df4f3f9fd91f2f6309b3f1b64feb64e00ecf3e1d2d3f1759f
  |--> Pre-installed package content digest algorithm: CHUNKED_SHA512

Bug: 430161238
Test: BinaryTransparencyHostTest
Test: verified with `adb shell cmd transparency get apex_info -v` after
      installing an apex. (See above)
Flag: com.android.apex.flags.mount_before_data
Change-Id: Ia6abcee63fc9248f1aeeb95513f34fca46012771
parent 0e62272f
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment