273 Commits

Author SHA1 Message Date
Colin Cross
e3cd4b394c Merge "Replace libziparchive-host with libziparchive" am: 611e205bbe am: 8c8bb25089
am: 63dc310e6a

Change-Id: I645d077dd656f84446f77fd91c169fd7b977e661
2016-08-26 20:40:27 +00:00
Colin Cross
9a1a3bcb16 Replace libziparchive-host with libziparchive
libziparchive-host is no longer necessary, and mixing libziparchive-host
and libziparchive can cause ODR violations.

Change-Id: I623c0c5579e28f26a6e1db7bd953f33ed1ca68cd
2016-08-26 11:15:17 -07:00
Martijn Coenen
2cc64692ce Merge changes from topic 'utf' am: 0a357a1a73 am: de8a6a66f6
am: 1657493c22

Change-Id: Ie675738a4f9042929d1ffb5e1ffcc7bbb5c7b217
2016-08-25 20:31:31 +00:00
Sergio Giro
d90d8d615a Add bound checks to utf16_to_utf8
Test: ran libaapt2_tests64
Bug: 29250543
Change-Id: I1ebc017af623b6514cf0c493e8cd8e1d59ea26c3
(cherry picked from commit 4781057e78f63e0e99af109cebf3b6a78f4bfbb6)
2016-08-25 12:19:12 +02:00
Sergio Giro
8f7b8a1f6c Unicode: specify destination length in utf8_to_utf16 methods
Change-Id: I5223caa7d42f4582a982609a898a02043265c6d3
2016-08-25 12:04:40 +02:00
Adam Lesinski
8197cc460e AAPT2: Merge Styleables instead of overriding them
Styleables merge in AAPT. Preserve this behavior.

Bug:30970091
Change-Id: Ie68ca675aeecd873c0648682182e2fc574e329a0
2016-08-19 13:29:40 -07:00
Adam Lesinski
aa0255da28 AAPT2: Add tool to fix positional argument issues
Change-Id: Ie8f733b70d561667cd25b38fb4c09d0837ef9b7f
2016-08-18 14:05:44 -07:00
Alexandria Cornwall
a7cc3f1d79 AAPT2: Add support to strip namespaces from XML
The --no-xml-namespaces flag will strip namespace information from
compiled binary XML files in res/* (excluding res/raw/*) and
AndroidManifest.xml. It will also strip URI information from compiled
binary XML files in res/* (excluding res/raw/* and AndroidManifest.xml).

AndroidManifest.xml URI information is retained due to PackageParser, which
requires the Android URI for intent filters.

Bug: 29115919
Change-Id: I90cad6ed39ce02a69776f55314c1d4f38ad1aabe
2016-08-17 11:01:05 -07:00
TreeHugger Robot
e42bc0587f Merge "Fix clang-tidy warnings in aapt and aapt2." 2016-08-15 21:10:23 +00:00
TreeHugger Robot
1d740812e6 Merge "AAPT2: Expose split support to command line" 2016-08-15 20:46:38 +00:00
Chih-Hung Hsieh
470f8fcb5c Fix clang-tidy warnings in aapt and aapt2.
* Add explicit keyword to conversion constructors.
* Add NOLINT(implicit) comments for implicit conversion constructors.
Bug: 28341362
* Use const reference type for read-only parameters.
Bug: 30407689
* Add NOLINT to suppress wrong clang-tidy warnings on macros.
Test: build with WITH_TIDY=1

Change-Id: Ibfafb23d9be463b4072745a51a6d9f1812dcac45
2016-08-15 12:32:51 -07:00
Adam Lesinski
36c73a5959 AAPT2: Expose split support to command line
Bug:30445078
Change-Id: If4b8530dba71b9059b8e62c04757da99c1119d22
2016-08-15 12:14:26 -07:00
Chih-Hung Hsieh
84717d4118 resolve merge conflicts of 17bd236 to stage-aosp-master am: b3d46b44a3
am: c76aa69207

Change-Id: I6bb066d131dde297612c5dcbf5051f4964e62a8b
2016-08-12 19:35:08 +00:00
Chih-Hung Hsieh
c76aa69207 resolve merge conflicts of 17bd236 to stage-aosp-master
am: b3d46b44a3

Change-Id: I5123493e165c4d2ab74cf045e5fb8181886dce62
2016-08-12 19:30:02 +00:00
Alexandria Cornwall
c34027ec3d Merge "AAPT2: Fix resource type id symbol merging" 2016-08-12 19:27:32 +00:00
Chih-Hung Hsieh
b3d46b44a3 resolve merge conflicts of 17bd236 to stage-aosp-master
Change-Id: I08d4500aaa378b08d41e8d046c62101e08dbfba8
2016-08-12 11:44:16 -07:00
Chih-Hung Hsieh
8bd37ba458 Fix clang-tidy warnings in aapt and aapt2.
* Add explicit keyword to conversion constructors.
* Add NOLINT(implicit) comments for implicit conversion constructors.
Bug: 28341362
* Use const reference type for read-only parameters.
Bug: 30407689
* Use const reference type to avoid unnecessary copy.
Bug: 30413862
Test: build with WITH_TIDY=1

Change-Id: Id6d21961f313a1ad92b15a37fdaa5be9e8ab48e1
Merged-In: Id6d21961f313a1ad92b15a37fdaa5be9e8ab48e1
2016-08-11 15:20:10 -07:00
Chih-Hung Hsieh
9b8528fee4 Fix clang-tidy warnings in aapt and aapt2.
* Add explicit keyword to conversion constructors.
* Add NOLINT(implicit) comments for implicit conversion constructors.
Bug: 28341362
* Use const reference type for read-only parameters.
Bug: 30407689
* Use const reference type to avoid unnecessary copy.
Bug: 30413862
Test: build with WITH_TIDY=1

Change-Id: Id6d21961f313a1ad92b15a37fdaa5be9e8ab48e1
2016-08-11 15:16:41 -07:00
Alexandria Cornwall
6a1f8dbd51 AAPT2: Fix resource type id symbol merging
By the looks of things, AAPT2 should be able to merge public type and entry
symbols iff their types and resource IDs match.

Change-Id: Ie99071418aa89aad56de5e5b96e98b96d0d15d7a
2016-08-11 14:46:27 -07:00
Alexandria Cornwall
8eefa04826 Merge "AAPT2: Reorder link steps" 2016-08-11 18:33:02 +00:00
Alexandria Cornwall
637b4820dc AAPT2: Reorder link steps
AAPT2's link steps were writing the res/* files before optimizations to the
resource table were performed (such as version collapsing). This was causing
unreferenced res/* files to remain in the archive, even though they're no
longer necessary.

Bug: 30705740
Change-Id: I50d7943ef7429b14e46587093855c15d54038299
2016-08-11 09:53:16 -07:00
TreeHugger Robot
b80b6dabcb Merge "AAPT2: Parse coreApp in <manifest> as boolean" 2016-08-10 19:52:24 +00:00
Adam Lesinski
6b17d2cec2 AAPT2: Parse coreApp in <manifest> as boolean
Bug:30751662
Change-Id: I283be5725426ee084944c1921df40d1bd6188028
2016-08-10 11:37:06 -07:00
Alexandria Cornwall
f6762fc22a AAPT2: Merge binary XML file attributes
AAPT2 generates extra versions of XML binaries based on the sdkVersion
that attributes were introduced, up to v21. This should only happen for
sdkVersions that are > minSdkVersion, as everything else can be included
in the main configuration (e.g. "layout" instead of "layout-v4").

This change handles the merging of XML binary sdkVersions that were created
implicitly.

Bug: 30705740
Change-Id: I854843dd6dbaca52896cea0c24c70c900cec3e8e
2016-08-09 13:23:03 -07:00
Adam Lesinski
9756dec248 AAPT2: Add default no-compress extensions
Change-Id: Iff0820993059bcab59208b07601b2c6d8d953c89
2016-08-08 12:41:45 -07:00
Alexandria Cornwall
a9ff14098b AAPT2: Strip dedicated tools namespace from XML
Android has a dedicated XML namespace dedicated for tools that should not be
included in the final APK. AAPT strips this out, but the feature was missing
from AAPT2. See: http://tools.android.com/tech-docs/tools-attributes

Bug: 29115919
Change-Id: I8f4fc79e6c8592a313a691134e44d16fd91f36ed
2016-08-03 10:02:15 -07:00
Sergio Giro
e55e65c993 Merge "Unicode: specify destination length in utf8_to_utf16 methods" 2016-08-02 18:48:19 +00:00
Adam Lesinski
bad90c3888 AAPT2: Add missing error statement
Change-Id: I955ba6f151d68db02c3dc16d121994fb553dcea8
2016-08-02 11:39:17 -07:00
Adam Lesinski
39df2f25dc Merge "Move utility scripts to tools/" 2016-08-02 17:17:15 +00:00
Adam Lesinski
98bda74eb5 Move utility scripts to tools/
Change-Id: Iddb755f3cec0a32801128b4eb20f2c185b0cc626
2016-08-02 10:15:33 -07:00
Dan Willemsen
3b16cf057a Rename libprotobuf-cpp-lite_static to libprotobuf-cpp-lite am: 2005edf642 am: 4ee22dd083
am: 77508b9c19

Change-Id: Ifb0fef3c2dfaef7b19e2f03dbbdce41431a51a2f
2016-08-02 02:36:20 +00:00
Dan Willemsen
77508b9c19 Rename libprotobuf-cpp-lite_static to libprotobuf-cpp-lite am: 2005edf642
am: 4ee22dd083

Change-Id: I5a9006361b3ded4eaf03b1362a0dfa2aa36fdb2e
2016-08-01 23:46:15 +00:00
Dan Willemsen
4ee22dd083 Rename libprotobuf-cpp-lite_static to libprotobuf-cpp-lite
am: 2005edf642

Change-Id: I48dfa98a54a8680d091cbc403feb30bba35f2efd
2016-08-01 23:39:34 +00:00
Adam Lesinski
3822763bfc Merge "AAPT2: Add script to remove duplicate resource definitions" 2016-08-01 22:05:49 +00:00
Adam Lesinski
bb5a390142 AAPT2: Allow <intent-filter> within <provider> in AndroidManifest.xml
Change-Id: I005120b76679f51039ddc40160c96ead6ab5fa4f
2016-08-01 15:01:08 -07:00
Adam Lesinski
9eff3cd594 AAPT2: Add script to remove duplicate resource definitions
Change-Id: I1577cc35cf1db0a7cf24a072485fc3af14c1d02e
2016-08-01 12:58:17 -07:00
Dan Willemsen
2005edf642 Rename libprotobuf-cpp-lite_static to libprotobuf-cpp-lite
Use the same name for the static and shared libraries so that the module
definitions can be shared.

Change-Id: I1578ee7044689194ae1baea4d71f1b0e8737505f
2016-07-31 22:48:28 -07:00
Sergio Giro
03b95c7df5 Unicode: specify destination length in utf8_to_utf16 methods
Change-Id: I5223caa7d42f4582a982609a898a02043265c6d3
2016-07-29 17:54:30 +01:00
Adam Lesinski
b720bc304e Merge "AAPT2: Add version info and release notes" 2016-07-27 19:53:18 +00:00
Adam Lesinski
ad48bbcbf6 Merge "AAPT2: Change accepted notation for resource names in tests" 2016-07-27 19:52:44 +00:00
Adam Lesinski
f455762ec6 Merge "AAPT2: Add support to specify stable IDs" 2016-07-27 19:52:27 +00:00
Adam Lesinski
0368ebfc29 AAPT2: Add version info and release notes
Bug:30402888
Change-Id: Idb532cc71921eb1cfba31c00a6fb7108e31fddd8
2016-07-26 12:57:21 -07:00
Adam Lesinski
58a20a6482 AAPT2: Change accepted notation for resource names in tests
Previously the way to name resources in tests was to use reference
notation (@[package:][type/]name). Now we use name notation (no @).

Change-Id: I68f0a36562d89cc78c582d128f370d9556c58707
2016-07-25 17:56:58 -07:00
Adam Lesinski
bf0bd0f9ac AAPT2: Add support to specify stable IDs
The --stable-ids flag allows the user to specify a file containing
a list of resource name and resource ID pairs in the form of:

package:type/name = 0xPPTTEEEE

This assigns the given resource the specified ID. It helps ensure
that when adding or removing resources, IDs are assigned in a stable
fashion.

If a package, type, or name is not found, no error or warning is
raised.

Change-Id: Ibc2f4e05cc924be255fedd862d835cb5b18d7584
2016-07-25 16:02:18 -07:00
Alexandria Cornwall
e0af925c8f AAPT2: Convert StringPool flattening to UTF-8
Convert StringPools in resources.arsc and binary XML files to use UTF-8
instead of UTF-16 to save lots of bytes.

Bug: 30053277
Change-Id: I8eb6c78644e51b15f89edadab71cc86f5a851a45
2016-07-25 09:46:38 -07:00
Ivan Gavrilovic
f580d91dab Aapt main dex proguard rules - always keep application
Aapt with -D option was not keeping the application and instrumentation
subclasses, which were instead handled by mainDexClasses.rules. Instead,
include them in the aapt -D output.

Change-Id: Ia3b89fc2edd45d379c4d06f0bf674716646fcb3d
2016-07-20 15:38:48 +01:00
Adam Lesinski
87675ada47 AAPT2: Erase version qualifiers for resources <= minSdk
When resources share the same configuration, they are much more
clustered in the resulting resources.arsc, which makes for smaller
APKs. Strip version qualifiers for resources <= minSdk so that
they get clustered.

Bug:30050641
Change-Id: I80371b179761501fb7cc41f5f5ac67ffde2fc677
2016-07-15 18:04:56 -07:00
Sergio Giro
1deedbacc3 Add bound checks to utf16_to_utf8
Test: ran libaapt2_tests64
Bug: 29250543
Change-Id: I1ebc017af623b6514cf0c493e8cd8e1d59ea26c3
(cherry picked from commit 4781057e78f63e0e99af109cebf3b6a78f4bfbb6)
2016-07-14 13:27:53 +00:00
Adam Lesinski
d0f116b619 AAPT2: Remove usage of u16string
For legacy reasons, we kept around the use of UTF-16 internally
in AAPT2. We don't need this and this CL removes all instances of
std::u16string and StringPiece16. The only places still needed
are when interacting with the ResTable APIs that only operate in
UTF16.

Change-Id: I492475b84bb9014fa13bf992cff447ee7a5fe588
2016-07-13 17:45:28 -07:00
Sergio Giro
fb5cfc3543 Merge \\"Add bound checks to utf16_to_utf8\\" into nyc-mr1-dev am: 49c410bc48
am: daad138428

Change-Id: I5a660dccb76e823736a59e50904a7279a97ef849
2016-07-12 01:46:30 +00:00