Commit Graph

927 Commits

Author SHA1 Message Date
Ryan Mitchell
ac55e41f24 Fix memory leak in aapt2
Fix a memory leak in Main.cpp.

Bug: 141312058
Test: m -j aapt2 SANITIZE_TARGET=address
Change-Id: I54b61792ab75e2f59298dd38168653e496c84bff
2019-09-25 16:26:29 +00:00
Steven Moreland
2700afda04 aapt2: disable leak detection
When building with SANATIZE_HOST=address and ASAN_OPTIONS="" in order to
test that leaks are removed from AIDL, was hitting leaks here.
Explicitly setting ASAN_OPTIONS here so that we can detect leaks in
other host tools.

Bug: 141312058
Test: AIDL's runtests_asan.sh
Change-Id: Ibc599ab75bbf63eab1c7747d17952390a7967e87
2019-09-19 18:18:23 +00:00
Elliott Hughes
78de4f999d Move off ZipString and over to std::string/std::string_view as appropriate.
Bug: http://b/129068177
Test: treehugger
Change-Id: Ib46761d89772d3a3c655a39df573fd305c117d19
2019-06-17 16:47:58 +00:00
Ian Pedowitz
563abce4ed Merge "Revert "Revert "Android Q is API 29""" into qt-dev
am: a326dfb1e5

Change-Id: I0674668835cd5a281e8a01c4b5bdb870595a8305
2019-05-15 13:36:05 -07:00
Ian Pedowitz
a326dfb1e5 Merge "Revert "Revert "Android Q is API 29""" into qt-dev 2019-05-15 16:28:54 +00:00
Elliott Hughes
78e68ceb2b Merge "Don't explicitly specify no prefix/suffix." am: 480d18c472
am: d47c87a2e6

Change-Id: I7cc6d962ec602c844ad9e7f6179260e247b04dc8
2019-05-13 11:22:04 -07:00
Ian Pedowitz
1912a57900 Revert "Revert "Android Q is API 29""
This reverts commit 60c71cee6e.

Reason for revert: Rolling forward for Q-Finalization

Bug: 131429032
Bug: 129975435
Change-Id: Idd812d93b767d8a672b9ada58c8bcc2441395847
2019-05-12 19:44:42 +00:00
Elliott Hughes
65c8b86b3f Don't explicitly specify no prefix/suffix.
Bug: http://b/129068177
Test: treehugger
Change-Id: Ica29efa3c3e49f556157cb0f82fdadef91aadba8
2019-05-11 00:13:09 +00:00
Elliott Hughes
f31f126ed8 Don't explicitly specify no prefix/suffix.
Bug: http://b/129068177
Test: treehugger
Change-Id: I987c88c17b7d1fd01129545bdbd4178de446188c
2019-05-10 17:02:14 -07:00
Ryan Mitchell
bfdebbbd3d Merge "DO NOT MERGE: Fixed broken aapt2 tests" into qt-dev
am: cbe933a40f

Change-Id: Ic0da145919936b8427ba9c6504606f1708832631
2019-05-07 10:48:07 -07:00
TreeHugger Robot
cbe933a40f Merge "DO NOT MERGE: Fixed broken aapt2 tests" into qt-dev 2019-05-07 17:28:17 +00:00
Ryan Mitchell
a5cfb6cf9a Merge "Build aapt2 statically on windows" into qt-dev
am: 274a7b2975

Change-Id: I6684ea4e1d1f2e44059da8ea3b3cec7b82987bff
2019-05-06 17:59:08 -07:00
Ryan Mitchell
ac3bfcfc2a DO NOT MERGE: Fixed broken aapt2 tests
Some tests starting failing when
b435101ec8 was merged. It seems on qt-dev
aapt2_host_unit_tests does not run while it does on master.

Bug: 131762014
Bug: 129146717
Test: aapt2_tests
Change-Id: I701b275989c908acb78190be0930785712cb5686
2019-05-06 23:47:09 +00:00
Ryan Mitchell
319fc02cb8 Build aapt2 statically on windows
Prebuilt script is no longer updating libwinpthread-1.dll. Link the
windows executable statically so aapt2 will no longer require the
dependency on the dll.

Bug: 131883685
Test: manual test of aapt2.exe on windows without libwinpthread-1.dll
Change-Id: If78a8ec3030003862c18e3967e4d8333fde7928a
2019-05-06 19:07:58 +00:00
Ian Pedowitz
85ff9dacc5 Merge "Revert "RESTRICT AUTOMERGE Android Q is API 29"" into qt-dev
am: 40a8e99740

Change-Id: I1e2472a230baae25c2abe070a0ec75b9a8319c06
2019-05-02 14:48:57 -07:00
Ian Pedowitz
a17eabdc62 Merge changes from topic "QT-SDK-Finalization" into qt-dev
am: 917936172f

Change-Id: Ia7d0a4971a702966968abb59685dd1a13dff03ec
2019-05-02 14:14:57 -07:00
Ian Pedowitz
60c71cee6e Revert "RESTRICT AUTOMERGE Android Q is API 29"
This reverts commit 8a3d1f96e1.

Reason for revert: QT SDK Finalization. Will be merged again on/after May 13th

Bug: 131429032
Bug: 129975435
Change-Id: I7a48ef6a057a97ebd9903b7e934a7d95ec97f00e
2019-05-02 00:55:51 +00:00
Suprabh Shukla
8a3d1f96e1 RESTRICT AUTOMERGE Android Q is API 29
Time may be eternal, Captain, but our patience is not. It's time to put
an end to your trek through the stars.

Test: Builds, boots.

Bug: 131429032
Bug: 129975435
Change-Id: Ia2367124afb642dac0fb365e4fa096db1c648adb
2019-05-01 14:11:18 -07:00
Ryan Mitchell
b505cc84bf Merge "Fix unknown resource type error message" into qt-dev
am: dd76b346d4

Change-Id: I1af6f93d990a940876dbb65fe7b158ff6a81a576
2019-04-30 11:05:27 -07:00
Ryan Mitchell
f07c58b97d Merge changes from topic "aapt2-attr" into qt-dev
am: ac919fcfcc

Change-Id: I97cffd87de2b8b9167af79fc07c83dfdf00dd10e
2019-04-30 06:06:31 -07:00
Ryan Mitchell
d2e25b9382 Merge "DO NOT MERGE: Do not allow overlaying of attributes with conflicting formats" into qt-dev
am: 515e9b3b63

Change-Id: Iebe16a02b6721e777af8afbd5bc395c47c510f0e
2019-04-29 11:59:54 -07:00
TreeHugger Robot
dd76b346d4 Merge "Fix unknown resource type error message" into qt-dev 2019-04-29 14:48:53 +00:00
Ryan Mitchell
ac919fcfcc Merge changes from topic "aapt2-attr" into qt-dev
* changes:
  Add formats for declare-styleable attributes
  No new attributes in declare-styleables when format is not provided
2019-04-27 01:54:11 +00:00
Ryan Mitchell
2e2c3b6220 Fix unknown resource type error message
Instead of printing the tag name, print the type name when the type was
unable to be recognized. The type name is initialized to the tag name
and changes when a type attribute is defined..

Bug: 37891551
Test: manual
Change-Id: I9b0e6a6f2d96a8c5af71fbca8e83c947a8e308bf
2019-04-26 01:16:52 -07:00
Ryan Mitchell
b435101ec8 DO NOT MERGE: Do not allow overlaying of attributes with conflicting formats
aapt(1) does not allow for attributes to be redefined with a different
format. Also, attributes declared with enums or flags are never allowed to be
redefined. This change will not allow attributes to be redefined with a
conflicting format in aapt2.

Bug: 129146717
Test: aapt2_tests
Change-Id: Idc43d6d689199ba2cdc672d009ede22eaa75a10c
2019-04-24 09:59:55 +00:00
Ryan Mitchell
acde95c3fc No new attributes in declare-styleables when format is not provided
AAPT does not allow for attributes declared in declare-styleables
that do not have a format to create new attribute resources. AAPT2
does and should not.

Bug: 131100106
Test: aapt2_tests
Change-Id: Id00884dc9ed939672df90f670a7915d4b6d232c1
2019-04-23 08:32:30 -07:00
Ryan Mitchell
2e6bb9db6a Merge "Add build number to aapt2 version" into qt-dev
am: 743266643a

Change-Id: I464776e52e7d5d010221beb42c046c497aafb02a
2019-04-18 12:39:15 -07:00
Ryan Mitchell
743266643a Merge "Add build number to aapt2 version" into qt-dev 2019-04-18 19:04:40 +00:00
Ryan Mitchell
8ea093e88d Merge "Add odm and oem policies" into qt-dev
am: 9c88c1e93e

Change-Id: I61a3f83f395f2befa4fc4b6e96a4cde962b29875
2019-04-17 18:59:01 -07:00
TreeHugger Robot
9c88c1e93e Merge "Add odm and oem policies" into qt-dev 2019-04-18 01:39:51 +00:00
Ryan Mitchell
3a60b9c4d2 master designated for R. Update MAX_PLATFORM_VERSION, etc.
Test: aapt2_tests
Bug: 128934651
Change-Id: I179f7b92dcf65e77f039e6cd42d91bf5b1461e35
Merged-In: I179f7b92dcf65e77f039e6cd42d91bf5b1461e35
2019-04-17 18:12:52 -07:00
Ryan Mitchell
ad5b4ba2a2 AAPT2: Update SDK development codename to Q
Test: aapt2_tests
Change-Id: I815e0bfc786660d6ad70897287fb5fb21023068c
Merged-In: I815e0bfc786660d6ad70897287fb5fb21023068c
2019-04-17 18:06:12 -07:00
Ryan Mitchell
939df096be Add odm and oem policies
This change adds parsing, encoding, and validating of odm and oem
overlayable policies to aapt2, libandroidfw, and idmap2.

Bug: 121033532
Test: aapt2_tests, idmap2_tests
Change-Id: Ifc0d4b6c9f9c37e06b2988abade69dbb277c50c2
2019-04-17 16:07:57 -07:00
Ryan Mitchell
34039b26f5 Add build number to aapt2 version
This changes adds the build id to the version printed by "aapt2
version". This change also adds a field to the ResourceTable proto that
specifies the fingerprints of tools used to build the table.

Bug: 123663089
Test: manual
Change-Id: Ifaf33c1e506b68e9f1d921fdbeddf36485e65790
2019-04-17 10:59:38 -07:00
Ryan Mitchell
acbf1c7668 Merge "Check value in dump before printing" into qt-dev
am: d8ec9971cb

Change-Id: I0cb6c1bec55e8490681e161100ef8522aebd91e3
2019-04-16 17:34:41 -07:00
Ryan Mitchell
0c0cedff00 Check value in dump before printing
For applications that remove the names of resources from the string
pool, check that the attribute has a name before attempting to print it.

Test: manual
Bug: 130553900
Change-Id: I05e5d59f01b2c02c8a024d06fd896074d6bf465b
2019-04-16 12:00:30 -07:00
Ryan Mitchell
48002f6313 qt-dev-plus-aosp designated for R. Update MAX_PLATFORM_VERSION, etc.
Test: aapt2_tests
Bug: 128934651
Change-Id: I179f7b92dcf65e77f039e6cd42d91bf5b1461e35
2019-04-11 14:29:25 -07:00
TreeHugger Robot
636f9ae0c2 Merge "Allow merging of resources with the same overlayable" into qt-dev 2019-04-08 21:06:32 +00:00
Ryan Mitchell
ced9a5c108 Allow merging of resources with the same overlayable
If a resource is redefined with the same overlayable name, actor, and
policies, do not error.

Bug: 128843658
Test: m -j Launcher3 && aapt2_tests
Change-Id: I2c79f7d9fa7ff16b38ec41cec7e9804d39b372d5
2019-04-05 10:44:16 -07:00
Chris Craik
335b565eb6 Support profileable application action
Fixes: 129358330
Test: make -j16 aapt2_run_host_unit_tests && cat out/target/product/walleye/obj/PACKAGING/aapt2_run_host_unit_tests_intermediates/result.xml | grep "failure message"
Change-Id: Id9ec59447a99a5f6e0bfe47c0b8ce3553bf751c7
2019-04-04 13:25:55 -07:00
TreeHugger Robot
73ad61f652 Merge "AAPT2: Delete dead code" 2019-04-02 00:13:19 +00:00
Mihai Niță
551a76e26e Merge "Fix aapt2 pseudo-translating donottranslate* files" 2019-04-01 18:04:15 +00:00
Mihai Nita
d1a6521cc3 Fix aapt2 pseudo-translating donottranslate* files
Bug: 126423638

Test: After building android doing this in the 'out' folder:
Test:
Test: ./soong/host/linux-x86/bin/aapt d --values resources \
Test:     ./target/product/sailfish/system/product/priv-app/SystemUIGoogle/SystemUIGoogle.apk \
Test:     | less
Test:
Test: search for `system_ui_aod_date_pattern` in the output, found this:
Test:           (string8) "[éééḾḾḾð one two]"
Test:           (string8) "<U+200F><U+202E>eeeMMMd<U+202C><U+200F>"
Test: (the en-XA and ar-XB pseudo-translated versions of the string)
Test:
Test: After the fix and rebuild the dump only finds the original English string ("eeeMMMd")
Test: Also flashed the image, switched to en-XA, and left the phone around for more than 24 hours.
Change-Id: I2fb7c5b5ee7d3d3200410593346682ed16559056
2019-03-29 17:15:18 -07:00
TreeHugger Robot
b8e80e0dc0 Merge "Fix aapt2 badging return codes" 2019-03-29 17:28:26 +00:00
Ryan Mitchell
28c88801e7 Fix aapt2 badging return codes
aapt2 was returning the inverse return code when duumping badging.

Bug: 129476626
Test: aapt2 dump badging [APK] && echo $?
Change-Id: Icd236e5fad3284c8bc4a0e2d7e9fb7cfb3262b6c
2019-03-28 11:28:54 -07:00
Ryan Mitchell
95d2c302d5 Merge "Compile all files in res/xml as xml" 2019-03-25 15:49:14 +00:00
Colin Cross
a8edeaa4ec Merge "Dist aapt2 protos" am: b602193169 am: 0783f2d300
am: 0fc50310f3

Change-Id: Ifd9668f3931ec4d276b79a6e5ece576860271de7
2019-03-20 17:59:14 -07:00
TreeHugger Robot
ade947448e Merge "AAPT2: Delete unused method parameter" 2019-03-20 18:33:06 +00:00
Fabien Sanglard
2369f5407a AAPT2: Delete unused method parameter
Bug: None
Test: None
Change-Id: Ib5d78df9c8e341d9d6559f90f33b1fbd5f711e99
2019-03-19 08:32:46 -07:00
Colin Cross
0b28a92440 Dist aapt2 protos
Create aapt2-protos.zip containing the aapt2 proto interface and
dist it for SDK builds.

Bug: 128878015
Test: m PRODUCT-sdk_phone_armv7-win_sdk sdk_repo dist
Change-Id: I13c774c8a2262464dcc4731c999497f6d0dc9095
2019-03-18 22:19:46 -07:00