So that we don't erroneously add skip_preprocessed_apk_checks
everywhere.
Bug: 185811447
Test: Presubmits
Change-Id: Icb1c6163d170ca4181c5c6a814b51fda4777746f
When targetSdk is >= 30, the system verifies that you use a valid
signature V2+ certificate. Uncompressing ndk/dex files or aligning
the zip file will break a signature V2, so these apks should really
just set preprocessed: true.
Fixes: 185811447
Test: Presubmits
Change-Id: Id89c42bcd5b5daa6eda1716bff4023423298036b
Non-priviledged apps can have compressed dex files.
See go/gms-uncompressed-jni-slides
Bug: 185811447
Test: Presubmits
Change-Id: I14f70fb9286bce132e451a0c930333455517cdc3
android_app_import and android_test_import modules with processed: true
and skip_preprocessed_apk_checks are used directly from the source tree.
If the source file name doesn t match the module name and the file is
used as test data it can result in the wrong filename being used. Copy
the source file to an output file with the correct name first.
Bug: 290376750
Test: m CtsAppSecurityHostTestCases
Change-Id: I4a6dd1c5e48db7085ea41035def31f0844948a46
This change allows override_android_app to use the same
privapp_allowlist as the non-override module so that they will always
remain in sync.
Test: go test ./java -v -run TestPrivappAllowlist
Test: go test ./apex -v -run TestApexWithApps
Test: m com.android.permission com.google.android.permission and verify
manually that apex_payload.img contains correct privapp_allowlist
Test: m com.android.permission before and after change &&
`diffoscope apex_payload_reference.img apex_payload_with_change.img`
&& verify that there are no semantic changes
Bug: 242509786
Change-Id: Ifdcb28af40763aed7a4aac9a7f681153554bc256
Setting the preprocessed flag will now also verify that the apk is
zip-aligned and does not have compressed JNI libs or dex files.
Bug: 185811447
Test: m nothing
Change-Id: I01b7c25f390345b14385f6f9e1640f48a5d9dc93
This relands aosp/2457063. The original change broke T and U since those
branches still contain soong modules of type (kind+level). Those soong
modules have been cleaned up now
Test: Used go/abtd to test T and U branches with this change
Bug: 208456999
Change-Id: I0ef7933c055f88cb512a02108f1173e51156ef1c
min_sdk_version signifies device version and does not need an sdkKind to
describe it fully. Update the type and cleanup existing usages. As a
side benefit, we also get better error handling since users can no
longer enter something like `public_30` as a valid min_sdk_version in bp
files
Will do a similar cleanup for targetSdkVersion and maxSdkVersion in a
followup CL
Test: m nothing
Test: no change in ninja files (this should be a no-op)
Bug: 208456999
Change-Id: Ie6ae7e267d093c5e4787e82685daaca1021d202e
RuleBuilder creates a new rule in the ninja file every time
it's used, but in this case the rules were all exactly the same
except that the input/output file paths were different.
This can be converted to a single static rule instead.
Bug: 262629589
Test: m nothing
Change-Id: Iaa887c66a757da13293a3614c000d3be02a2a1b0
android_test_import is to import prebuilt test apks into the build rule.
It doesn't support properties like test_config, test_config_template,
and etc, but those properties were anyhow added to the module type and
setting those properties didn't trigger any error.
Fixing this surprising behavior by adding only the properties that are
actualy being used.
Bug: N/A
Test: N/A
Change-Id: I93e821e108861fa1249bc5e0882d706849bcf43f
I046d75dbbd4f21f4a2b6851f558e430e9879fcff fixed android_app modules
with missing certificate dependencies when AllowMissingDependencies
was set, but the same problem can occur in android_app_import and
android_rro modules. Move the AllowMissingDependencies handling
into processMainCert so that it applies to all of them.
Bug: 246649647
Test: TestAppImportMissingCertificateAllowMissingDependencies
Change-Id: Ic7dd3e61e0e3af15c53b583cf680b1e52394a018
JNI libs present in AAR files are ignored in the build. If those
libraries are necessary, they must be manually extracted and a
prebuilt_cc_library module must be created for them. Instead, we can
extract these libraries and copy them to an output APK as part of the build.
Bug: 228848794
Test: created android_app that depends on an android_library_import with
JNI embedded, and verified that .so libs are present in APK
Test: created android_app that depends on an android_library which
depends on android_library_import with JNI embedded, and verified
that .so libs are present in APK
Test: verified that multiple .so's from a single architecture are copied
to APK
Test: verified that the absence of a jni/<arch> folder or files in the
folder will cause the Ninja action to error
Change-Id: I242a862d7bd881f7a4a8c23493924d8fe441ea25
Move java module installation rules into Soong by overriding
InstallBypassMake. Update the locations that find host java tools
to look in the Make installation directory instead of the Soong
installation directory, which will no longer be used.
Bug: 204136549
Test: m checkbuild
Change-Id: I5af6d764c97e7ddb5ee121fc9830166c25d831b1
Don't uncompress priv-app dex for `android_app_import` if
DONT_UNCOMPRESS_PRIV_APPS_DEXS is true. Update expected test results.
Bug: 194504107
Test: m nothing
Change-Id: I4e7aa1a3deea856f388ae5ecd9292301f8a09a2f
Lint reports were only being collected from jars in apexes, not
apps.
Bug: 188772607
Test: mainline_modules_arm64 build
Change-Id: Ie84819343f8b8ab3f43496bbc9b7876d0d0d8e70
Now, android_app_import can use apk from other modules like genrule.
Bug: 192200378
Test: m com.android.compos
Change-Id: I5823fdb53b6aa20bfd9ec4dd16aafe63e65b6b68
Previously, SdkSpec was constructed only from the user string. It didn't
make use of the Config struct where information about the latest stable
SDK version, etc. is recorded. As a result, the build system couldn't
check if the sdk version "current" is referring to the in-development
(i.e. not-yet-frozen) SDK version or the latest stable version.
"current" was always assumed to be in-development (IsPreview() returns
true) even when Platform_sdk_final == true.
As the first step for fixing that, this change requires
android.EarlyModuleContext to be passed when constructing SdkSpec from
the user string.
In the following changes, "current" will be mapped to either
FutureApiLevel (10000) or one of the FinalApiLevels() depending on
whether the platform SDK was finalized or not.
Bug: 175678607
Test: m
Change-Id: Ifea12ebf147ecccf12e7266dd382819806571543
... in preparation for making the handling of sdk versions consistent
across java and cc modules.
Bug: 175678607
Test: m
Change-Id: I598f0454bce9b7320621022115412fbe97403945
They should have had `android:"path"` tags attached so that users can
point them to filegroup modules.
Test: app_test.go & app_import_test.go
Bug: 182175153
Change-Id: I5580408488ffe5fc12c869cbfb7a468713dcbc96
Some of the `uses_libs`/`optional_uses_libs` libraries may have a
library name that is different from the module name. In that case it is
necessary to patch these properties after `provides_uses_lib` for the
library is applied.
Bug: 132357300
Test: m nothing
Change-Id: I2e2248053787557f955a6b363c22e3bad0301ec7
By enabling an android_app_import module to supply the
special framework-res module, it becomes possible to
create a split build that excludes the source of over
10,000 files under frameworks/base/core/res, replacing
this source with a prebuilt. However, since other parts
of a monolithic build use the source of framework-res,
this scheme works only if your split build manifest
excludes modules that depend on framework-res source.
Bug: 176851898
Test: lunch aosp_arm64-userdebug && m nothing
Test: new TestAndroidAppImportExportPackageResources
Test: local build without prebuilt framework-res
Test: local build with prebuilt framework-res
Change-Id: If00d9dbc656c8406c038448d09f93f767c1e06d1
This is needed for Java libraries that are <uses-library> dependencies
of Java libraries and apps defined as Make modules. Each dexpreopted
module in Make generates a dexpreopt.config file, which incorporates
information from its dependencies' dexpreopt.config files. For
dependencies that are Make modules their dexpreopt.config files are
generated by Make, and for Soong modules they are generated by Soong.
Since Soong doesn't know which libraries are used by Make, it generates
build rules for a superset of the necessary libraries.
Bug: 132357300
Test: lunch aosp_cf_x86_phone-userdebug && m
Change-Id: I325b1037658736ee3c02450b08c00eca1a175962