Age | Commit message (Collapse) | Author |
|
Fix a memory leak in Main.cpp.
Bug: 141312058
Test: m -j aapt2 SANITIZE_TARGET=address
Change-Id: I54b61792ab75e2f59298dd38168653e496c84bff
|
|
When building with SANATIZE_HOST=address and ASAN_OPTIONS="" in order to
test that leaks are removed from AIDL, was hitting leaks here.
Explicitly setting ASAN_OPTIONS here so that we can detect leaks in
other host tools.
Bug: 141312058
Test: AIDL's runtests_asan.sh
Change-Id: Ibc599ab75bbf63eab1c7747d17952390a7967e87
|
|
This changes adds the build id to the version printed by "aapt2
version". This change also adds a field to the ResourceTable proto that
specifies the fingerprints of tools used to build the table.
Bug: 123663089
Test: manual
Change-Id: Ifaf33c1e506b68e9f1d921fdbeddf36485e65790
|
|
Add a tracing API and instrument key functions in order to profile
aapt2 bottleneck. The API allows to generate systrace fragment files.
Impact on performance is neglibible with each Trace requiring less
than 1us and the final Flush operation at the end of a command
requiring around 40us.
Bug: None
Test: None
Change-Id: I51b564d3694e9384679f43b878b32295527dddf6
|
|
This change refactors the dump commands to inherit from a base
DumpApkCommand and adds a command that prints out an ASCII
image of a badger if the user wrote "badger" instead of
"badging". The command is hidden from the help menu.
Bug: 73535002
Test: manual
Change-Id: I9bdd8a7bbf6a4282c4933e5c478f6d1d8e32d99e
|
|
Use with:
aapt2 dump apc [apc]
aapt2 dump configurations [apk]
aapt2 dump strings [apk]
aapt2 dump resources [apk]
aapt2 dump xmlstrings [apk] --file [file]
aapt2 dump xmltree [apk] --file [file]
Will add permissions and badging in a later commit.
Bug: 73351292
Test: Manual tests of the commands
Change-Id: I97eec01222af14053a98bd70255f1bfecd16b1c4
|
|
Refactors the flag based command invocation into classes that make using
subcommands easier.
Test: manual tests of printing
Change-Id: Ic8df6af0be30db552e32150afebecbfeec7e1075
|
|
This command allows a developer to convert their proto APK
(generated from the link phase using --proto-format) into
a binary APK suitable for use on device.
aapt2 convert -o output.apk input.apk
Test: manual + make aapt2_tests
Change-Id: I10a7c33bb4b57006d01fe00a8bf92f78e04e7e50
|
|
Test: manual
Bug: 65645766
Change-Id: Id8bdb14e498bd79ff642f9ad56ef05ec7a5825af
|
|
Accept a set of arguments separated by newlines.
This avoids path separator conflicts with the argument
format for passing splits.
Test: manual
Change-Id: Ia68122cb77b7dde2292a0fd953e79f02996ac01c
|
|
Test: manual
Change-Id: Ia1997800ad94f386dbbb4195011395ecee1ba91f
|
|
Gradle and other build tools that need to frequently interact with aapt2
can use the daemon mode to issue regular CLI commands without paying
the process start cost for each invocation.
Test: manual
Change-Id: I543858ed46496278bad643f0dae688c924ec6c3f
|
|
Mingw64 was being difficult, so instead of defining a wmain entrypoint,
the command line parameters are parsed manually using built-in Windows
methods that support Unicode. The results are converted to UTF8 and
handled just like the rest of the linux/mac version of the code.
This also removes dependencies on std::istream in favour of a
FileInputStream which calls the appropriate unicode version of
open to read a file.
No speed regressions found on Linux or MacOS.
Bug: 62336414
Bug: 63830502
Test: manual
Change-Id: I597da51e33729ed1b98bf246e7e773337fd3fee8
|
|
Test: none
Change-Id: I6e3b4c95a7d7ba416ba368e5b19782dbffa04fd8
|
|
Test: none
Change-Id: I6429b1c3acbcbf2244a5a5c95bc48a5d66bdaebe
|
|
This change defines some hardcoded rules to degrade
attributes in newer SDKs to specific older attributes.
An attribute with a degrade rule will generate a new XML for the API
in which the attribute resulting from the degradation was introduced.
Since API 22 (Lollipop MR1), attributes are correctly ignored and do
not need to be versioned. In XML files defined for APIs 22+, the
original and degraded attributes coexist in the same XML file.
One such example is paddingHorizontal, introduced in API 26.
paddingHorizontal degrades to paddingLeft and paddingRight, which
were both introduced in API 1.
Bug: 35763493
Test: make aapt2_tests
Change-Id: I4aa8755a9ee2c0cc5afdc55c3d30093fd3a47f3d
|
|
When compiling, a developer may want to disable PNG crunching
for a specific set of PNGs.
Bug: 37729284
Test: manual
Change-Id: I134f208f8bb212df07a4eef65b467985a6443375
|
|
* changes:
Valid resource IDs may be negative
AAPT2: Workaround for findViewById with package ID > 0x7f
|
|
The entire View code base checks IDs against View.NO_ID except
findViewById(), which checks to see if the ID is negative.
Any package ID > 0x7f is interpreted as a negative number in Java
(no unsigned ints), so this check prevents the use of IDs > 0x7f.
findViewById is final, so support library workarounds are not possible.
Instead, IDs (@id/foo) are just sentinels, their values don't matter.
If building for pre-O devices, rewrite any references to these IDs of
the for 0xPPTTEEEE, where PP > 7f, to 0x7fPPEEEE.
The symbol table will check for potential collisions against the base
APK, so this should be safe.
Bug: 37498913
Test: manual
Change-Id: Ife3bbd29db287757ef8a2ffd83053d97f1db2613
|
|
Rather than relying on stderr being wired correctly.
Test: Tests for JNI integration in studio-master-dev.
Change-Id: I1c7e7130bc4e56d61de259a9596bee3a6b3520fb
|
|
Generating splits should be possible to do from the optimize command.
This means that a lot of infrastructure around split APKs can be
shared by both the optimize and link phase.
Bug: 35925830
Change-Id: Ia88b9e4bff300a56353b2f7a4a2547c8eb43a299
Test: manual
|
|
ID types should not be encoded as a map. AAPT and AAPT2 emit
IDs as boolean types.
Some apps exist that for some reason have their ID types encoded
as empty maps. This is the case only for the auto generated IDs
from enum values in <attr> tags.
Allow IDs as maps and ignore their content when processing an APK
for optimizing.
Also fixes an issue with expected size of the ResTable_package struct.
Bug: 35861796
Test: tested against the APK in b/35861796
Change-Id: I29a19cd9777bb10bed6766cd42e35e50e098797b
|
|
This also enables an AAPT behavior that CTS tests have
come to depend on.
Small files that compress negatively (get larger) are stored
uncompressed. Some CTS tests assume this and try to open these
files by mmapping them, which is only possible if they are
uncompressed.
Bug: 35461578
Test: make aapt2_tests
Change-Id: Id622a6150fe72477ad65d67d1bad897a8ee2ffb9
|
|
Bug: 35928935
Change-Id: Ia8496505e61cfcfdb8f9f62366d2f36e453db111
Test: make aapt2_tests
|
|
- Allow resource deduping, version collapsing, and sparse resource
encoding.
Test: manual
Change-Id: Ia4aa892ab5b06ba1d5ea4a6efb51b00bc3a980c4
|
|
Test: make aapt2_tests
Change-Id: I98dddf1367e6c0ac425bb20be46e6ff05f4f2f45
|
|
The XLIFF 'g' tag specifies content that should NOT be translated.
AAPT2's pseudolocalization process should respect it.
Bug:34064599
Test: make libandroidfw_tests
Change-Id: Ice437d7f0ff246730ee04896fd035e2d846148fb
|
|
|
|
- Add <feature-group> to ManifestFixer.
- Support <meta-data> in <instrumentation>
- Add support for <bag> and type="configVarying". Some CTS tests use this
old notation, we need to support it (even though configVarying isn't
anything supported by the framework convention).
Change-Id: I6946fa633ce513ea8437c1496db883cf27dcf6de
Test: make aapt2_tests
|
|
The strip command takes an APK as argument and a --target-densities flag which
contains the list of screen densities for which to optimize the APK. All
the resources that would be unused for a device having the given
densities are stripped from the APK leaving only the ones actually being
used.
Test: Manual.
Change-Id: I68368b00876a18ccdbbfc0a8dd265bd361117933
|
|
Add a new flag to disable versioning of Transition related XMLs.
Transition support library will use this to handle these XMLs on older
API levels.
Test: make libaapt_tests AaptTestAppOne
Bug: 34427868
Change-Id: I66e81cca049e71ef6704177b2ca21c9cdeaff78f
|
|
libandroidfw needs to make use of StringPiece, so
move it to libandroidfw and update all code referencing
StringPiece in aapt2.
Test: make libandroidfw_tests libaapt2_tests
Change-Id: I68d7f0fc7c651b048d9d1f5e7971f10ef5349fa1
|
|
Bug:32171613
Test: libaapt2_tests
Change-Id: I30fdd9475ff7dff6ceb0ff46a4a00991b72db68b
|
|
Test: make libaapt2_tests AaptTestAppOne
Change-Id: I8fbf01675a218cc3c0b59598b6b1ec173851e946
|
|
Use Google3 naming style to match new
projects' and open source google projects' style.
Preferred to do this in a massive CL so as to avoid
style inconsistencies that plague legacy code bases.
This is a relatively NEW code base, may as well keep
it up to date.
Test: name/style refactor - existing tests pass
Change-Id: Ie80ecb78d46ec53efdfca2336bb57d96cbb7fb87
|
|
Test: style change only, builds ok
Change-Id: I885180e24cb2e7b58cfb4967c3bcb40058ce4078
|
|
Update version to 2.2 and update readme to reflect added
support for inline complex XML resources.
Change-Id: If825c96541952e95860d34390c6c36704a24129b
|
|
Bug:30445078
Change-Id: If4b8530dba71b9059b8e62c04757da99c1119d22
|
|
Bug:30402888
Change-Id: Idb532cc71921eb1cfba31c00a6fb7108e31fddd8
|
|
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
|
|
Without needing to conform to the runtime data format,
it is much easier to add new features such as debugging symbols
and carrying over product data to link time.
This also simplifies the runtime format parser and serializer,
which will change much less frequently than the protobuf intermediate
format.
Change-Id: I209787bbf087db0a58a534cb8511c51d21133e00
|
|
An early refactor. Some ideas became clearer as
development continued. Now the various phases are much
clearer and more easily reusable.
Also added a ton of tests!
Change-Id: Ic8f0a70c8222370352e63533b329c40457c0903e
|
|
The compile phase doesn't use the AndroidManifest, so we had to specify the
package name on the command line.
We can omit the package name, since we don't resolve external references
in the compile phase. Packages that reference the current package will be encoded
with no package name. When loaded by the link phase, the package name will be supplied
and all the references with no package name will use that one.
Change-Id: I9fe4902b747b06899b45c968f30ba1aa05c5cd69
|
|
Change-Id: Ifbe79516cd9a1ade471e211a259301c63b62ac67
|
|
Now that AAPT2 is library-aware, it needs to take care of
all library related work, including merging manifests.
The logic was taken from the current Java ManifestMerger.
Change-Id: Id93f713f27ae8617922bf89e325e45be9f863c06
|
|
We modify the XML of layouts and AndroidManifest enough
that it warrants we operate on the tree in memory.
These files are never very large so this should be fine.
Change-Id: I5d597abdb3fca2a203cf7c0b40fcd926aecb3137
|
|
Change-Id: I37190cf8a1f0a81c068aeb2b5326b3b3080f75a5
|
|
Change-Id: Id7c5a4b5d0880520e1fea05e5a31d398946c5f05
|
|
Change-Id: I8fbc4feef16b6039cf4c526fcfb767dc75a9c131
|
|
When a static library A references static library B,
and app C references both A and B, we get the following symbol merging,
symbols from library B get imported twice.
We must only check that symbol references to library B are valid
when building library A. We should only merge all the symbols
when building final app C.
Change-Id: I23cba33b0901dcbb5328d9c9dfaa6a979c073c36
|