Some libraries that go through manifest_check do not have a manifest or
APK, so there is nothing to check LOCAL_USES_LIBRARIES and
LOCAL_OPTIONAL_USES_LIBRARIES against. Handle it as if the manifest had
zero <uses-library> tags: don't fail the build unless the module has
non-empty LOCAL_USES_LIBRARIES or LOCAL_OPTIONAL_USES_LIBRARIES.
Bug: 132357300
Test: lunch cf_x86_64_phone-userdebug && m
Change-Id: I4b1317cfbd93cb6129caba51b56081307a564442
Move manifest_check (a.k.a. verify_uses_libraries check) from makefiles
for specific module types to common makefile dex_preopt_odex_install.mk,
which is included by all Java modules that may require dexpreopt. If a
modules locally disables dexpreopt, it still goes through manifest_check
(unless dexpreopt is globally disabled or the module has no Java code).
This CL allows to have manifest_check and dexpreopt in the same makefile
(which is needed for a follow-up CL that will reuse dexpreopt variables
for manifest_check).
Bug: 132357300
Test: lunch cf_x86_64_phone-userdebug && m
Change-Id: Ia217cfc247ae43d8fc716bfc1fe9dcce1d00aa7f
The missing dependency on AAPT did not cause build failures in AOSP,
because the build order happens to be such that AAPT is always built by
the time it's needed. But this is accidental and needs to be fixed.
Bug: 183010666
Bug: 132357300
Test: treehugger
Change-Id: I170e878bf36aafbdb93e9ba54faffd455d3e33c2
Merged-In: I8c78e48345bee5b77de41af03bdac77c402d04a1
Previously there were two different scripts that did similar things:
1) build/soong/scripts/manifest_check.py
2) build/make/core/verify_uses_libraries.sh
Both scripts extracted <uses-library> tags and `targetSdkVersion` from
the manifests of Java modules, but 1) worked for XML manifests, and 2)
worked for APKs. This CL reimplements the functionality from 2) in 1),
so that one script can handle both XML manifests and APKs.
Bug: 132357300
Test: lunch cf_x86_64_phone-userdebug && m && launch_cvd \
adb wait-for-device && adb root && adb logcat \
| grep -E 'ClassLoaderContext [a-z ]+ mismatch'
# empty grep output, no errors
Change-Id: I386aa1a37699182cdf6f3f94ef8aa7b96a4017d3
Without dexpreopt the check is not necessary, and although it is good to
have, it is difficult to maintain on non-linux build platforms where
dexpreopt is generally disabled (the check may fail due to various
unrelated reasons, such as a failure to get manifest from an APK).
Bug: 181570790
Bug: 132357300
Test: Emulate the failed no-dexpreopt build in b/181570790:
- modify verify_uses_libraries to make a subcommand fail
- check that the build with dexpreopt fails:
$ lunch cf_x86_64_phone-userdebug && m
- set `WITH_DEXPREOPT := false` in make/core/board_config.mk
- check that the build without dexpreopt succeeds (allow boot image
and system servert dexproept to avoid unrelated build failures, this
does not affect verify_uses_libraries):
$ WITH_DEXPREOPT_BOOT_IMG_AND_SYSTEM_SERVER_ONLY=true \
lunch cf_x86_64_phone-userdebug && m
Change-Id: Ic456be4e3047a60415a21fae658077165fb03165
The new mode is enabled with environment variable
RELAX_USES_LIBRARY_CHECK. If the variable is set to true, then a
verify_uses_libraries check failure does not fail the build, instead it
sets a special compiler filter "extract" for dexpreopt, which means that
the DEX file will be extracted, but it won't be compiled to native code.
Class loader context will be set to empty in this case (not &, as it is
going to be deprecated soon).
If the variable RELAX_USES_LIBRARY_CHECK is unset or set to something
other than "true", then the old behaviour of the verify_uses_libraries
check is preserved.
The intended use case for this flag is to have a smoother migration path
for the Java modules that need to add <uses-library> information in
the build files. The flag allows to quickly silence build errors. This
flag should be used with caution and only as a temporary measure, as it
masks real errors and affects performance.
verify_uses_libraries check is reworked so that it writes the error
message to a status file (which is used instead of the former timestamp
file). Currently the stored error message is not used, but it may be
used later to produce a warning. Dexpreopt command checks if the status
file exists and is nonempty; if that is the case, then compiler filter
is set to "extract".
Bug: 132357300
Test: Manually add some mismatch between the libraries in the Android.bp
and Android.mk files for dexpreopted apps, build with
RELAX_USES_LIBRARY_CHECK=true and obsserve that the build doesn't
fail and they are compiled with compiler-filter "extract".
Unset RELAX_USES_LIBRARY_CHECK and observe that the build fails.
Change-Id: Ie1a6298c4dba2f368ca9ac8b9fee2de0a26e68e8
Take the unwanted JNI lib removal action out of JNI uncompression
function so that they work independently when building prebuilt apks.
Fixes: 180475879
Test: Manually with a test apk.
Change-Id: I7392d0bf4ca7db76f27e883df08f7cb256162440
This hasn't worked for a couple years, and continues to bitrot. Just
remove it.
Test: treehugger
Change-Id: Iea6caf3c08252a560155e095135c5ddaad712991
Merged-In: Iea6caf3c08252a560155e095135c5ddaad712991
This change fixes a regression that was caused by I56bc55e2231eb946617a9d6f97d55c9b61f3bff7
that file names for Make modules are ".apk" in apkcerts.txt.
This was because PACKAGES.$(LOCAL_MODULE).STEM was only set for the
modules from Soong. It is now set for Make modules too.
Bug: 155440232
Test: OVERRIDE_TARGET_FLATTEN_APEX=true m apkcerts-list
and check the generated apkcerts txt file to see that it doesn't have an
entry where file name is ".apk"
Exempt-From-Owner-Approval: cherry-pick from internal
Merged-In: I6f14bbb5678255bef2c1f2397f59ede6c2b5df18
(cherry picked from commit db64e3d528)
Change-Id: I6f14bbb5678255bef2c1f2397f59ede6c2b5df18
Also add multi-cert support to prebuilt apps so that they can benefit
from the new lineage feature.
(This is a cherry-pick change.)
Test: m GoogleServicesFramework w/ modified build rules
Test: m PrebuiltGmsCore w/ modified build rules
Test: apksigner lineage -v --print-certs -in <built_module_path>
Fixes: 152897457
Change-Id: If7d5d4bd308629c8340231520214c76c8a568a65
Merged-In: If7d5d4bd308629c8340231520214c76c8a568a65
Propagate partition tag data to apexkeys.txt and
apkcerts.txt so that merge_target_files.py can build
merged versions of these files by filtering the
framework files for framework partitions and filtering
the vendor files for vendor partitions.
Bug: 138942268
Change-Id: Ic3226728e97dae84d38ec230ccc86d1b124bea94
Stripping is incompatible with ART module updatability.
Bug: 65154345
Bug: 138851227
Test: build and observe no change in output (stripping is not used by
default).
Change-Id: Ic2d9738ef393814c3af3cad116071f7b5938aa84
dexpreopt usually gets a dex jar instead of the final APK, which
means targetSdkVersion can't be parsed out of it. Move the
shared library verification to a tool that operates on the final
AndroidManifest.xml instead. verify_uses_libraries.sh is still
used to verify prebuilts where we don't have an AndroidManifest.xml
and must parse it out of the APK.
Test: m Gallery2
Bug: 132357300
Change-Id: I6ade74b6144c73aee094f5d5ff343067ca0a0e5a
Running appcompat is missing a dependency on aapt/aapt2. There
is no need to switch between aapt and aapt2, so always use aapt2
and add the missing dependency.
Fixes: 130575935
Test: treehugger
Change-Id: If32c03410fbdb3945bf20f7405de13dc8cd83038
This is part of prebuilt_internal.mk refactoring work and also a
preliminary task to design and implement its Soong counterpart.
Test: built and flashed an image for a Pixel device + TreeHugger
Change-Id: I89b13b1e0a2780b02fda7ee888e73052ac1abd9c