Attributes in XML like "class" should be treated as attributes with no
format specified. That means that something like 'version="1"' will
be interpreted as an Integer value instead of as a string.
This is more in line with the old AAPT behaviour.
Bug: 30763349
Test: make libaapt2_tests
Change-Id: I02fe41617e3c62c354714056198ef480d62afee7
Added new "ping" method used to detect if the shared
library has already been loaded.
Fixed a few bugs in the implementation (and now it works
from the Java side).
See http://ag/1590668 for the implementation on devtools.
Test: Done on the tools side
Change-Id: Ifa41073dc3b6ac69cdb9f77e655bf261c3b4c3d1
This includes copying and slightly modifying
libnativehelper's ScopedUtfChars' implementation.
Test: Done in studio-master-dev
Change-Id: I2aacc67b444668478aaa5bb0db991a201c571d1f
PackageParser on the device uses the targetSdkVersion of the
app while it parses <application>. That means that if the
<uses-sdk> tag comes after <application>, the targetSdkVersion
is assumed to be 0.
Test: make libaapt2_tests
Change-Id: I60f2179a7ff44e7419217afb53f3d24f8c030f6e
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
Keep styledstrings at the beginning of the StringPool
to reduce the padding in the StyledString array.
Bug:32336940
Test: manual
Change-Id: Iec820c21a54daac40ecc3b2f87517a0f1efc9d3d
Incorrectly passing text XML and unprocessed PNG files to
the AAPT2 link phase should raise an error.
Test: manual incorrect invocation of aapt2
Change-Id: Iab47f99bc378b5d1c4f4d87098f08243b9a4dc6a
frameworks/base/tools/aapt2/util/Files.cpp:81:21: warning: Null pointer
passed as an argument to a 'nonnull' parameter
while ((entry = readdir(dir))) {
Bug: None.
Test: Warning no longer appears.
Change-Id: If242598405e995928378ce317a2e909654e1e985
Added dominator tree analysis of resource configurations for each
resource entry to allow deduping of resource entries if:
1. The configuration for the resource entry's value is dominated by
a configuration with an equivalent entry value.
2. All compatible configurations for the entry (those not in conflict
and unrelated by domination with the configuration for the entry's
value) have an equivalent entry value.
Bug: 30051199
Test: make libaapt2_tests && libaapt2_tests
Change-Id: I66468d3014a2d6097a94b039ac1028f9f461c7d3
PngCrunching now has a slightly better heuristic of choosing to encode
an image as a palette or RGB. For small images, RGB compresses much better
than a palette.
The original PNG is used as-is (minus some optional chunks being stripped)
if the resulting crunched PNG is larger than the original.
9-patch handling is abstracted away from PNGs, paving the way
for other 9-patches, like WebP.
TODO: handle PNGs with 9-patch chunks already present, which
should just be passed through. This will allow for 3rd party
tools to generate 9-patches.
TODO: implement cheap transparency: when one color is used to represent
transparent, and all other colors are opaque.
Bug:30053276
Change-Id: I5167f53b91d1efa462d9f03d6b9108d9b541c0c1
Styled strings use spans to denote which part
is styled (<b>, <i>, etc). Spans are simply a range
of indices into the original string.
In Java, we use String and its internal representation, meaning
we must encode the indices using UTF16 lengths.
When the internal AAPT2 representation of strings switched to UTF8,
the indices also began to index into the UTF8 string.
This change reverts the indices to use UTF16 lengths.
Bug:31170115
Change-Id: I07b8b5b67d2542c7e0a855b601cdbd3ac4ebffb0
Update version to 2.2 and update readme to reflect added
support for inline complex XML resources.
Change-Id: If825c96541952e95860d34390c6c36704a24129b
A compiled ResourceTable may contain multiple packages.
When referencing a framework attribute, for instance,
the compile phase has no idea if that attribute is a USE
or a DECLARATION, like so:
<declare-styleable name="Foo">
<item name="android:id" />
</declare-styleable>
If this file is compiled with the package 'android', then this
is a declaration. If it is compiled with the package 'com.foo',
this is a reference that must resolve at link time.
Since this is common, warning that the package 'android' is being
ignored during the merge phase is incorrect behaviour.
The warning was antroduced in ag/1363992
Change-Id: I09254d79ac379439face177eb724df882d1d0ce1
Styleables should only be merged when processing overlays.
This moves the styleable merging code out of ResourceTable
and into TableMerger.
Change-Id: I3aae05cf4dd875cd25ac2ac744b61194409b2fee
libziparchive-host is no longer necessary, and mixing libziparchive-host
and libziparchive can cause ODR violations.
Change-Id: I623c0c5579e28f26a6e1db7bd953f33ed1ca68cd