9 Commits

Author SHA1 Message Date
Ryan Mitchell
4ea9075124 Make aapt2 terminology more inclusive
Update language to comply with Android's inclusive language guidance

See https://source.android.com/setup/contribute/respectful-code
for reference

Bug: 162364131
Bug: 162536543
Test: aapt2_tests
Change-Id: I4eef925d6319b40a395fc8d59a3f2912a02ca03b
2020-07-31 21:03:54 +00:00
Brian Chang
3d1cde3fce Merge "Improve how we exempt resources from getting their names collapsed." 2019-09-17 17:31:18 +00:00
Brian Chang
dcef831e61 Improve how we exempt resources from getting their names collapsed.
Removed the --whitelist-path flag, which is poorly named and we can
already specify these resources with --resources-config-path.

Renamed TableFlattenerOptions.whitelisted_resources to keep_resources.
It holds ResourceName instead of std::string. This lets us include type
when specifying what gets exempted, for correctness.

Bug: 111115201
Test: make aapt2_tests
Change-Id: Ifa5df924b5e2265c32cdcf8ca7dfa4a3992a0468
2019-09-16 17:29:46 -07:00
Brian Chang
d882ba40db Rename flags in aapt2-optimize for more accuracy and consistency.
--enable-resource-path-shortening => --shorten-resource-paths
--enable-resource-obfuscation => --collapse-resource-names

Bug: 140883718
Test: Verified by running `aapt2 optimize
Change-Id: I697713f49b27ccf5f152c76e256234c041dc5f51
2019-09-16 13:09:56 -07:00
Donald Chai
d554f7c597 Fix uninitialized variable.
"aapt2 optimize" without --enable-resource-path-shortening should not do
resource-path-shortening.

Bug: 75965637
Change-Id: Ibcbf325e66ed7992bf81184260abd63711b2af2a
2019-07-10 18:50:15 -07:00
Mohamed Heikal
149b0d29c6 Merge "Resource Path Obfuscation" 2019-01-15 15:34:06 +00:00
Mohamed Heikal
c769403631 Resource Path Obfuscation
This CL allows aapt2 to obfuscate resource paths within the output apk
and move resources to shorter obfuscated paths. This reduces apk size
when there is a large number of resources since the path metadata exists
in 4 places in the apk.

This CL adds two arguments to aapt2, one to enable resource path
obfuscation and one to point to a path to output the path map to (for
later debugging).

Test: make aapt2_tests
Bug: b/75965637

Change-Id: I9cacafe1d17800d673566b2d61b0b88f3fb8d60c
2018-12-20 18:19:25 -05:00
Ryan Mitchell
2c8fc86694 Fix long file paths for Windows
Allows specifying which arguments into aapt2 are file paths.
If the path exceeds the maximum path length for Windows, encode the path using
the extended-length prefix.

Bug: 120853927
Test: aapt2_tests.exe

Change-Id: Ibe5c1cc79a70c33c302157f2ffd54525439a910f
2018-12-19 14:07:43 -08: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