Add --output-text-symbols option to aapt. do not merge.
Library projects in the SDK are built using --non-constant-id
to generate a temporary R.java class.
When the library is packaged with the application to generate an
apk, the R class is recreated with the proper IDs due to all the
resources coming from the app and all the libraries.
However for large apps with many libraries (each with their own
R class in their package), this means a lot of unnecessary IDs:
all R classes contains all the IDs including for resources from
by projects they don't have access through the dependency graph.
For really large apps (X,000 resources), with lots of libraries
(10+), this can generate tens of thousands of resources, which
can trigger dalvik's limit of 65K fields and methods per dex
files.
This changes lets aapt generate not only the R class but a simple
text file containing the list of all those IDs so that it is
easier to parse back. The SDK build system will not ask aapt
to generate the R class of the libraries (through the
--extra-packages option), instead it will then read this
file to know what IDs are needed for each library and generate
a much smaller R class for each library (using the same text
file output from compiling all the resources to get the final
integer value).
Library projects in the SDK are built using --non-constant-id
to generate a temporary R.java class.
When the library is packaged with the application to generate an
apk, the R class is recreated with the proper IDs due to all the
resources coming from the app and all the libraries.
However for large apps with many libraries (each with their own
R class in their package), this means a lot of unnecessary IDs:
all R classes contains all the IDs including for resources from
by projects they don't have access through the dependency graph.
For really large apps (X,000 resources), with lots of libraries
(10+), this can generate tens of thousands of resources, which
can trigger dalvik's limit of 65K fields and methods per dex
files.
This changes lets aapt generate not only the R class but a simple
text file containing the list of all those IDs so that it is
easier to parse back. The SDK build system will not ask aapt
to generate the R class of the libraries (through the
--extra-packages option), instead it will then read this
file to know what IDs are needed for each library and generate
a much smaller R class for each library (using the same text
file output from compiling all the resources to get the final
integer value).
The new SDK build system give the ability to insert
versionCode/Name and min/targetSdkVersion in the manifest
but aapt won't replace those if they already exist.
The main problem is that aapt doesn't actually fail when
it doesn't replace them, making the output not what the
developer wanted.
This patch set adds an option to aapt to make it return
an error if the insert failed because the attribute
already existed.
Fix aapt -G to properly support class attr in fragment.
The code added attributes android:name and class to a
KeyedVector under the same key (fragment) so the 2nd
add (android:name) removed class with was never checked.
This replace the value type in the KeyedVector to be
Vector<NamespaceAttributePair> instead of just
NamespaceAttributePair.
When using aapt dump xmltree to dump an XML which has a content element with newlines, the output contains a
newline. This makes it very difficult, sometimes impossible, to understand what is part of the content, and
what is the meta-data.
We now pass XML content through the same normalizer used for other tags.
Raphael Moll [Mon, 7 May 2012 23:16:46 +0000 (16:16 -0700)]
Merge "AAPT: support a new --ignore-assets flag."
AAPT has a fixed built-in list of files and directories
to ignore when parsing resource files. Over the years we
always had developers requiring specific patterns.
Added a command-line option for it:
aapt di --ignore-assets "foo*:*.blah"
If the env var ANDROID_AAPT_IGNORE is set, it is parsed
to find which file/directory patterns to ignore.
Otherwise a default is used that matches the current behavior.
Raphael Moll [Mon, 7 May 2012 23:16:46 +0000 (16:16 -0700)]
Support a new ANDROID_AAPT_IGNORE env var.
AAPT has a fixed built-in list of files and directories
to ignore when parsing resource files. Over the years we
always had developers requiring specific patterns.
If the env var ANDROID_AAPT_IGNORE is set, it is parsed
to find which file/directory patterns to ignore.
Otherwise a default is used that matches the current behavior.
Added a command-line option for it:
aapt di --ignore-assets "foo*:*.blah"
Add new aapt dump badging output explaining implicit badging.
New uses-implied-feature and uses-implied-permission tell you
about any features or permissions that aapt is automatically
adding to your app, and why it is doing so.
Dan Morrill [Wed, 11 Apr 2012 00:13:17 +0000 (17:13 -0700)]
Merge "Adding a line for android-debuggable to 'dump badging' if AndroidManifest.xml is configured as such. This is to be used by e.g. Play Store to warn the developer that they are about to publish a security hole."
- Added a new custom PNG chunk that carries the layout padding ints.
- Extract the padding ticks from .9.png images and store in the chunk.
- Load the padding information at runtime into Bitmap and NinePatchDrawable.
- The new chunk is ordered first so that it doesn't cause a problem in older
versions of the platform.
Dan Morrill [Tue, 3 Apr 2012 19:44:40 +0000 (12:44 -0700)]
Adding a line for android-debuggable to 'dump badging' if AndroidManifest.xml
is configured as such. This is to be used by e.g. Play Store to warn the
developer that they are about to publish a security hole.
Nobuhiro Hayashi [Mon, 30 Jan 2012 09:42:20 +0000 (18:42 +0900)]
aapt: Remove terminal pointer incrementaion
When initialization, 'end' pointer refers terminal
character in a string. But it is incremented in
while loop. It occurs the access to non-secure memory.
Ben Gruver [Thu, 8 Mar 2012 05:19:16 +0000 (21:19 -0800)]
Fix an issue where a non-styled string could be made into a styled string
If a styled version of an otherwise identical string is encountered before
a non-styled version, aapt merges the two, effectively making the
non-styled string have a spurious style.
Ben Gruver [Wed, 7 Mar 2012 03:26:22 +0000 (19:26 -0800)]
Fix up getAttributeFlags() function
In addition to a couple of minor clean-up items, this fixes an issue that can
rarely cause incorrect parsing of attribute flag values, when there is a '|'
character in the few bytes past the end of the attribute value being parsed.
inazaruk [Sun, 22 May 2011 22:09:06 +0000 (15:09 -0700)]
Fix for issue 9656 - custom xml attributes in Android Libraries. do not merge.
Added support for predefined namespace http://schemas.android.com/apk/res/auto
that aapt tool recognizes and treats as namespace with package name
taken from current application's AndroidManifest.xml, //manifest/package attribute.