summaryrefslogtreecommitdiff
path: root/tools/aapt/ResourceTable.cpp
AgeCommit message (Collapse)Author
2020-12-08Revert^2 "libandroidfw hardening for IncFs"Ryan Mitchell
55ef6167a2c235bd88c7216238b2001b46795b79 Change-Id: I02d4890d181655dfd0a14c188468db512559d27b Merged-In: I02d4890d181655dfd0a14c188468db512559d27b
2018-05-14Merge "For Win32, don't cast ssize_t while printing" am: aaf8d7aa2ePirama Arumuga Nainar
am: 466ada94fe Change-Id: I39b73406a41ecc5396c39648f8e05e8a88e7aaee
2018-05-11For Win32, don't cast ssize_t while printingPirama Arumuga Nainar
Bug: http://b/69933068 This is a partial revert of https://android-review.googlesource.com/c/platform/frameworks/base/+/109433 so we can use Clang for windows cross compilation. Clang does not allow a cast to 'signed size_t' and both Clang and current MinGW accept a ssize_t to the '%zd' format specifier. Test: m native-host, m native-host-cross with both MinGW and Clang Change-Id: I5366622b91be1433f6c533c55a9ae429b57c7a27
2018-02-09Prevent AAPT from versioning <animated-selector> tags.Nick Butcher
Bug: 69359529 Test: Manually tested with ag/3178054 Change-Id: I10ae4d96c2a31a0a7c363d7a9292ecdfd3bb526a
2017-10-16AAPT leave <gradient> alone for VDCztenghui
bug: 62421666 Test: Tested with changes for Gradient of VDC. Change-Id: I07b39721aeaaafd888416a0f71f6cbd5fce97732
2017-04-18Fix issue with unresolved IDs in adaptive iconsAdam Lesinski
Adaptive icons were versioned correctly, but skipped the compilation / resource ID assignment phase. This CL fixes the glitch. Bug: 34829129 Test: manual Change-Id: I93739a8b10fac53a048d95b330edf381684a807c
2017-03-28AAPT: Version <adaptive-icon> to v26Adam Lesinski
Bug: 35908647 Test: manual Change-Id: Ic8f43efe34385192fbab18675eb5898ed80912a5
2017-03-21disable versioning for objectAnimator to support path motionztenghui
bug:33527757 Test: replace the AAPT in local SDK, and make sure the propertyX/YName still works within ObjectAnimator. Change-Id: Ic9bb14cd228dcf7e4d250bd0f6cb5f0c31a14183
2017-03-07Disable versioning for pathInterpolator when no-version-vectors is on.ztenghui
Test: manually build demo app for support lib, and works! bug:33527757 Change-Id: I3badea18b2eb8cddea94f7e44f9129bb55ed9649
2017-02-08Merge "AAPT: Fix --feature-of to allow non-public symbol visibility"Adam Lesinski
2017-01-24AAPT: Fix --feature-of to allow non-public symbol visibilityAdam Lesinski
Test: manual Change-Id: Iada18b201c6463011002f96285a64c64565a6e1c
2017-01-24AAPT: Add --no-version-transitions flagYuichi Araki
Add a new flag to disable versioning of Transition related XMLs. Transition support library will use this to handle these XMLs on older API levels. Test: make libaapt_tests AaptTestAppOne Bug: 34427868 Change-Id: I66e81cca049e71ef6704177b2ca21c9cdeaff78f
2016-08-15AAPT: Handle gaps in resources when building splitsAdam Lesinski
Due to public ID assignment, gaps in resource type and entry IDs can occur. This can lead to null pointer dereferencing if not careful. This happened in ResourceTable::getDensityVaryingResources() which is called when building Splits. Bug:30879690 Change-Id: I588e4dcd2e042fccfcb2e87967b5cbd0d23b4497
2016-08-11Fix clang-tidy warnings in aapt and aapt2.Chih-Hung Hsieh
* Add explicit keyword to conversion constructors. * Add NOLINT(implicit) comments for implicit conversion constructors. Bug: 28341362 * Use const reference type for read-only parameters. Bug: 30407689 * Use const reference type to avoid unnecessary copy. Bug: 30413862 Test: build with WITH_TIDY=1 Change-Id: Id6d21961f313a1ad92b15a37fdaa5be9e8ab48e1
2016-08-03AAPT: Fix feature split generation of ID resourcesAdam Lesinski
ID resources that get generated on demand with the notation @+id/name were previously not given the appropriate type ID offset when being built as feature splits. This change declares an ID type ahead of time so that the type ID offset is applied before IDs can be generated. Bug:30607637 Change-Id: I122a9133cb01b35e9892103ec52fc228dc65bf1a
2016-07-18AAPT: Don't keep processing files that failed to be addedAdam Lesinski
AAPT will continue ahead without reporting an error if a file failed to be added to the ResourceTable. This would cause crashes later when the file was assumed to be present. Bug:30200166 Change-Id: Ieb2daf97ccf0345153b6f4598d130a38d108c937
2016-02-26AAPT: Allow duplicate attribute definitions if identicalAdam Lesinski
This allows libraries to coexist a bit easier, since a lot of them declare the same attribute. When used together they cause errors. Bug:27101533 Change-Id: I649cf17bc587c4814f849d5ac522daf74495adcf
2016-02-25Revert "AAPT: Allow duplicate attribute definitions if identical"Adam Lesinski
This reverts commit c25283b5e206ceae2aa6eb01877b79c3c1f0adfb. Change-Id: I2f42a4360fa53c4333494afe0178dcec56d62d8e
2016-02-22AAPT: Allow duplicate attribute definitions if identicalAdam Lesinski
This allows libraries to coexist a bit easier, since a lot of them declare the same attribute. When used together they cause errors. Bug:27101533 Change-Id: I10327251636392e810637a79e7c9aa514f3f07a6
2015-12-07Specify private resource package in Android.mkAdam Lesinski
Private resource package shouldn't be buried in some resource file. It can now be specified on the command line via the Android.mk file. Change-Id: I9e3cb0bf54830d6b021077af271913306c024701
2015-11-30Implement AAPT Bundle formatAdam Lesinski
AAPT will scan XML files looking for the <aapt:attr> XML tag. <!-- @layout/bundle.xml --> <ImageView xmlns:aapt="http://schemas.android.com/aapt"> <aapt:attr name="android:src"> <vector android:pathData="..." ...> </vector> </aapt:attr> </ImageView> The SINGLE child element of the <aapt:attr> tag is extracted into its own top level resource. It is given a generated name. The parent element of <aapt:attr> is then given the resource attribute that was assigned to the `name' attribute. The value is set to a reference to the generated resource. <!-- @layout/bundle.xml --> <ImageView android:src="@drawable/bundle_1.xml"> </ImageView> <!-- @layout/bundle_1.xml --> <vector android:pathData="..." ...> </vector> Bug:22627686 Change-Id: I8575fc4f739011402662fbf6b3db96df0012f598
2015-11-30Revert "Implement AAPT Bundle format"Adam Lesinski
This reverts commit 9d0f7d44d5cc5322415f52f7ce03cc37a478b350. Caused a build breakage when parsing some attributes. Change-Id: I89ca958b2f2e820d353648df8aadd90bbe8d8339
2015-11-24Implement AAPT Bundle formatAdam Lesinski
AAPT will scan XML files looking for the <aapt:attr> XML tag. <!-- @layout/bundle.xml --> <ImageView xmlns:aapt="http://schemas.android.com/aapt"> <aapt:attr name="android:src"> <vector android:pathData="..." ...> </vector> </aapt:attr> </ImageView> The SINGLE child element of the <aapt:attr> tag is extracted into its own top level resource. It is given a generated name. The parent element of <aapt:attr> is then given the resource attribute that was assigned to the `name' attribute. The value is set to a reference to the generated resource. <!-- @layout/bundle.xml --> <ImageView android:src="@drawable/bundle_1.xml"> </ImageView> <!-- @layout/bundle_1.xml --> <vector android:pathData="..." ...> </vector> Bug:22627686 Change-Id: I31bc96aae30d38bfd0b16508d0f585de5fd88a07
2015-08-14AAPT: Fix regression in resource versioningAdam Lesinski
With a set of resources with the following configurations: () (land) the regression caused any resources that needed to be versioned in configuration () to be lost. Bug:23038206 Change-Id: I2f1b0313fb780ac241e7aaa487cb37dfb79c36aa
2015-07-28AAPT: Fix resource versioningAdam Lesinski
Resource generation was greedy, so when an attribute with sdk level 21 was used in a resource with v1, and a different attribute with sdk level 21 was used in a resource with v11, a v21 resource would be synthesized, but it would contain the attribute from v1 instead of v11. This change fixes the issue, having the higher versioned resource take precedence. Bug:22793816 Change-Id: Ia687f56b0d9969e424111477d55d9804255b22e9
2015-06-02aapt: add option for stricter symbol generationAdrian Roos
Adds an option that prevents generating java symbols for string resources that don't have a default localization. Bug: 21537397 Change-Id: Ifafa942b24d5cdbed93651cde363e859be13d395
2015-04-21AAPT: Add flag to disable versioning of vector related XMLAdam Lesinski
AAPT automatically versions XML files according to the SDK level in which their attributes were introduced. Support libraries know how to handle resources built against newer SDKs, so offer the option to disable some of the automatic versioning, namely vectors. Bug:19336994 Change-Id: I9f9d0ae8f2a0c28404f82e27de416f80e38493c9
2015-04-09Merge "Re-enable -Wall and -Werror that were lost in a merge"Colin Cross
2015-04-08Re-enable -Wall and -Werror that were lost in a mergeColin Cross
-Wall and -Werror were lost during a merge when they were added to aaptCFLAGS instead of aaptCFlags. Fix the typo, and the warnings that crept in while it was disabled. Change-Id: Ib944b8d6149278e4f3861c1acac277bcd95cc7c2
2015-04-03Only Windows doesn't have %zd.Elliott Hughes
Change-Id: I0e4b0fdc61641c5ecb724fd096bd2315dcf8ed4a
2015-03-05resolved conflicts for merge of 701f9c2f to stage-aosp-masterDan Albert
Change-Id: I42e0411c0acef4b15137491ecaaed95d9b1cd0c1
2015-03-04Stop using namespace std.Dan Albert
The pattern of #include and using namespace std here fails to build with GCC. At first glance it's a GCC bug rather than libc++ doing something wrong. Regardless, it can be worked around by just specifying std:: where appropriate. Bug: 19606303 Change-Id: I5652682eae7ca7559cf2a9307909859013440781
2015-01-14am e488ce86: am 94e30215: Merge "AAPT: Handle all old unversioned attribute ↵Adam Lesinski
usage" into lmp-mr1-dev * commit 'e488ce8668538b45c586eba21f5bca288d749686': AAPT: Handle all old unversioned attribute usage
2015-01-14AAPT: Handle all old unversioned attribute usageAdam Lesinski
All references to attributes defined in pre-LOLLIPOP_MR1 SDK are moved to version qualified resource entries. Bug:18221682 Change-Id: Ifd739530ebcf99e6bc7ddb3f10bc5e05f0726e62
2014-12-16am 0f0e85a6: Merge "AAPT: attributes showing up after v21 attributes would ↵Adam Lesinski
be removed for pre-21 devices" into lmp-mr1-dev automerge: 465d123 * commit '465d123464eadf180b618164b2ed23702bca3d86': AAPT: attributes showing up after v21 attributes would be removed for pre-21 devices
2014-12-10AAPT: attributes showing up after v21 attributes would be removed for pre-21 ↵Adam Lesinski
devices 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
2014-12-05Merge commit '0953ab27' into manualmergeAdam Lesinski
Change-Id: I36dea45f7571096136ea7bda5e2680bd85a0df32
2014-12-03AAPT: Move private attrs to new type for frameworkAdam Lesinski
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
2014-11-11am 8aa93764: Merge "Fixing NULL pointer access causing segmentation fault in ↵Adam Lesinski
aapt" * commit '8aa93764ea025b1c20f96b366ae6efb17e4f2d67': Fixing NULL pointer access causing segmentation fault in aapt
2014-11-10Merge commit 'fa31eb2c' into manualmergeAdam Lesinski
Conflicts: tools/split-select/RuleGenerator_test.cpp Change-Id: I0d1261301d433f32e857cf1b0d75a861205f7625
2014-11-07Fixing NULL pointer access causing segmentation fault in aaptJörgen Ekström
In cases where resource packages are generated which does not have public resources for all resource types - NULL pointers sneaks into the mOrderedConfigs vector causing the aapt tool to crash. The solution in this fix simply ignores the NULL elements when later processing the sorted vector. The NULL elements are inserted during applyPublicEntryOrder function call Change-Id: I8b7135932e2d235018da2e2f7e09f0d22f1b2f59
2014-11-06split-select: Fix rules generated for anydpi densityAdam Lesinski
Change-Id: I9de569ca9a76eb22df4d0e178df847ba1c7d0b01
2014-11-05Merge commit 'fb96e54' into manualmergeAdam Lesinski
Conflicts: tools/aapt/Resource.cpp Change-Id: I4147c3550e9426f3429146eaeb16f10ba76b5b15
2014-11-03Add error checking to aapt for split generationAdam Lesinski
Change-Id: Ica627db6a671f6a6c35f98bfd9c03598ffe103ce
2014-11-03Fix issues that will be present in C++11Adam Lesinski
- 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
2014-10-20am d3969d92: am 6dfe03ae: am 73a8c596: am 3f8c7dec: Merge "AAPT: Fix path ↵Adam Lesinski
for final generated resources on Windows" into lmp-dev * commit 'd3969d927eef2f04ec097244c5f2bff5e7c0689e': AAPT: Fix path for final generated resources on Windows
2014-10-20am 3f8c7dec: Merge "AAPT: Fix path for final generated resources on Windows" ↵Adam Lesinski
into lmp-dev * commit '3f8c7dec6b3fd4ac7fc99fe4e41cd0fa1b97bcad': AAPT: Fix path for final generated resources on Windows
2014-10-20AAPT: Fix path for final generated resources on WindowsAdam Lesinski
Change-Id: Id11ac79b281b51747c73f90406ebd60023c54f92
2014-10-04am 85035d90: am b2b166a5: am 397001b2: am a80aba70: Merge "AAPT: Gate v21 ↵Adam Lesinski
resource synthesizing logging behind -v flag" into lmp-dev * commit '85035d90257beedd54641385674ce2dfb29ae241': AAPT: Gate v21 resource synthesizing logging behind -v flag
2014-10-03am a80aba70: Merge "AAPT: Gate v21 resource synthesizing logging behind -v ↵Adam Lesinski
flag" into lmp-dev * commit 'a80aba70728c2843df94474dbd7829dadb77855f': AAPT: Gate v21 resource synthesizing logging behind -v flag