Motivation: we'd like to programmatically specify the version
name/code (i.e. to include the build number from the build server).
However, this means that we cannot specify version info in the
AndroidManifest.xml file, as this takes precedence. Not doing so makes
IDE use more difficult, as the IDE gets version code 0 and won't
install over an existing non-IDE version unless you first force a
downgrade to an IDE build from the command line.
This flag allows us to specify a very high version code in the
AndroidManifest.xml file, making IDE builds take precedence, while
still allowing us to override this info when performing command-line
(official) builds.
Change-Id: I5d01048698af5c26bdf19066c6cd4eca1115112a
Support 3 letter language codes, script codes &
variants. The bulk of the changes are related to
the implementation of command line filtering of
locales etc. The previous code assumed that the
value of each "axis" (locale, density, size etc.)
could be represented by a 4 byte type. This is
no longer the case.
This change introduces a new class, AaptLocaleValue
which holds a (normalized) locale parsed from a
directory name or a filter string. This class takes
responsibility for parsing locales as well as
writing them to ResTable_config structures, which is
their representation in the resource table.
This includes minor changes at the java / JNI level
for AssetManager. We now call locale.toLanguageTag()
to give the native layer a well formed BCP-47 tag.
I've removed some duplicated parsing code in
AssetManager.cpp and replaced them with functions on
ResTable_config. The native getLocales function has
been changed to return well formed BCP-47 locales as
well, so that the corresponding java function can use
Locale.forLanguageTag to construct a Locale object
out of it.
Finally, this change introduces default and copy
constructors for ResTable_config to prevent having
to memset() the associated memory to 0 on every
stack allocation.
Change-Id: I899a56a9a182ee6be52b9389d1ae59266f5482e9
Also change the order of parameters in ResTable constructors
to avoid ambiguity.
(cherry picked from commit 00b314436f4fdfada4bbf1e79ec12e9fa38aeaf1)
Change-Id: I874c5d03c134dc3c331fba423b5280366296287c
This change ensures that assets that are not needed for the
preferred density are stripped from additional directories
specified by the -S flag
For simplicity, the logic for deciding which assets are not
needed is still applied per directory, rather than globally,
which may still result in some unneeded assets being included
in the final output.
Bug: 12604267
Change-Id: Ic1378570c2d9cd1c854c507e784233818c19efca
This lets us share zip archive processing code with both
the runtime (Art, dalvik) and critical java code
(StrictJarFile).
This change also moves several utility methods to ZipUtils
and dedups code across several zip inflation methods.
One of the side effects of this change is that several
processing loops are now O(n) instead of O(n^2).
bug: 10193060
(cherry picked from commit e9d380f9303692950166472b1dfab083e1af8133)
Change-Id: I53e7d0c0af266cb1fe4e293e1177b2590cc44224
It forces aapt to return an error if aapt fails to find an resource
entry for a configuration.
Bug: 11259444
Change-Id: Ie5674a29dff5d4455e7d7c94f6b25560fb1305b7
If the manifest specifies a maxSdkVersion for which to
stop granting a certain permission, output that value
when dumping badging.
bug:11630700
Change-Id: I922a3186340383828e1af3ce0815efb407d9d535
Also, changed getComponentName() to output a String8 object
instead of a const char * because the const char * is an internal
buffer of a String8 object which gets immediately destroyed
after returning from getComponentName().
Bug: 11329761
Change-Id: Ic459dec0ad3b20162c36de0ee492bcc022863b12
When a preferred density is specified, prune all but the
closest matching density when the exact density resource does not
exist.
If a preferred density resource does not exist and a higher density
resource exists, prune all but the resource with the next highest
density relative to the preferred density.
If a preferred density resource does not exist and there is no
higher density resource, prune all but the resource with the next
lowest density relative to the preferred density.
Manual merge of I99b3950fe3d8116a5625968ed383442315ae8526 from
frameworks/base/tools to frameworks/tools
bug:11224465
Change-Id: Idddf55dad27f114ffc429b61317c3a5b1435d808
This fixes outputting string as well as not crashing when the
<meta-data> element has an "android:resource" attribute instead
of an "android:value" attribute.
Bug: 11255844
Change-Id: Iadb62b5dcb18ea3db8dbd2ba3241f489606d535d
Rather than ignoring resources that do not match the specified
product, we keep track of the ignored ones and make sure that
some variant of the resource that matches the product was processed.
bug:10860838
Change-Id: I7a35f37fda2c9561634f75323bd4cb2b9047e29b
Bug: 10447005
Call png_set_interlace_handling explicitly instead of relying on
implicit handling that logs warnings
Include filename when printing warnings
Change-Id: Ia343427f5522dc8ab1010f8d7017e86f389caf99
Part of the Transition API changes, except that the tools/ directory
got moved between klp and master, so re-making the same changes here.
Issue #10460684 KLP API Review: android.view.transition and android.animation
Change-Id: Icedca1dc689285b4b213f9376656b26f18c7f23e
Cookies are really indices into vectors and arrays, so
they don't need to be void*. We choose int32_t instead
of size_t to allow their width to be well specified.
(cherry picked from commit ebfdd0f467e39c3af8d92cade78263935340acb7)
(cherry picked from commit a7fa2e592e2e579e5acdb903dba83fc074ebc215)
(cherry picked from commit a9d5701b034ed2d9771b3f0943e1add00741d7cd)
Change-Id: I2aed3db568b6fdc487bf99e2c5dd123206736fda
This lets us share zip archive processing code with both
the runtime (Art, dalvik) and critical java code
(StrictJarFile).
This change also moves several utility methods to ZipUtils
and dedups code across several zip inflation methods.
One of the side effects of this change is that several
processing loops are now O(n) instead of O(n^2).
bug: 10193060
Change-Id: I3c7188496837a47246c4f342e45485a70fef3169
When a preferred density is specified, prune all but the
closest matching density when the exact density resource does not
exist.
If a preferred density resource does not exist and a higher density
resource exists, prune all but the resource with the next highest
density relative to the preferred density.
If a preferred density resource does not exist and there is no
higher density resource, prune all but the resource with the next
lowest density relative to the preferred density.
bug:11224465
Change-Id: I99b3950fe3d8116a5625968ed383442315ae8526
Rather than ignoring resources that do not match the specified
product, we keep track of the ignored ones and make sure that
some variant of the resource that matches the product was processed.
bug:10860838
Change-Id: I804cd04a053269a35b7e1c1cc743b77493337bf9
HCE apps that declare themselves as payment apps will receive
that badge when running aapt dump badging.
bug:10899864
Change-Id: I7c095214412465ad7a925285d6167e12de16b600
APKs with AccessibilityServices, PrintServices, and or DeviceAdmin
will have those services dumped when running 'aapt dump badging'.
bug:10899864
Change-Id: I9c1f1f36c397b128dca802510368573a54977459
Issue #10460684 KLP API Review: android.view.transition and android.animation
Issue #10570740 Transitions: inflate transition targets from xml
Change-Id: I7a3f6d3aece2fcafc5efd555d033f79e86635c98
This enables output of <meta-data> tags within the <application>
element of the AndroidManifest.xml if the --include-meta-data
command line option is invoked. For example, by
aapt dump --include-meta-data badging Foo.apk
Bug: 10257318
Change-Id: I88da1a14ab21146b64ac947e0eeb1107816acd4d
png_set_filler() now fails if the color type doesn't support
a filler (such as RGB_ALPHA)
png_set_unknown_chunk location bug was fixed and now enforces
proper location setting
Change-Id: If3834e3744d9618c308cc442e66d85e9cffcea38