Commit Graph

6328 Commits

Author SHA1 Message Date
Ryan Mitchell
c95add6ddc Merge "AAPT2: Increase maximum proto size" 2018-09-19 18:33:46 +00:00
Ryan Mitchell
500d3f1aee Merge "AAPT2: Added badging and permission" 2018-09-19 00:10:11 +00:00
Ryan Mitchell
fc225b21c1 AAPT2: Added badging and permission
Added the remaining dump commands to aapt2.
aapt2 dump badging [apk]
aapt2 dump permissions [apk]

Bug: 73351292
Test: Diffing aapt and aapt2 output across apps from the Android tree
Change-Id: Idee820db410ad8d777d0d250c2657e7b83112a00
2018-09-18 13:17:01 -07:00
TreeHugger Robot
837cefb8c4 Merge "Don't allow splitting on an empty configuration" 2018-09-18 00:17:57 +00:00
Todd Kennedy
9fbdf89dda Don't allow splitting on an empty configuration
When aapt breaks out splits, it may remove the SDK constraint [if
it's lower than the min sdk]. If that is the only constraint, we
would create a resource split with no constraints. Don't allow
that situation. There must always be _some_ constraint.

Bug: 113115970
Test: atest CtsAppSecurityHostTestCases:SplitTests
Test: aapt2_tests
Change-Id: I424c875677c3be2a3ff5ddd39100b998bd650a4b
2018-09-17 14:16:21 -07:00
Mathew Inwood
7e84efb275 Merge "Don't fail if there are no comments." am: daabcae955 am: 57a4bae7c3
am: c73d03a53a

Change-Id: Icff55d494db44e022df7f415fe19cdb685d830d1
2018-09-14 22:36:41 -07:00
Mathew Inwood
57a4bae7c3 Merge "Don't fail if there are no comments."
am: daabcae955

Change-Id: I7d8139a98913ae17491f73314bd426287374c270
2018-09-14 21:55:58 -07:00
Ryan Mitchell
f4b2999910 Merge "AAPT2: Convert from Modified UTF-8 ResStringPool" 2018-09-14 22:36:28 +00:00
Siyamed Sinir
ee26376f23 Merge "Update lint rules for graphics/text package layering" 2018-09-14 18:56:05 +00:00
Ryan Mitchell
4353d61b8b AAPT2: Convert from Modified UTF-8 ResStringPool
Since ResStringPools are encoded using Modified UTF-8, retrieving
strings from the string pool convert the strings to UTF-8 before
returning.

Bug: 114734350
Test: m aapt2_tests
Change-Id: Ib459018186f4c5b40f3f3786425a335ecfb9ed02
2018-09-14 09:23:44 -07:00
Mathew Inwood
6be0fdde4a Don't fail if there are no comments.
Grep exits with non-zero if it find no matches. But it doesn't matter in
this case, so just carry on.

Test: frameworks/base/tools/hiddenapi/sort_api.sh \
Test:    frameworks/base/config/hiddenapi-light-greylist.txt
Change-Id: I7c219ee617f7dfa3cff5232ab979cc4ba38ebbfd
2018-09-14 15:29:35 +01:00
Ryan Mitchell
9e7af75776 Merge "AAPT2: Add the rest of supported manifest elements" 2018-09-13 23:50:24 +00:00
Siyamed Sinir
e23aeb8024 Update lint rules for graphics/text package layering
Test: N/A
Bug: 77347886
Change-Id: I907d99b4a1dee0c69b914e55a033d3d9c4eebe56
2018-09-13 16:06:59 -07:00
Ryan Mitchell
917caf75be Merge "AAPT2: Fail on invalid id names in compiled xml" 2018-09-13 21:28:40 +00:00
Ryan Mitchell
26b14f5739 Merge "AAPT2: Fix windows multiple directory creation" 2018-09-13 20:14:57 +00:00
Ryan Mitchell
db0cad4c35 AAPT2: Fix windows multiple directory creation
When attempting to create directories on different drives, AAPT2 would
fail because it would attempt to call _wmkdir on the drive
(eg. _wmkdir("D:\")). Split on directories after the drive letter
instead.

Bug: 68936311
Test: manual testing using Android Studio
Change-Id: Iad47f466af6f82d4ac402e9bf52853edaa9a5e0b
2018-09-13 15:27:58 +00:00
Ryan Mitchell
7984854750 AAPT2: Fail on invalid id names in compiled xml
AAPT2 was not erroring on invalid resource ids created in layouts with
creation syntax. This change causes this to error suring compile.

Bug: 71394154
Test: aapt2_tests
Change-Id: Idf16fb4bd011ed2d65e8c48f7cba0429ead5a055
2018-09-13 15:23:56 +00:00
Ryan Mitchell
e0eba7a3bb AAPT2: Increase maximum proto size
Deserializing a proto form a string throws an error when 64MB have been
read from the stream. This change removes the maximum size but shows a
warning when a proto is larger than 64MB.

Bug: 114020398
Test: manual test with resources.pb greater than 64MB
Change-Id: Iee397b6709d79a9338133a6136fe6e8f70a4964c
2018-09-12 08:54:07 -07:00
Jeff Sharkey
53cfa2cc8c resolve merge conflicts of 6af9cdf137 to master
Bug: None
Test: I solemnly swear I tested this conflict resolution.
Change-Id: Ide3c0e977b7d7c32ee9515e184ac7ac998f6b05c
2018-09-12 09:41:26 -06:00
Jeff Sharkey
ac2b7439d9 Merge changes from topic "ownerz"
am: 98cd65e17f

Change-Id: I42a137e73ab409a03f26abb0394be229c9d43e12
2018-09-11 16:15:49 -07:00
Chenjie Yu
14f5e6c5bd Merge "allow use of atom definition outside of atoms.proto in pulled atoms" 2018-09-11 22:00:53 +00:00
Jeff Sharkey
5b471996eb Tweaks to AOSP upload hook logic.
Lists all matching files, and slightly more robust path handling.

Bug: 113136846
Test: manual
Change-Id: Ic1971a3df97b8b137993b5856b47d0d706a996cd
2018-09-11 12:14:48 -06:00
David Brazdil
d855bd60e7 Merge "Revert "Check in P dark greylist, use it for hidden API list generation"" am: e87700fc97 am: 5c6894a85b
am: e39835cd8f

Change-Id: I4fda8b3d7519f8ab242c04e1f9547285f1acacf4
2018-09-11 10:39:24 -07:00
Jeff Sharkey
0a9c731969 Upload hook that guides people towards AOSP.
The canonical location of certain parts of the source tree live in
AOSP, and should not be changed internally to avoid merge conflicts.

This initially starts with "OWNERS" files, but the hook can easily
be repeated to match any files based on file path regexes.

Bug: 113136846
Test: manual
Change-Id: I113e63b6133f20389d84ec0d6d8b81cdbdf35d38
Merged-In: I113e63b6133f20389d84ec0d6d8b81cdbdf35d38
2018-09-11 11:09:05 -06:00
David Brazdil
5c6894a85b Merge "Revert "Check in P dark greylist, use it for hidden API list generation""
am: e87700fc97

Change-Id: Ic4c73f2f482ab9260479e44e69a26bb55e510cca
2018-09-11 09:46:18 -07:00
David Brazdil
4a55eebf26 Revert "Check in P dark greylist, use it for hidden API list generation"
This reverts commit 3cc74c71ef.
We saw app crashes due stricter classification of non-SDK APIs.

Bug: 115284625
Bug: 113881436
Test: phone boots

Change-Id: I689d0fbf66fabeffa5032e13f2f1f314c50b6cc5
2018-09-11 11:43:07 +01:00
Chenjie Yu
159e4f8f46 allow use of atom definition outside of atoms.proto in pulled atoms
There will be followup cls to add support of new types that can be
nested and repeated.
+ skip StatsLog.write signature generation for pulled atoms.

Bug: 113872139
Test: manual test
Change-Id: I69d0ee0b2fe8e286e48eac20ec2c8b280c477bf0
2018-09-10 18:26:33 -07:00
TreeHugger Robot
8a903bdb33 Merge "Interface of writing key value pair atom to socket and parsing from statsd." 2018-09-08 03:24:26 +00:00
Ryan Mitchell
28afe682cd AAPT2: Add the rest of supported manifest elements
Adds elemnts that are parsed in PackageParser to the manifest parsing of
AAPT2.

<package> found in <manifest>
<preferred> found in <manifest><application><activity>

Bug: 79755007
Test: manual building of broken targets listed in the bug
Change-Id: Ic7d17e62d04aa46757d2ed7482ec0aff93ce9ee5
2018-09-07 15:19:53 -07:00
Yangster-mac
e124e42582 Interface of writing key value pair atom to socket and parsing from statsd.
Test: statsd unit test
BUG: b/114231161

Change-Id: I3543900934b5e8e0677bf1e7cc454d61064a2475
2018-09-07 11:09:37 -07:00
David Brazdil
d3e4a4aead Merge changes from topic "hiddenapi-dark-grey" am: 3d93d8f323 am: 5c776dea7e
am: fa5ad5cb9b

Change-Id: I22668080195cc78f3ee2576f6094eeb524781c96
2018-09-07 03:43:20 -07:00
David Brazdil
a5249f9b0d Check in P dark greylist, use it for hidden API list generation am: 3cc74c71ef am: 38d2793a7d
am: a77f53d1e3

Change-Id: I42afed836a9e325cdf10585eb62aaf9cab35c5d2
2018-09-07 03:32:05 -07:00
David Brazdil
5c776dea7e Merge changes from topic "hiddenapi-dark-grey"
am: 3d93d8f323

Change-Id: I7ee3cfd512553bcf5ff3297a7df0db6786d3436a
2018-09-07 03:00:37 -07:00
David Brazdil
38d2793a7d Check in P dark greylist, use it for hidden API list generation
am: 3cc74c71ef

Change-Id: I266a8661800078c7fd3f1717b94c81f3a7e9545a
2018-09-07 02:48:00 -07:00
David Brazdil
3d93d8f323 Merge changes from topic "hiddenapi-dark-grey"
* changes:
  Ignore comment lines in hidden api lists
  Mark hidden API lists .KATI_RESTAT
  Check in P dark greylist, use it for hidden API list generation
2018-09-07 09:31:56 +00:00
Tobias Thierer
8dcc5f9914 Merge "Fix compilation when targeting OpenJDK 9." am: 0d2f465ed7 am: e03a757d87
am: 084d8365b2

Change-Id: I628c836ce87bde417f7cba64cf4bb20e206bc835
2018-09-06 13:22:40 -07:00
Tobias Thierer
e03a757d87 Merge "Fix compilation when targeting OpenJDK 9."
am: 0d2f465ed7

Change-Id: I066771334a0d7c4d79c4035ccce95c08d7a23892
2018-09-06 12:31:56 -07:00
Tobias Thierer
8fb3615729 Fix compilation when targeting OpenJDK 9.
CL [1] added a new compilation target that uses internal API
that is now in the jdk.compiler module and is not exported
(it is subject to removal without notice in future versions of
OpenJDK). The fact that these packages are not exported suggests
that a replacement API is already available, but I don't know the
details.

For now, this CL uses javac command-line flags to export these
packages, which fixes compilation. Since the commit message from
CL [1] implies that the entire tool can be removed once bug 77284273
is fixed, a longer-term solution should not be required.

[1] https://android-review.googlesource.com/c/platform/frameworks/base/+/745655
    commit bad89e5e5b

Test: The following breaks before but not after this CL:
  EXPERIMENTAL_USE_OPENJDK9=true make unsupportedappusage-annotation-processor
Bug: 113853502

Change-Id: I24b77af9262891428a01e2eccc18fa3a5c3b3bc9
2018-09-06 17:33:57 +01:00
David Brazdil
ae88d4e21e Ignore comment lines in hidden api lists
It is sometimes useful to add comments at the top of a source file. This
patch changes hidden API list generation to ignore lines beginning with
a hash.

Note that due to the sorting constraints on hidden API lists, comments
can be only at the top of the files.

Test: m appcompat
Change-Id: I1bc6fd44d1b1f10a5adc45093d7f7ed5a0c5a54f
2018-09-06 15:10:28 +01:00
David Brazdil
3cc74c71ef Check in P dark greylist, use it for hidden API list generation
We want to preserve the same semantics as P wrt dark greylist. This will
eventually become the "blacklist for target SDK >= P".

Bug: 113881436
Test: phone boots
Change-Id: I3bb72102e1d054eb0f2cae089ab633a0bc2bb276
2018-09-06 11:10:51 +01:00
TreeHugger Robot
8019cb8898 Merge "Refactor String8 to std::string calls" 2018-09-05 17:35:38 +00:00
Mathew Inwood
88924e0e24 Merge "Processor for @UnsupportedAppUsage annotations." am: e5440456ca am: 22ea0b7a52
am: d20588332d

Change-Id: I097550eeaf0307e3518aaf2d8e3f30338f9fa9dc
2018-09-05 10:01:21 -07:00
Mathew Inwood
22ea0b7a52 Merge "Processor for @UnsupportedAppUsage annotations."
am: e5440456ca

Change-Id: I5e4d53b92c20bf3c34248c6cf4798ab4ba34af7c
2018-09-05 09:33:33 -07:00
Mathew Inwood
bad89e5e5b Processor for @UnsupportedAppUsage annotations.
The processor outputs unsupportedappusage_index.csv, containing source
position info for every@UnsupportedAppUsage annotation processed. It is a
mapping of dex signature to the source postion of the annotation on that
signature. It is used as input for scripts which update the annotations.

We include a META-INF file which causes the compiler to automatically
pick up the annotation processor. Otherwise we would need to explicitly
specify the processor with a -processor flag to javac.

We create a new build target for just the @UnsupportedAppUsage annotation
and the @IntDef annotation (which it depends on) so that the processor can
also depend on that directly.

The processor only runs on a new build target framework-annotation-proc
so that it is not invoked as part of a regular build. This is done so
that we don't slow down peoples builds: Soong does not support annotation
processors when javac sharding is in use. This workaround can be removed
once b/77284273 is fixed.

Test: m framework-annotation-proc
Bug: 113853502

Change-Id: Ie9cd5a90ddf7a51f6035e849703fc39ad9127557
2018-09-05 15:01:21 +01:00
TreeHugger Robot
bd263a40ca Merge "AAPT2: Fix dump apk format" 2018-08-31 00:01:40 +00:00
Ryan Mitchell
dea2fe3f9f AAPT2: Fix dump apk format
Dumping resources printed the incorrect apk type.

Bug: 113062289
Test: manual
Change-Id: I8b250a470afa26697f80b1dfa8ba677ed654a958
2018-08-30 13:48:54 -07:00
David Brazdil
c72888de5d Merge "Rewrite hidden API list generation in Python" am: a264c2c83e am: 8f7b234417
am: 8107e81a78

Change-Id: Ib37713052218289bbfe424855ab96e5cab9a27ad
2018-08-30 11:41:53 -07:00
David Brazdil
8f7b234417 Merge "Rewrite hidden API list generation in Python"
am: a264c2c83e

Change-Id: Ib785891e303ef7c4a78175debae3e92b3a82410f
2018-08-30 11:18:29 -07:00
David Brazdil
8503b9045b Rewrite hidden API list generation in Python
Generating hidden API lists has grown in complexity and the original
Makefile rule has become a bottleneck for build times. Rewrite the
logic in Python.

Bug: 113278235
Bug: 73736106
Test: frameworks/base/tools/hiddenapi/generate_hiddenapi_lists_test.py
Change-Id: I63f03133d70260d06c55f482b844a4980dc6f734
2018-08-30 16:19:26 +01:00
Dan Willemsen
2d30bf731d Merge "Convert aapt to Soong" am: 7bd321ca25 am: 9f5e3e822c
am: 946e6eedc2

Change-Id: Iffb3b89148643365a356512d806a4e9e123e359b
2018-08-29 20:02:39 -07:00