AAPT2 generates extra versions of XML binaries based on the sdkVersion
that attributes were introduced, up to v21. This should only happen for
sdkVersions that are > minSdkVersion, as everything else can be included
in the main configuration (e.g. "layout" instead of "layout-v4").
This change handles the merging of XML binary sdkVersions that were created
implicitly.
Bug: 30705740
Change-Id: I854843dd6dbaca52896cea0c24c70c900cec3e8e
Android has a dedicated XML namespace dedicated for tools that should not be
included in the final APK. AAPT strips this out, but the feature was missing
from AAPT2. See: http://tools.android.com/tech-docs/tools-attributes
Bug: 29115919
Change-Id: I8f4fc79e6c8592a313a691134e44d16fd91f36ed
Use the same name for the static and shared libraries so that the module
definitions can be shared.
Change-Id: I1578ee7044689194ae1baea4d71f1b0e8737505f
Previously the way to name resources in tests was to use reference
notation (@[package:][type/]name). Now we use name notation (no @).
Change-Id: I68f0a36562d89cc78c582d128f370d9556c58707
The --stable-ids flag allows the user to specify a file containing
a list of resource name and resource ID pairs in the form of:
package:type/name = 0xPPTTEEEE
This assigns the given resource the specified ID. It helps ensure
that when adding or removing resources, IDs are assigned in a stable
fashion.
If a package, type, or name is not found, no error or warning is
raised.
Change-Id: Ibc2f4e05cc924be255fedd862d835cb5b18d7584
Convert StringPools in resources.arsc and binary XML files to use UTF-8
instead of UTF-16 to save lots of bytes.
Bug: 30053277
Change-Id: I8eb6c78644e51b15f89edadab71cc86f5a851a45
Aapt with -D option was not keeping the application and instrumentation
subclasses, which were instead handled by mainDexClasses.rules. Instead,
include them in the aapt -D output.
Change-Id: Ia3b89fc2edd45d379c4d06f0bf674716646fcb3d
When resources share the same configuration, they are much more
clustered in the resulting resources.arsc, which makes for smaller
APKs. Strip version qualifiers for resources <= minSdk so that
they get clustered.
Bug:30050641
Change-Id: I80371b179761501fb7cc41f5f5ac67ffde2fc677
For legacy reasons, we kept around the use of UTF-16 internally
in AAPT2. We don't need this and this CL removes all instances of
std::u16string and StringPiece16. The only places still needed
are when interacting with the ResTable APIs that only operate in
UTF16.
Change-Id: I492475b84bb9014fa13bf992cff447ee7a5fe588
Proguard rules would be ignored for components defined
in AndroidManifest.xml for android:name attributes if
they didn't start with '.'.
Change-Id: I029b5a2f224f4daf155b73a2a4dcd940dd43372e
Due to another bug, empty strings in XML files
were encoded as NULLs. This was only needed for
encoding missing namespace URIs. Attribute
values should remain empty strings.
Bug:29939875
Bug:29462255
Change-Id: I3897661d85865c88bb2b7cf1495da16c30f7272e
When an app specifies (or imports) resources with various
configurations for different SDK versions, specifying
a minSdk will make many of those resources unreachable.
Version collapsing will prune out the resources specified
for SDK versions less than the minSdk.
If, however, there is no exact matching resource for the
minSdk version, the next smallest SDK version is kept.
Change-Id: Ic7bcab6c59d65c97c67c8767358abb57cdec60a4
The accent pseudolocalizer would incorrectly process
the byte after the end of the string, which would end
up inserting null characters into the resulting
output.
Change-Id: I5cdabd6b0272d94073f06e180b8cbe7abafa3888
We need the attributes to remain public because people might still be
linking against them, but we don't want them showing up in the
documentation any more. Them showing up in the documentation also had
the side effect that it would accidentally mark the parent class of
attributes as @removed, which was not intended.
Bug: 28663748
Change-Id: I2f6eb09455fddf1086e6b24bc3bea5292e8e32b7
Adds the diff command and various small fixes to issues
discovered when diffing old AAPT built APKs with new AAPT2
built APKS.
Bug:22775504
Change-Id: I682a7fe1cf4b3efa7cbd5d18b333cf2d1046fe1b
am: e59d48398f
* commit 'e59d48398f983b822191ea3096499bdd0793840a':
AAPT2: Accept a file with arguments when argument list is too long
Change-Id: Iad1d2b91109b0d1c78739c3fa3f31da5e0704f12
Create an analogue of "aapt2 --proguard" which outputs a proguard
configuration that keeps only components which need to be in the main
dex.
Bug: 27383099
Change-Id: I61d652bfcdfc18e1614e852bd6f7540efd15f780