Commit Graph

6362 Commits

Author SHA1 Message Date
TreeHugger Robot
b61b0e5731 Merge "Implement issue #112113117: Ad library dependency declaration in manifest" 2018-10-05 00:45:06 +00:00
Dianne Hackborn
813d7503c8 Implement issue #112113117: Ad library dependency declaration in manifest
You can now do a new form of <uses-package> that allows you to
specify a type of package along with required cert digests (like
uses-static-library).

This defines the new attribute needed for this and XML tag, and
updates aapt2 to actually allow uses-library in the manifest and
output this data with "dump badging".

While doing this I realized that "dump badging" was not printing
the data for uses-static-library or uses-library, so do those too.

Bug: 112113117
Test: manual
Change-Id: I5d02010aad9cb44675504a317df9cced421be8a1
2018-10-04 15:27:15 -07:00
Ryan Mitchell
2250c93f14 Fix badging meta-data value
Integer meta data values were not printing correctly and instead were
printing as empty strings. Attempt to retrieve the integer value of the
attribute if the value is not a string.

Bug: 117260085
Test: manual
Change-Id: I1cef672e03d07728819ca584b484dc372984c823
2018-10-04 13:15:23 -07:00
Ryan Mitchell
5c5f0cdd04 Merge "Fix failing Windows tests" 2018-10-03 20:56:06 +00:00
Ryan Mitchell
8b7e1a8803 Merge "Restore Proguard behavior and add minimal flag" 2018-10-03 20:54:14 +00:00
Ryan Mitchell
0ce89734d1 Fix failing Windows tests
Some tests were not written to run on Windows correctly. Compile also
has a bug that caused using the --zip flag to fail on Windows.
iswspace does count the non breaking space as Whiespace on Windows but
not on Unix based systems

Bug: 117156986
Change-Id: I999375162bdfdf86fb25992ee88e2962ab90b577
Test: aapt2_tests and wine aapt2_tests.exe
2018-10-03 11:35:37 -07:00
Ryan Mitchell
56e559862d Merge "Use empty data if file in zip has length 0" 2018-10-02 17:23:32 +00:00
Chih-hung Hsieh
3b761c6b3b Merge "Add noexcept to move constructors and assignment operators." am: 9166e89374 am: 15dcc77fee
am: 07a7250da3

Change-Id: I74a6b6e53ba4f22b79b855e146aa260b2eaddb27
2018-10-01 18:59:22 -07:00
Chih-hung Hsieh
15dcc77fee Merge "Add noexcept to move constructors and assignment operators."
am: 9166e89374

Change-Id: I079060ef610c2d90c57140f001225c163a3dd21a
2018-10-01 18:09:38 -07:00
Pirama Arumuga Nainar
c691c0528e Merge "Do not use StringPiece in ExtractJavaIdentifier" am: 20ecc6397b am: 206ccf1f61
am: 7472303ff4

Change-Id: Idd910ad9fb743093f8e43ddcdf5770722b4393e6
2018-10-01 18:00:49 -07:00
Chih-hung Hsieh
9166e89374 Merge "Add noexcept to move constructors and assignment operators." 2018-10-02 00:37:46 +00:00
Pirama Arumuga Nainar
206ccf1f61 Merge "Do not use StringPiece in ExtractJavaIdentifier"
am: 20ecc6397b

Change-Id: I3c70a4b9db43d9590f52cdb6972cf9fba3501787
2018-10-01 17:25:02 -07:00
Treehugger Robot
20ecc6397b Merge "Do not use StringPiece in ExtractJavaIdentifier" 2018-10-01 23:37:31 +00:00
Chih-Hung Hsieh
fc81626ba6 Add noexcept to move constructors and assignment operators.
Bug: 116614593
Test: build with WITH_TIDY=1
Change-Id: Ic3993d88eb3066aef402d74c4d543c56a1dfd5c3
2018-10-01 20:23:02 +00:00
Seigo Nonaka
3328d1ce55 Introduce OEM customization XML parser
As the initial version of the OEM customization XML, support
new-named-family customization. This allows OEMs to add new named
family.

Bug: 111544833
Test: atest FrameworksCoreTests:android.graphics
Change-Id: If58711fc038898175fcad0ae095865312bd738e2
2018-09-28 15:59:15 -07:00
Jeff Sharkey
58131839f0 Merge "Moar lint rulez!" 2018-09-28 16:50:29 +00:00
TreeHugger Robot
9a56463f0e Merge "Support int32_t (Java Integer) in KeyValuePair atom" 2018-09-28 16:46:23 +00:00
Howard Ro
4078dd4e15 Support int32_t (Java Integer) in KeyValuePair atom
Bug: 116826451
Test: statsd_test + manual verification through logcat
Change-Id: I0157c22033907fea46e26ee4262c723fa8c0b518
2018-09-27 17:51:40 -07:00
Jeff Sharkey
daac37f229 Moar lint rulez!
Bug: 37534642, 116675691, 116798271, 72059458, 111790177
Test: manual
Change-Id: Ib079ae580a827f225be08f90dbdddeee7d341c48
2018-09-27 16:29:52 -06:00
Ryan Mitchell
63c6be63a4 Merge "Change FileStream test buffer from char* void*" am: b839befd7b am: 47be78e523
am: 5d63c53071

Change-Id: I79fed846a0d7bd20be13a5d3845bfe1a171f5b62
2018-09-26 15:46:37 -07:00
Ryan Mitchell
47be78e523 Merge "Change FileStream test buffer from char* void*"
am: b839befd7b

Change-Id: Iffc125b995827c455fb4f2c3b2dca15de3321a86
2018-09-26 15:14:41 -07:00
Ryan Mitchell
b839befd7b Merge "Change FileStream test buffer from char* void*" 2018-09-26 21:58:44 +00:00
Ryan Mitchell
8f37734cf4 Change FileStream test buffer from char* void*
It seems like GoogleTest prints string parameters before checking them.
This can be a problem in FileStream tests since these buffers are not
null terminated.  ASan reports heap-buffer-overflow.

Test: m SANITIZE_HOST=address
out/soong/.intermediates/frameworks/base/tools/aapt2/aapt2_tests/linux_glibc_x86_64_asan/aapt2_tests \
      LD_LIBRARY_PATH=out/soong/.intermediates/external/libcxx/libc++/linux_glibc_x86_64_shared
out/soong/.intermediates/frameworks/base/tools/aapt2/aapt2_tests/linux_glibc_x86_64_asan/aapt2_tests

Change-Id: I9a1956d815729de23c7038fb0d498240eb917070
2018-09-26 14:54:45 -07:00
Ryan Mitchell
7e5236dc56 Restore Proguard behavior and add minimal flag
We previously changed AAPT2 to correctly only generate keep rules for
the constructors required to inflate the different views. This cause
projects that did not have keep rules for the other constructors that
were accessed through reflection to have runtime crashes. This change
adds a flag to the link stage (--proguard-minimal-keep-rules) that
allows AAPT2 to only keep the constructors required for layout
inflation. If the flag is not present, then AAPT2 will generate less
specific keep rules than keep all constructors.

Bug: 116201243
Test: aapt2_tests
Change-Id: I8bb5cdf8446518ab153ea988e1243ca9494258c7
2018-09-25 15:20:59 -07:00
Pirama Arumuga Nainar
9ba5cb4796 Do not use StringPiece in ExtractJavaIdentifier
Bug: http://b/91353691

After assigning the result of TransformToFieldName to 'result', the
underlying storage is destroyed after the 'if' statement of the function
call.  'result' ends up with garbage if the identifier has a '-'.

ManifestClassGeneratorTest.NormalizePermissionNames is broken for this
reason in 32-bit Windows when using libc++ and 32-bit Linux.  ASAN also
reports this failure for both 32-bit and 64-bit linux.

Test: Run test on the cases mentioned above and ensure all of them pass.
Change-Id: I69163c423c1171b7ac7838f2abe06bdf8058df4c
2018-09-25 13:21:35 -07:00
Ryan Mitchell
f6fe9b6dab Use empty data if file in zip has length 0
Mmap fails when the length of a file in a zip is 0, so use an
aapt::io::EmptyData when the file length is 0.

Bug: 113094267
Test: manual
Change-Id: I2c1071293bf9b0fe33e8c279c8d78ff906fba5d6
2018-09-24 13:41:35 -07:00
Chih-Hung Hsieh
d4cf67e296 Merge "Fix clang-tidy performance warnings in frameworks/base." am: 4a2dd10d83 am: 18242e5c08
am: ad8cf079f5

Change-Id: Ifc615a1e50872a24e59d2d10122c6f90589099f5
2018-09-24 12:12:24 -07:00
Chih-Hung Hsieh
18242e5c08 Merge "Fix clang-tidy performance warnings in frameworks/base."
am: 4a2dd10d83

Change-Id: Ic7266f1c23ab5218f47bf65bb2bde6f79a07a910
2018-09-24 11:50:54 -07:00
Chih-Hung Hsieh
6b3fac2945 Fix clang-tidy performance warnings in frameworks/base.
* Use more efficient overloaded string methods.

Bug: 30411878
Test: build with WITH_TIDY=1
Change-Id: Ia387e61770e1e7211280ed028ef0eef6e632a1d2
2018-09-24 16:29:26 +00:00
Paul Duffin
6f0b03d32a Merge "Add serialization methods to whitelist not light greylist" am: f7190b65ab am: b2e9c6652e
am: df8babf2d3

Change-Id: I70367f6037761477dee69f0a4a89b22efe4bf7ba
2018-09-24 04:57:48 -07:00
Paul Duffin
b2e9c6652e Merge "Add serialization methods to whitelist not light greylist"
am: f7190b65ab

Change-Id: Idecb27314ecbdea74354afb4f320eda124bfc72d
2018-09-24 04:23:27 -07:00
Paul Duffin
e9622a3d3a Add serialization methods to whitelist not light greylist
Checked the contents of the hiddenapi lists before and after the change
and the methods were definitely moved from light greylist to the
whitelist.

Flashed the device and checked the log and did not see anything out of
the ordinary.

Test: frameworks/base/tools/hiddenapi/generate_hiddenapi_lists_test.py
Change-Id: I9b4b2426251e99495f65ae02a3c2c32ce6966625
2018-09-21 11:05:06 +01:00
Aurimas Liutikas
23ad8d73ac Merge "Add basic details on aapt2 development." 2018-09-20 21:01:15 +00:00
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
Aurimas Liutikas
c94b7551c5 Add basic details on aapt2 development.
Writing down notes for getting started on aapt2.

Test: None
Change-Id: I15c2518bf0ba5c455b83277d24ed683bfb9e446c
2018-09-18 10:36:13 -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