summaryrefslogtreecommitdiff
path: root/tools/aapt2/unflatten/BinaryResourceParser.cpp
AgeCommit message (Collapse)Author
2017-10-04AAPT2: Move format related files under same directoryAdam Lesinski
Test: make aapt2_tests Change-Id: Id72cdfc12ba3add294048e60c55f2461344464bf
2017-09-28AAPT2: Cleanup Visitors for XML and ValuesAdam Lesinski
Test: make aapt2_tests Change-Id: Ib61f64c155a380115610edeaf2d65e60258a2426
2017-08-23AAPT2: Define intermediate compiled XML protoAdam Lesinski
This proto format is meant to encapsulate more information that is specific to Android and allows for easier validation and manipulation across tools. Test: make aapt2_tests Change-Id: I13bc34a460671fc0a36246be0d287a3d37d244d6
2017-07-31AAPT2: Ensure style strings are always first in StringPoolAdam Lesinski
Move the styled strings to a separate section of the StringPool so that sorting can never mess up the order of Styles. Bug: 63570514 Test: make aapt2_tests Change-Id: Id2ce1355b92be1bb31ce0daa7e54ae9b5b6c2ffe
2017-04-28AAPT2: binary parser should be more lenient with filesAdam Lesinski
Some APKs have file references that reference files that don't exist. For now, just be lenient and ignore the files themselves. Keep the actual reference until such a time as general resource stripping is implemented. Bug: 37749644 Test: manual Change-Id: I773685acf41212405b71b064d64045fb4556dcfc
2017-04-21AAPT2: Make BinaryResourceParser more lenientAdam Lesinski
Trailing data after the main RES_TABLE_TYPE should be logged but not cause an error. Bug: 36945869 Test: (aapt2 dump apk/attached/in/bug.apk) Change-Id: I784406a680b79630798fdb4b7ca81f9d1f2b96d1
2017-04-10AAPT2: Share split functionality between link and optimizeAdam Lesinski
Generating splits should be possible to do from the optimize command. This means that a lot of infrastructure around split APKs can be shared by both the optimize and link phase. Bug: 35925830 Change-Id: Ia88b9e4bff300a56353b2f7a4a2547c8eb43a299 Test: manual
2017-03-29AAPT2: Parse an ID encoded as a mapAdam Lesinski
ID types should not be encoded as a map. AAPT and AAPT2 emit IDs as boolean types. Some apps exist that for some reason have their ID types encoded as empty maps. This is the case only for the auto generated IDs from enum values in <attr> tags. Allow IDs as maps and ignore their content when processing an APK for optimizing. Also fixes an issue with expected size of the ResTable_package struct. Bug: 35861796 Test: tested against the APK in b/35861796 Change-Id: I29a19cd9777bb10bed6766cd42e35e50e098797b
2017-03-03AAPT2: Fix parsing ResTable_typeAdam Lesinski
ResTable_type's size changes due to it containing ResTable_config. Make sure we check for the minimum size required to read it. Bug: 35861796 Test: Manual (don't have an integration test harness setup yet) Change-Id: Ifb0cd1d732625f59835c8ed0449adb78129636de
2017-02-22AAPT2: Few tweaks to get shared-libraries workingAdam Lesinski
Test: manual (building shared support library demo) Change-Id: I4730645aa92ba1893baf67ffe35fbd4aac0f8e46
2017-02-22AAPT2: Shared library supportAdam Lesinski
Test: make aapt2_tests Change-Id: I98dddf1367e6c0ac425bb20be46e6ff05f4f2f45
2017-02-02Add a method LoadedApk::WriteToArchive.Pierre Lecesne
Test: Manually. Change-Id: I61717204e58ca2bbfba9a52c7aecf27882a853f8
2016-10-26AAPT2: Rename to match new styleAdam Lesinski
Use Google3 naming style to match new projects' and open source google projects' style. Preferred to do this in a massive CL so as to avoid style inconsistencies that plague legacy code bases. This is a relatively NEW code base, may as well keep it up to date. Test: name/style refactor - existing tests pass Change-Id: Ie80ecb78d46ec53efdfca2336bb57d96cbb7fb87
2016-10-21AAPT2: Ensure string pool ordering is compactAdam Lesinski
Keep styledstrings at the beginning of the StringPool to reduce the padding in the StyledString array. Bug:32336940 Test: manual Change-Id: Iec820c21a54daac40ecc3b2f87517a0f1efc9d3d
2016-07-13AAPT2: Remove usage of u16stringAdam Lesinski
For legacy reasons, we kept around the use of UTF-16 internally in AAPT2. We don't need this and this CL removes all instances of std::u16string and StringPiece16. The only places still needed are when interacting with the ResTable APIs that only operate in UTF16. Change-Id: I492475b84bb9014fa13bf992cff447ee7a5fe588
2016-06-29AAPT2: Improve diff commandAdam Lesinski
Change-Id: Ia1e2f8482c7192ef50126b61bed7975297332767
2016-05-03Fix google-explicit-constructor warnings.Chih-Hung Hsieh
Bug: 28341362 Change-Id: I080090d50f1a368a4e7c1a0732297bb6a295e34f
2016-04-06AAPT2: Enable windows build and make sure it buildsAdam Lesinski
Mingw32 4.8 is kind of picky with macros and some complicated template stuff. Luckily there was another way to represent the SFINAE code that works on all platforms. Yay! Change-Id: Idc2e38f47bfdc57b394550bfa0f53cc0b825df25
2016-02-12AAPT2: Introduce notion of 'product' to ResourceTableAdam Lesinski
This allows us to preserve the various product definitions during the compile phase, and allows us to select the product in the link phase. This allows compiled files to remain product-independent, so that they do not need to be recompiled when switching targets. Bug:25958912 Change-Id: Iaa7eed25c834b67a39cdc9be43613e8b5ab6cdd7
2016-02-09AAPT2: Switch to protobuf for intermediate formatAdam Lesinski
Without needing to conform to the runtime data format, it is much easier to add new features such as debugging symbols and carrying over product data to link time. This also simplifies the runtime format parser and serializer, which will change much less frequently than the protobuf intermediate format. Change-Id: I209787bbf087db0a58a534cb8511c51d21133e00
2015-12-17AAPT2: Fix references to private parentAdam Lesinski
Change-Id: Id4697551b6c8cb6167f562de593006ae3c6158c0
2015-12-10AAPT2: Fix overlay supportAdam Lesinski
Supports the <add-resource> tag and mimics old AAPT behavior of not allowing new resources defined unless <add-resource> was used or --auto-add-overlay was specified. Change-Id: I9b461137357617ade37fd7045b418b8e6450b9c4
2015-12-08Track rename of base/ to android-base/.Elliott Hughes
Change-Id: If08a94025fc12433f7e248b7787cee3c14843097
2015-11-23AAPT2: Record source/comments for compound values' childrenAdam Lesinski
Values like styles or arrays have children which need to have their source and comments preserved. Change-Id: I6fc713ba36627e6d66c7930b4080cc1403bac207
2015-11-23AAPT2: Verify min/max attr fieldsAdam Lesinski
Integers are now checked to see if they fall in the range of min/max for the attribute they are assigned. Change-Id: I42c435b15fd3f0bd23691c83efccce4ad5973276
2015-11-19AAPT2: Fail compiling when private symbols are referencedAdam Lesinski
Also moved some XML specific stuff into its own directory, and refactored ReferenceLinker a bit. Change-Id: I912247a82023c1bbf72dc191fbdaf62858cbec0c
2015-11-16AAPT2: Minor fixes to SymbolTable and diagnostic outputAdam Lesinski
The SymbolTable lookup relied on the configuration, which we NEVER want. Now we rely solely on the symbols defined in the ResTable and no specific configuration or value of that symbol. Also added some better source logging. Change-Id: I983855c283493e924b2e92a9fd8e4cb841769349
2015-11-02AAPT2: Add support for comments in R.javaAdam Lesinski
Change-Id: Iaa5f3b75bf7de9dbf458fa5c452f7312989f4c4f
2015-10-30AAPT2: Support generating Manifest.javaAdam Lesinski
This includes comments from AndroidManifest.xml. Change-Id: I412d9ecb12bad20a49a683d6b3bea4a0be1235ae
2015-10-22AAPT2: Move comments and source into ValueAdam Lesinski
Values are closely related to where they were defined, so this information should live inside the Value. This also enables comments to be attached to nested Values. Change-Id: Ic7481b5a5f26d0ef248d638e2e29252f88154581
2015-10-22AAPT2: Process <java-symbols> and private symbol packageAdam Lesinski
Need to introduce the idea of multiple levels of visibility to support <java-symbol>. Public, Private, Undefined. Public means it is accessible from outside and requires an ID assigned. Private means that we explicitly want this to be a symbol (show up in R.java), but not visible to other packages. No ID required. Undefined is any normal resource. When --private-symbols is specified in the link phase, these resources will not show up in R.java. Change-Id: Icba89221e08e685dee7683786aa7112baf28c856
2015-10-16Filter products during compile phaseAdam Lesinski
Unfortunately there is no good way to deal with products in the link phase. Products are like preprocessor defines in that they are processed early and change the composition of the compiled unit. Change-Id: I6d5e15ef60d29df8e83e059ba857c09333993779
2015-10-16AAPT2: Separate out the various stepsAdam Lesinski
An early refactor. Some ideas became clearer as development continued. Now the various phases are much clearer and more easily reusable. Also added a ton of tests! Change-Id: Ic8f0a70c8222370352e63533b329c40457c0903e