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.
Signed-off-by: inazaruk <ievgenii.nazaruk@gmail.com>
(cherry picked from commit e348909c1966c3d192841cc131a32be6ed90da18)
Change-Id: I4bff836c42a309bac36e5d1ce1899131b3c4c194
This is a combination of three minor clean-up tasks:
- Generate correct idmap even if name lookup fails:
Any resources following a resource with a spec but no actual values
would receive an incorrect ID in the idmap due to an accumulating offset
error. To combat this, a dummy value is inserted in the idmap whenever
a resource with a spec but no values is encountered.
- Optimize pruning of padding zeroes in idmaps:
Earlier, trailing zeroes were iteratively popped from the end of each
type block of an idmap. This commit instead tracks where to make the
cut, and does so with a single function call.
- aapt: warn about resources which lack values:
The resource framework assumes every resource to have a value for
at least one valid configuration. However, if multiple resource
directories are used (several -S options to aapt), the list of
configurations is limited by dpi (-c option to aapt) and a resource
is only available in discarded dpi configurations, aapt will create
a resource entry where each configuration lack an actual value. This
commit lets aapt emit a warning whenever this has happened.
Change-Id: Ic7451b7f4adfef5bfa6b0d7e64e057f317a2cdaa
Previously, building overlay packages required passing aapt its -o flag.
This commit decouples the idmap generation code from the effects of the
-o flag.
Since this commit renders the -o flag obsolete, support for the flag was
removed from aapt as well.
Change-Id: Ied2e0ab8cb800e49623f0a2044b06cd4935473d5
This patchset introduces a new standard namespace http://schemas.android.com/tools
which will be used for tools specific XML attributes.
Any attributes using this namespace will not be compiled into the binary XML file.
The namespace node is also not written at all, and its string is not collected
to ensure that there is no impact on the devices.
(cherry picked from commit a5d5e9d906583ebeb590ca200ca9840302a5cd1a)
Change-Id: I62937b8bc34c07ac544930aa8eadd7797e0179d5
This patchset introduces a new standard namespace http://schemas.android.com/tools
which will be used for tools specific XML attributes.
Any attributes using this namespace will not be compiled into the binary XML file.
The namespace node is also not written at all, and its string is not collected
to ensure that there is no impact on the devices.
Change-Id: I3e75d44cda54e1fa7b5cdc56b3eb27db80fe7761
In our current environment with very many translations, this can
save a lot of RAM -- for example over 200K in Gmail just by sorting
the strings in the Gmail .apk (not the framework).
Also add a new aapt command to print the contents of the resource
table string pool.
Change-Id: I1da037b3e2c377b890833ff57ab158965314ac48
The idea is that this is a device which is more-or-less headless. It
might have some limited interaction capabilities, but it's not something
that you want to rely on having.
Change-Id: Ib92f53a120bf83de781728011721a4859def7d9f
There's no printf %zd on Mingw/Cygwin so the verbose
printf crashes aapt.
SDK bugs: 20395, 20986
Bug: 5742142
(cherry picked from commit f51125d8429ffa71c57ba6fbdca9effc72642a9b)
Change-Id: I7545734ce8ce4a1f3e95f8a255daa8a909f870a1
This fixes the build on Linux when RefBase is compiled with reference tracking
enabled.
Change-Id: I3e931e0b463ce836f6fdb30c37068d77144631a3
Signed-off-by: Iliyan Malchev <malchev@google.com>
This adds a --preferred-configurations flag that specifies the
specific configurations you would like to have.
It is smarter than "-c" because it will avoid stripping a
configuration if that would result in there being no value
for the resource.
It is dumber than "-c" because it can't process as many kinds
of resources. It is really only intended for bitmaps and use
with density configs.
This required re-arranging AaptAssets to group files together
by config again, like they used to be. I think this hasn't
broken anything. Hopefully.
Change-Id: I4e9d12ff6e6dbd1abb8fd4cb1814c6674b19d0e5
Localized strings with product variants were not being included in the APK,
apparently because the check to ensure that a different variation of the
string had not already been included in the APK was matching the version
of it from the default, untranslated configuration.
Now check to make sure that the string not only exists but also exists in
the correct configuration.
Bug 5372711
Change-Id: I52975570b75e0f11827dc6bcf1cb4a987d0541aa
This changes the name of the generated dependency files to R.java.d
and <ApkName>.ap_.d respectively.
Change-Id: I17e18770fc0d0a5d31c7b37b40ac1949f45ef13a
This change removes debugging code from FileFinder.
This code was considered harmful because it uses the std::cout
from <iostream>.
Change-Id: Iad9b5e8a631883bd4854abdb29bc6df8a5b4a056
The arguments that ZipFile takes were apparently meant to be a typed
enum, but the name of the type was taken out because it creates invalid
conversion warnings in C++ since this is an invalid use of enum.
Just change the typedef enum to an anonymous enum so we get rid of the
compiler warnings. It will be implicitly converted to int instead.
Change-Id: Ie72c4c235c8f9ee8fd1b795e1010b77c55e983de