Commit Graph

907 Commits

Author SHA1 Message Date
Ian Pedowitz
a326dfb1e5 Merge "Revert "Revert "Android Q is API 29""" into qt-dev 2019-05-15 16:28:54 +00: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
TreeHugger Robot
cbe933a40f Merge "DO NOT MERGE: Fixed broken aapt2 tests" into qt-dev 2019-05-07 17:28:17 +00: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
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
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
743266643a Merge "Add build number to aapt2 version" into qt-dev 2019-04-18 19:04:40 +00:00
TreeHugger Robot
9c88c1e93e Merge "Add odm and oem policies" into qt-dev 2019-04-18 01:39:51 +00: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
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
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
Fabien Sanglard
362da826af AAPT2: Add missing description for dump command
Test: None
Bug: None
Change-Id: Id9d6a38ad292dc2647bdb4ad9f7a0015120fa776
2019-03-14 11:39:39 -07:00
Fabien Sanglard
5e904c3d01 AAPT2: Delete dead code
Test: None
Bug: None
Change-Id: Ie8e32e47883ce5e4014e9e902c22aed68af450c4
2019-03-13 15:09:46 -07:00
Ryan Mitchell
62b68341e8 Compile all files in res/xml as xml
AAPT(1) compiled all files in res/xml as xml. Continue to do the same to
prevent regressions.

Bug: 122321161
Test: manual
Change-Id: I99c80da6d304c13ce911cd5258fd561f3c9e91b4
2019-03-11 13:28:02 -07:00
Ryan Mitchell
0f32675909 Do not convert whitespace chars above max char to regular space
Using isspace and iswspace on characters above the maximum char value is
undefined. This change makes aapt2 use isspace like aapt and only trims
whitespace characters at or below the maximum char value like aapt2.

Bug: 121017795
Test: aapt2_tests
Change-Id: I015e4b77f0ff53e409e880fcf9ae104ba3444d1a
2019-03-11 11:00:25 -07:00
TreeHugger Robot
b496d6150c Merge "Add --trace_folder to aapt2" 2019-03-07 16:40:03 +00:00
TreeHugger Robot
835d528dba Merge "Make sure Proguard keeps zygote preload class." 2019-03-07 13:56:21 +00:00
Ryan Mitchell
1d358ff5bb Fix aapt2 whitespace diffs from aapt(1)
CDATA blocks were being processed differently in aapt2 so this change
fixes aapt2 to not treat cdata blocks differently and still trime
whitespace.

Also, aapt did not process escapes when compiling xml files. This
change removes over-processing of xml text nodes.

All test strings are what aapt(1) would output.

Test: aapt2_tests
Bug: 124470332
Change-Id: I90ee0c1e5e9208f8a5c60cee93e3ba02712c9b2c
2019-03-06 15:06:49 -08:00
Martijn Coenen
6c83e0c5c9 Make sure Proguard keeps zygote preload class.
Bug: 127262679
Test: atest ProguardRulesTest
Change-Id: Ib082404e08d98b25fcecbf680afb4af37fe2786b
2019-03-06 15:06:17 +01:00
Fabien Sanglard
2d34e76dac Add --trace_folder to aapt2
Add a tracing API and instrument key functions in order to profile
aapt2 bottleneck. The API allows to generate systrace fragment files.

Impact on performance is neglibible with each Trace requiring less
than 1us and the final Flush operation at the end of a command
requiring around 40us.

Bug: None
Test: None
Change-Id: I51b564d3694e9384679f43b878b32295527dddf6
2019-03-05 15:09:27 -08:00
Ryan Mitchell
1b05ef9cc1 Merge "Sort inputs to compile and link" 2019-02-26 21:48:08 +00:00
Ryan Mitchell
f22ed8dc0e Sort inputs to compile and link
This change sorts the input files of compile and link and also traverses
directories in sorted order in FileCollection::Create. This change
attempts to fix non-determinism issues with aapt2.

Bug: 122518436
Test: builds
Change-Id: I615b8d7f1117e3850366760f16672f0cf5b02070
2019-02-26 17:40:30 +00:00
Ryan Mitchell
a55dc2ed6b Fix long paths on Windows
util::mkdirs iteratively creates each directory of a specified path. For
windows, Calling mkdir on only the drive letter or on the extended path
prefix (\?\\) will result in an error. Start after the long path prefix
and the drive letter.

This also changes AAPT2 to use AssetMaanager2 to retrieve symbols from
the symbol table. AssetManager2's zip library uses _wopen to open
windows files.

Bug:123251200
Test: aapt2_tests.exe
Change-Id: I26169d83b22d441485de3c49d63a6c4ed710e292
2019-02-20 09:46:00 -08:00
Izabela Orlowska
a1dea5f915 Merge "AAPT2: allow regexes for extensions to not compress" 2019-02-20 12:55:58 +00:00
Izabela Orlowska
0faba5fdfa AAPT2: allow regexes for extensions to not compress
Change-Id: I09d2ad1d1466643ca7628c6480224e16b9002ee5
Fixes: 67575899
Test: added + manual
2019-02-20 10:36:43 +00:00
Sasha Smundak
2f2e353f79 Merge "Convert Android.mk file to Android.bp" am: a81d64e940 am: efa1d26538
am: 8e0d9d8473

Change-Id: Ic6d75ff8e072f9f3eb6ca472bea0122ac220075a
2019-02-19 10:57:08 -08:00
Ryan Mitchell
975c6e2d26 Merge "Fix seg faul when parsing invalid <plurals>" 2019-02-19 18:09:56 +00:00
TreeHugger Robot
03f311cb75 Merge "Revert "Fix loaded apk string pool order"" 2019-02-16 00:46:04 +00:00
Ryan Mitchell
2f9077dfbb Fix seg faul when parsing invalid <plurals>
If the inner element of a <plurals> tag fails to parse, aapt2 will seg
fault. Don't do that.

Bug: 123423125
Test: manual
Change-Id: Iff39fa84073da62d85279683ac3d03b7309bc5e3
2019-02-15 16:04:37 -08:00
TreeHugger Robot
6d9fc1c8de Merge "Prevent AAPT2 from versioning <set> tags" 2019-02-15 23:26:25 +00:00
TreeHugger Robot
ed6c556145 Merge "Do not derive source from binary APK" 2019-02-15 22:57:17 +00:00