Commit Graph

6253 Commits

Author SHA1 Message Date
Ryan Mitchell
ead275e19f Merge "AAPT2: Compile --zip flag" 2018-08-16 17:26:08 +00:00
Ryan Mitchell
5d2755129d AAPT2: Reformatted dump command invocations
Use with:
  aapt2 dump apc [apc]
  aapt2 dump configurations [apk]
  aapt2 dump strings [apk]
  aapt2 dump resources [apk]
  aapt2 dump xmlstrings [apk] --file [file]
  aapt2 dump xmltree [apk] --file [file]

Will add permissions and badging in a later commit.

Bug: 73351292
Test: Manual tests of the commands
Change-Id: I97eec01222af14053a98bd70255f1bfecd16b1c4
2018-08-14 15:56:29 -07:00
Ryan Mitchell
1a8a69075e Merge "AAPT2: Loosen loading apk format requirements" 2018-08-14 22:51:35 +00:00
Ryan Mitchell
f3649d6690 AAPT2: Compile --zip flag
Added a --zip flag similar to --dir that allows resources to be passed
into "aapt2 compile" using a zip file.

Also refactored Compile.cpp to be easier to mock and test in the future.

Bug: 74574557
Test: aapt2_tests
Change-Id: Idb90cb97e23a219525bdead38220cbf7bc6f3cab
2018-08-14 15:42:01 -07:00
Ryan Mitchell
dc8d0be1e2 Merge "AAPT2: Update SDK development codename to Q" 2018-08-14 18:20:57 +00:00
Ryan Mitchell
eef1b6cd4b Merge "AAPT2: Adaptive icon refactor" 2018-08-14 18:20:57 +00:00
Ryan Mitchell
eb9c9ac8b8 AAPT2: Update SDK development codename to Q
Test: aapt2_tests
Change-Id: I815e0bfc786660d6ad70897287fb5fb21023068c
2018-08-14 09:33:22 -07:00
TreeHugger Robot
f2c5ee5900 Merge "AAPT2: partial files contain only local resources" 2018-08-13 18:07:38 +00:00
Ryan Mitchell
70f797208c AAPT2: Adaptive icon refactor
Part of a refactor to specify sdk version for all <adaptive-icons> xml
resources.

Bug: 79676805
Test: build success
Change-Id: I1cf1109103722a9562eaf6bf2dcd68d0ef8757eb
2018-08-13 07:37:24 -07:00
Ryan Mitchell
83a37adfbb AAPT2: Loosen loading apk format requirements
The Android runtime and AAPT are more lenient of apk format, allowing
for duplicate enty, types, and configs. This change loosens the
ResourceTable's checks on resource uniqueness when apks are loaded; not
when ResourceTables are being created by aapt2.

Bug: 36051266
Test: Tested using apks in bug with allow_duplicates on and off
Change-Id: I9296417bf2dc53e1e891479a53679a0388210d50
2018-08-09 10:57:29 -07:00
Alex Light
5e11d609c6 Merge "Work around b/70221552" am: f06d3a9857 am: b2432b2ab3 am: 9cd6280f6b
am: 2810a9b852

Change-Id: Ib1d3ba042fba799f9061b74c0f78d77e830be1fd
2018-08-08 20:28:08 -07:00
Ryan Mitchell
792dbbb2ab Merge "AAPT2: Version code major flag" 2018-08-08 23:53:14 +00:00
Ryan Mitchell
d91a2df672 Merge "AAPT2: Do not overlay comments" 2018-08-08 23:48:37 +00:00
Alex Light
9cd6280f6b Merge "Work around b/70221552" am: f06d3a9857
am: b2432b2ab3

Change-Id: I07faa9adfd5e6589b9989be6056d994c5909408a
2018-08-08 14:57:25 -07:00
Alex Light
159799d7c9 Work around b/70221552
If one sets a sufficiently long OUT_DIR to build into the
//frameworks/base:framework-javastream-protos generate target will
fail due to trying to run a too-long command. This works around that
problem by making the command being run much smaller.

Test: Build
Bug: 70221552
Change-Id: I0134ccfc83469826d3ea8679e1c52b9b52c6d2e0
2018-08-08 09:52:51 -07:00
Ryan Mitchell
a9e316051b AAPT2: Do not overlay comments
Always take the original comment of a resource. Resources passed in
through regular file arguments and resources added using the -R and
--auto-add-overlay flags will keep the same comments when overlayed by
another resource.

This will allow R.java files to remain consistent across devices between
product overlays.

Bug: 70641212
Test: aapt2_tests
Change-Id: I4ed1037a8d42f7e77d85e5c2a8ee78051053831a
2018-07-31 16:11:49 -07:00
Ryan Mitchell
704090e02a AAPT2: Version code major flag
Adds flag --version-code-major that injects android:versionCodeMajor
into the manifest if none is present or when overriding.

Bug: 109883459
Test: aapt2_tests
Change-Id: I10b27abb8fa8a99a41976c42c4d684b99978b4f9
2018-07-31 22:06:24 +00:00
Mathew Inwood
a8ac749b40 Merge "Remove class2greylist from frameworks/base." am: 32979f03fe am: 1397d297f0 am: 8636f97bf0
am: bdb8a3b492

Change-Id: Id5df20e7353e7d199e92f7ea2eb4d3db8db1d383
2018-07-26 14:51:15 -07:00
Mathew Inwood
8636f97bf0 Merge "Remove class2greylist from frameworks/base." am: 32979f03fe
am: 1397d297f0

Change-Id: I50b72dab019a91d6d5a79d2b28079ef9e40b965d
2018-07-26 13:11:01 -07:00
Mathew Inwood
1397d297f0 Merge "Remove class2greylist from frameworks/base."
am: 32979f03fe

Change-Id: I72f8797be98fe75806535da7b9f277ae68db8d57
2018-07-26 11:55:02 -07:00
Mathew Inwood
f364aedecb Remove class2greylist from frameworks/base.
It's moving to a new home under art/tools, since it is needed by
branches which don't include frameworks/base.

Bug: 110868826
Test: Build master-art branch
Change-Id: Ice8324db52ae1e7e2ac6734e45874a66de935c9a
2018-07-26 15:57:05 +01:00
Mathew Inwood
2b2b6a1698 Merge "Update annotation name in class2greylist." am: 6c32f5d18e am: 7393f85a6e am: d8058375f0
am: cae7c2e953

Change-Id: Iecc746cb8ec5144fc613af2a761c78c604486e3c
2018-07-25 05:26:41 -07:00
Mathew Inwood
d8058375f0 Merge "Update annotation name in class2greylist." am: 6c32f5d18e
am: 7393f85a6e

Change-Id: I0fd8a3ee7d3b1deca76c989328a76c06274b736b
2018-07-25 05:09:10 -07:00
Mathew Inwood
7393f85a6e Merge "Update annotation name in class2greylist."
am: 6c32f5d18e

Change-Id: I1a1f79a7a95814e37d337f1bb6bd10aa545cfaf9
2018-07-25 04:54:37 -07:00
Izabela Orlowska
f67d486e58 AAPT2: partial files contain only local resources
When writing a partial R file for the compiled file, only include
resources defined locally - meaning those without a package. Do not
write resources from other packages (e.g. "android").

Test: manual
Bug: 73927419
Change-Id: I84241352e643ca1f22a581e6847372e2a4278824
2018-07-25 09:50:15 +00:00
Mathew Inwood
738a23fbeb Update annotation name in class2greylist.
Annotation was added with name @UnsupportedAppUsage after Android API
council discussion.

Bug: 110868826
Test: m class2greylist
Change-Id: I63ad61e97c5e8fdebfcead9e4ee5b060a60f97c7
2018-07-25 09:45:04 +01:00
Izabela Orlowska
148cd8c0bc Merge "Revert "AAPT2: Automatic Static Library Namespacing."" 2018-07-24 11:33:46 +00:00
Xin Li
dc0144d0d7 Merge "Merge pi-dev-plus-aosp-without-vendor into stage-dr1-aosp-master" into stage-dr1-aosp-master 2018-07-23 20:53:48 +00:00
Mathew Inwood
ec9ecd41f2 Merge "Add new "class2greylist" tool." am: 7f0aa734a3 am: 812291cc46 am: 6119634dba
am: 7ca4fcec4a

Change-Id: I357b05418c4a699ed2100bb45c88043d7c3f1d74
2018-07-23 12:07:13 -07:00
Mathew Inwood
7ca4fcec4a Merge "Add new "class2greylist" tool." am: 7f0aa734a3 am: 812291cc46
am: 6119634dba

Change-Id: Ib7df082dcf104549f0a2b0dbb830a912b1313a17
2018-07-23 10:24:14 -07:00
Mathew Inwood
812291cc46 Merge "Add new "class2greylist" tool."
am: 7f0aa734a3

Change-Id: I7d53d60ea3537530a9e21e2de2f53eb764f7d0b5
2018-07-23 10:08:47 -07:00
Chris Warrington
58e2fbf169 Revert "AAPT2: Automatic Static Library Namespacing."
This reverts commit 481f027ddc.

Reason for revert: Not needed any more

Bug: 111543815
Test: existing unit and integration tests
Change-Id: I87b039192682636d81c2d33512495cb005c9504d
2018-07-23 17:23:25 +01:00
Mathew Inwood
6395690ec9 Add new "class2greylist" tool.
This extracts signatures of methods that have the @UsedByApps annotation
for generating the greylist. It will be integrated into the build to
replace many members on greylist.txt.

Test: $ atest class2greylisttest
Bug: 110868826
Change-Id: Ifaf5859b60076c051de6be5a912ef70734330ce7
2018-07-23 14:39:19 +01:00
Siyamed Sinir
cc8dc1d688 Merge "Remove requirement for kiss emoji should have gender" into pi-dev
am: 228bf4f320

Change-Id: I9168be274a5ced20d8ddbf1ef6475dfec82262ef
2018-07-20 17:31:54 -07:00
TreeHugger Robot
24a464a9be Merge "Only keep necessary constructor for custom view nodes" 2018-07-20 17:14:35 +00:00
TreeHugger Robot
41dcc4eac5 Merge "Only keep methods with correct signature for more types" 2018-07-20 16:36:24 +00:00
Ryan Mitchell
848585e1a4 Merge "AAPT2: Fix R.java for styleable in different package" 2018-07-20 15:18:05 +00:00
Jake Wharton
cc65b8dba6 Only keep necessary constructor for custom view nodes
This expands the Context+AttributeSet constructor specificity from only work on <view class=> nodes to <my.Type> nodes.

Bug: 37123156
Test: make aapt2_tests
Change-Id: I8fb950731383f86bee225333bda27baf5a7a34c5
2018-07-20 10:44:11 -04:00
Jake Wharton
98100c3828 Only keep methods with correct signature for more types
- For transition and pathMotion attributes the method must have Context and AttributeSet parameters.
- For actionViewClass and actionProviderClass attributes the constructor must have a single Context parameter.
- For Fragment's class or name attributes the constructor must have zero parameters.

Bug: 37123156
Test: make aapt2_tests
Change-Id: I34017abd182867ba95172835051d114cb2f3b3ac
2018-07-20 10:44:11 -04:00
Jake Wharton
b727f7ebf0 Merge "Add rule emissions for appComponentFactory" 2018-07-20 02:52:24 +00:00
Jake Wharton
6f10a213ec Merge "Add Application name to manifest test case" 2018-07-20 02:51:53 +00:00
Siyamed Sinir
0c37f926e6 Remove requirement for kiss emoji should have gender
Test: m fontchain_lint
Test: m
Test: Visual test on device after full build 

Bug: 110037531
Change-Id: Iac26c7c7c0e1a8a500a93f19d99831113529b201
(cherry picked from commit 77a1b14910)
2018-07-19 17:12:02 +00:00
Siyamed Sinir
345f3c0cc3 Merge "Remove requirement for kiss emoji should have gender" 2018-07-19 05:26:47 +00:00
Jake Wharton
e4bd160284 Add rule emissions for appComponentFactory
This attribute was added in API 28 and is reflectively instantiated from a zero-argument constructor.

Test: make aapt2_tests
Change-Id: Ie9de0764165c6fe6c6fcda6cc38b0cc633f03bbd
2018-07-18 12:09:17 -04:00
Jake Wharton
cfbc767b61 Add Application name to manifest test case
Test: make aapt2_tests
Change-Id: I4df26375bdf480b7d09e9cf816b7a9feaa141115
2018-07-18 12:09:17 -04:00
Jeff Sharkey
bd26119169 Handle new current.txt format.
We're starting to see "@interface" show up, so handle them like any
other interface.  We're also seeing more details argument lists
with names and annotations; ignore them for now, since all our
existing lint checks work on the "real" data type.

Verified that it handles new support library current.txt files
without causing any regressions against existing framework
current.txt files.

Test: manual inspection
Bug: 111555356
Change-Id: Id11c3561edd317e4ba1a9b43993fd96d8243e00d
2018-07-17 13:59:04 -06:00
Ryan Mitchell
5fa2bb14ec AAPT2: Fix long version code bugs
Refactoring areas in AAPT2 that use android:versionCode to also use
abdroid:versionCodeMajor. Does not add versionCodeMajor command line flag yet.

Bug: 109883459
Test: aapt2_tests
Change-Id: I573fbea37491cf8c5742f9e385c66ee64c4e5166
2018-07-13 23:41:46 +00:00
Ryan Mitchell
833a1a6c4a AAPT2: Refactor flags into commands
Refactors the flag based command invocation into classes that make using
subcommands easier.

Test: manual tests of printing
Change-Id: Ic8df6af0be30db552e32150afebecbfeec7e1075
2018-07-13 14:26:06 -07:00
Ryan Mitchell
23cc5d5dbe AAPT2: Fix R.java for styleable in different package
When generating the R.java file, attributes of styleables do not always
have package names on them. This caused a problem where when an apk
that was previously linked and that also contained a declare-styleable
is linked again to an AndroidManifest.xml with a different package name,
styleable attributes' resource symbols could not be looked up correctly.

This change does not rename the resources but makes sure that the java
generator finds the attribute symbols correctly.

Bug: 110877419
Test: Created a test in aapt2_tests and verified correct behavior of
repro example from bug

Change-Id: Ib99d84cbe44dadca86603bc610ad3f4e09e3fb11
2018-07-13 11:19:56 -07:00
Siyamed Sinir
77a1b14910 Remove requirement for kiss emoji should have gender
Test: m fontchain_lint
Test: m
Test: Visual test on device after full build 

Bug: 110037531
Change-Id: Iac26c7c7c0e1a8a500a93f19d99831113529b201
2018-07-12 12:02:18 -07:00