Packages without any resources should not expect to have
a DynamicRefTable.
Bug:16895517
Bug:17056720
Change-Id: Id006f6bdbf08f30505f6ba5982bc9d1b09db0f0a
This reverts commit 0e475302cd196f45a01a525c49089018b238d4ba.
I'll re-upload this CL with the correct fix in LoadedApk.
Change-Id: I17c6381f8e5907dab9f996f89c5d435b9c08a13a
When a String isn't found in the StringPool,
we should not try to construct a String8 object
from the NULL string.
Bug:15163956
Change-Id: I51e701918b10a72c18a860b8a36dce2afd9c0b82
All APKs are expected to have at least one resource table (even if
it is empty). We were missing the creation of an empty DynamicRefTable.
Bug:16895517
Change-Id: I6a6e887f91b3b4bbcc52b3fd2741ef3d05fab1fd
A ResTable_map entry has a name attribute, which
could be a dynamic reference if it comes from
a shared library. It was not being patched with
the correct package id.
Bug:16795890
Change-Id: Ia8df6a943269b2fefb2132c3ed74eb1997d7701b
This change allows the developer to add a base package for
which to build a feature split. The generated resource types
will begin after the base APK's defined types so as not
to collide or override resources.
Multiple features can be generated by first choosing an
arbitrary order for the features. Then for each feature,
the base APK and any preceding features are specified
with the --feature-of flags.
So with a base APK 'A' and features, 'B', and 'C',
'B' would be built with
aapt package [...] --feature-of A [...]
and 'C' would be built with
aapt package [...] --feature-of A --feature-of B [...]
Change-Id: I1be66e3f8df9a737b21c71f8a93685376c7e6780
We should call ResourceTable::getLocales directly,
and not AssetManager::getLocales. The latter will convert
"tl" to "fil" so we'll end up thinking we have resources
for "fil" when we don't really have any.
bug: 15873165
Change-Id: I9753e4608aaecede328a40ee1f3ee6b016d0dedc
For JB-MR1, there was a hack that used "tl" where
we really meant "fil" because ICU didn't have localizations
for "fil". This has now been fixed, and we now support 3 letter
language codes for AAPT so we can use "fil" where required.
For the benefit of apps that need to target older platforms,
we fall back to "tl" if the app has assets for "tl" and the
resource locale is "fil".
See bugs 7291355, 7207176 and 8049507 for more context.
Change-Id: I1ac8502525f99b40f9091d5efd2df33518d47a41
Our bitmask for setting the highest bit to 0 for
0b11100000 (0xef) instead of 0b01111111 (0x7f) so
we would end up setting bit 5 of each offset to
zero. Fix this and expand test coverage by adding
a fake language (tgp) that has this bit set in both
its bytes.
This issue was discovered while adding CTS tests for
"tgl".
Change-Id: Ibb6de03000951c907c252049771039ab7466187a
The method parsePackage failes to delete some resources
in case of failures.
Added delete of "package" in the cases that was previously
missed.
Change-Id: I183e9ec5864c5ed18bb48410ab41317cb3d96bda
For logging purposes, a uint32_t was being converted into
a void pointer, which on certain systems would be a conversion
to a different size.
Change-Id: I90af69ab975d84c9c8cbb1cce94ff4e9cc6edcf2
In order to support APK split features, the resource
table needs to support loading multiple resource
tables with the same package but potentially new set
of type IDs.
This adds some complexity as the type ID space changes
from dense and ordered to potentially sparse.
A ByteBucketArray is used to store the type IDs in
a memory efficient way that allows for fast retrieval.
In addition, the IDMAP format has changed. We no longer
need random access to the type data, since we store the
types differently. However, random access to entries of
a given type is still required.
Change-Id: If6f5be680b405b368941d9c1f2b5d2ddca964160
Symptom: memory leakage
Root Cause: new SortedVector but not free it in native cpp
Solution: free the SortedVector
Project: AOSP
Note:
Change-Id: Iab5a7f2e8d8509631301e7231427927d4797c856
A malformed APK may cause a crash if it
encodes its chunk size as a signed number
(MSB set to 1).
Bug:14898892
Change-Id: I342853c2b0859e5be15d712d451323afc367d329
Build multiple APKs, each containing a disjoint subset
of configurations. These can then be loaded into the device
AssetManager and should operate as if they were never split.
Use the idea of building multiple sets of files, where each
set represents an APK. An ApkBuilder can place files
in a set based on its configuration, but you can actually
add directly to a set, in the case of the resources.arsc and
generated AndroidManifest.xml for splits.
Change-Id: Ic65d3f0ac1bbd290185695b9971d425c85ab1de3
Changes in this patch include
[x] Use %zu for size_t, %zd for ssize_t
[x] Some minor changes have been done to conform with
standard JNI practice (e.g. use of jint instead of int
in JNI function prototypes)
Change-Id: Id1aaa7894a7d0b85ac7ecd7b2bfd8cc40374261f
Signed-off-by: Ashok Bhat <ashok.bhat@arm.com>
Signed-off-by: Craig Barber <craig.barber@arm.com>
Signed-off-by: Kévin PETIT <kevin.petit@arm.com>
Signed-off-by: Marcus Oakland <marcus.oakland@arm.com>
Shared libraries can now export resources for applications
to use.
Exporting resources works the same way the framework exports
resources, by defining the public symbols in res/values/public.xml.
Building a shared library requires aapt to be invoked with the
--shared-lib option. Shared libraries will be assigned a package
ID of 0x00 at build-time. At runtime, all loaded shared libraries
will be assigned a new package ID.
Currently, shared libraries should not import other shared libraries,
as those dependencies will not be loaded at runtime.
At runtime, reflection is used to update the package ID of resource
symbols in the shared library's R class file. The package name of
the R class file is assumed to be the same as the shared library's
package name declared in its manifest. This will be customizable in
a future commit.
See /tests/SharedLibrary/ for examples of a shared library and its
client.
Bug:12724178
Change-Id: I60c0cb8ab87849f8f8a1a13431562fe8603020a7
The Res_png_9patch struct had several pointer members
whose size differed between 32 and 64 bit platforms.
These members have been replaced by uint32_t offsets
to serialized data. The serialized form for 9patches
places a Res_png_9patch object at the beginning of
serialized data, followed by int32_t arrays of xDivs,
yDivs and colors.
Note that these offsets are not strictly required,
since they can be computed from the values of numXDivs,
numYDivs & numColors, however they are called in tight
loops so having them computed once is a beneficial.
This change also removed the unused patch_equals function
from aapt's Image.cpp.
Change-Id: I3b9ac8ae5c05510d41377cae4dff1c69b40c2531
BackupDataReader / BackupDataWriter were implicitly assuming that when
instantiated, the underlying fd was positioned at start-of-file. If one
tried to e.g. open an existing data stream to append further data to it,
things might randomly fail (at read time, possibly when consuming the
stream later) due to incorrect alignment of the data entities: the
appending writer would assume that no padding was needed to achieve
correct alignment, and this might easily be false.
Now the underlying native reader/writer helpers recognize the true
position within the file when constructed, and as a result it's now
safe to e.g. construct a BackupDataOutput for an existing file and
then append to it.
Change-Id: If0484921e687852f923a4b4efabff573a6c16981
Fixed casting int to pointer in logging code.
Previously ints where printed as pointers and
the %p format specifier was used for convenience
to get hex output. This change uses %x and also
gets rid of the casts.
Change-Id: Ia2539769d245f50c0f3884119f80682defe69d61