There was an inconsistency in the indexing when removing attributes
in layouts. Now we account for that shift that happens when you delete
an attribute.
Bug:18707321
Change-Id: I656eee3fb614168fa8ceeff379e8594708961dad
Outside of a feature-group, the legacy uses-feature tag
has a boolean required flag that should be emitted in
dump badging.
Bug:17790999
Change-Id: I43023af00e9c9ed4bc35795c3a983fc719bf9b7a
Private attributes are typically placed after public
attributes in the resource table. Each time a new version
of the Android framework is released, new public attributes
take the place of the private attributes, and the private
attributes are shifted after the new public ones.
This means that any apps built against the newer SDK
may inadvertently be using private attributes on older
devices.
This change moves all private attributes to a completely
different type ID, so there will never be collisions across
versions.
These private attributes are automatically moved to a synthesized
type only for the system resources.
Bug:18263655
Change-Id: I7a850512953fadcc9f3524d509cea30249782db8
The --preferred-density flag knows how to handle missing resources of
specific densities. Using -c with a density leads to missing resources.
Change-Id: I2251d842f48c08ed083663bb7ed608e14c4983c8
It was complicated to get the tool building on Windows, Linux,
and OSX with C++11 support.
OSX uses Clang to build C++11 binaries, which requires the libc++
standard library. Since most of the dependencies of this program
are built against libstdc++, this was difficult to resolve.
Now we build without C++11 support.
Change-Id: I4e537c113734508a8f480a1c402ed237de4f0e60
- char16_t is a distinct type, so stay consistent
with it throughout the code base.
- char16_t is defined as minimum size of 16 bits.
Since we mmap and cast data structures onto raw memory,
we need a precise definition (uint16_t), so we cast between
that (and static_assert that they are the same size).
Change-Id: I869c32637543bbcfb39d2643e7d9df10d33acd3c
- Output whether an app claims to be a game (android:isGame)
- Output android:banner if it is specified at the application level.
Change-Id: I7118b524f62cdfc4effeef21b32b3cdd814d9bfa
Calling String8::getLeaf() will assume the system's file path separator,
however the source string was already converted to a unix path.
getLeaf() would therefore not find any occurence of '\' and would
return the full path.
Bug:18036805
Change-Id: Ic2bfac0cc553406740204a296327e266b05c0eff
- Change the format of mnc/mcc when printing a resource-qualifier
formatted string from a Configuration object.
- Correctly bump the SDK to 21 when using anydpi in a resource qualifier.
Change-Id: I3c31e344dc5384d45398d6e9f264a073abab65d1
When crunching png, we used to spawn a separate aapt process from java
which is slow and resource intensive.
Introduced a daemon mode to appt which when invoked with -m parameter
will listen from commands on stdin and give report of command execution
on stdout.
One one command is supported so far :
s f1 f2
This command perform a single png crunch, f1 pointing to the input
png file to crunch, and f2 pointing to the path for the resulting
crunced file.
Expected output from the command is "Done" or "Error".
Change-Id: Iaf1d865e8d5ee5d36abe39dea6443715865a98d3
Bug: 14416410
The new mingw-w64 toolchain x86_64-w64-mingw32-4.8 no longer
declares _mkdir in io.h.
Change-Id: I624b52d2f35db54a7f28df09f997fc883b0f0557
AAPT keeps around a few pieces of state that are disjoint, so
simply adding to a collection won't add the resource to the final
flattened output. Instead, we create the resource from the top
and then copy over the values into the newly created resource.
Bug:17647890
Change-Id: I214263e84c18f9370c6e6a5aa53aa2d833fc842d
XML files like layouts are now scanned and checked
for v21 attributes. If those kinds of attributes
are found, then we remove them in the original
version and synthesize a new xml file under the
v21 configuration.
Bug:17520380
Change-Id: Icf984cb96134180a2e35349c1dbf2cef9a8f0bda
AAPT has traditionally assigned resource IDs to public attributes,
and then followed those public definitions with private attributes.
--- PUBLIC ---
| 0x01010234 | attr/color
| 0x01010235 | attr/background
--- PRIVATE ---
| 0x01010236 | attr/secret
| 0x01010237 | attr/shhh
Each release, when attributes are added, they take the place of the private
attributes and the private attributes are shifted down again.
--- PUBLIC ---
| 0x01010234 | attr/color
| 0x01010235 | attr/background
| 0x01010236 | attr/shinyNewAttr
| 0x01010237 | attr/highlyValuedFeature
--- PRIVATE ---
| 0x01010238 | attr/secret
| 0x01010239 | attr/shhh
Platform code may look for private attributes set in a theme. If an app
compiled against a newer version of the platform uses a new public
attribute that happens to have the same ID as the private attribute
the older platform is expecting, then the behavior is undefined.
We get around this by detecting any newly defined attributes (in L),
copy the resource into a -v21 qualified resource, and delete the
attribute from the original resource. This ensures that older platforms
don't see the new attribute, but when running on L+ platforms, the
attribute will be respected.
We still need to address this problem in the platform moving forward,
as this will only help us in the transition from pre L to L.
Bug:17520380
Change-Id: Ia2a985798b50006c21c7c3431d30d9598f27cd91
We never checked the return value when adding a nested
symbol, which would be NULL if the symbol name was invalid.
External bug: https://code.google.com/p/android/issues/detail?id=75876
Change-Id: I5211f4d4b87897d52f2b6e5907113d31930bb92d
The versionCode of theframework resources that an app is built against
gets stamped inside an app's AndroidManifest.xml in the <manifest>
tag as "platformBuildVersionCode" and "platformBuildVersionName"
attributes.
Bug:17207635
Change-Id: Id573c3dffcbca38eec9c0eb3e89f4a547e3361d3
This is meant to be used with scaleable vector
drawables, and are chosen as the best match unless
there is a configuration that matches the density
requested exactly.
Bug:17007265
Change-Id: Ic3288d0236fe0bff20bb1599aba2582c25b0db32
Previously, when filtering resources from an APK using
-c option, if one qualifier matched, we would keep the resource.
However, in the case of something like
-c fr-FR,sw360dp
and with a resource in the APK like so
drawable-fr-FR-sw600dp-v13
we would want this resource to be excluded, as it does not
match the sw360dp qualifier (must be less than or equal to it).
This CL fixed the behavior of the filter to require that all
defined qualifier axis be matched.
Bug:17142358
Change-Id: Ie48f3d516a0e610abc7ba8a7ced4eb3ab52534d4
Mipmaps are never filtered, and so they will always
end up in the base APK. Make sure they get omitted from
any split.
Change-Id: Id24b082bc9bd2d3f031a58bd0de4d30b4f0de7e0
Some resource directories may be the same even though
their names are different. For instance, the
"smallest width" qualifier was added in API 13,
so the resource directory "values-sw600dp" and
"values-sw600dp-v13" are the same and cause
a conflict. The error reports that this might be the
case.
Change-Id: Ia35f1d670edd48265b3a7fe3d55656128421f612
Teams are constantly confused over which version of aapt
they are running. Include the build number from the
Android build system in the binary. Can be retrieved by executing
'aapt version'.
Change-Id: I9165c7d01f977344e143c2cb4dd963310ab28b72
Teams are constantly confused over which version of aapt
they are running. Include the build number from the
Android build system in the binary. Can be retrieved by executing
'aapt version'.
Change-Id: Ie4692fb160c7cbe720a8e76b73e435170214fe0e
When android:multiArch="true" in the <application> tag,
aapt dump badging should only output the 64-bit architecture
under the 'native-code' entry.
Other architectures will be emitted under the 'alt-native-code'
entry.
Bug:17061929
Change-Id: I8310b2388b06a2ed571e5e121e4989403082ba68