Remove the redundant check against cdex.
This CL partially reverts https://r.android.com/3515450.
Currently, the runtime uses a vdex file through the `OatFile` class.
Even if there is only the vdex file (no oat file), the vdex file is
still used through `OatFileBackedByVdex`, a subclass of `OatFile`. There
isn't a code path to use a dex file through the `VdexFile` class alone.
`OatFile` already performs a series of dex validity checks, including a
check on the dex magic, so it natrually rejects cdex, whose magic is no
longer considered valid since https://r.android.com/3515450. Therefore,
the additional check against cdex in `VdexFile` seems redundant.
This redundant check adds additional cognitive load: a vdex containing a
cdex is rejected in `VdexFile`, while a vdex containing a normal dex
with other issues (e.g., invalid header) is rejected in `OatFile`.
This CL removes the redundant check. After this change, cdex is rejected
in `OatFile`, in the same way as other issues.
Bug: 325430813
Test: m art_runtime_tests && \
out/host/linux-x86/testcases/art_runtime_tests/x86_64/art_runtime_tests \
--gtest_filter='OatFileTest.*'
Change-Id: Iddd9dc64cbf55fc878d953793848de6145e2afb2
3 files changed