summaryrefslogtreecommitdiff
path: root/tools/aapt2/optimize/ResourcePathShortener_test.cpp
AgeCommit message (Collapse)Author
2019-07-30ResourcePathShortener deterministically handles hash collisionsMohamed Heikal
ResourcePathShortener appends one digit at the end of colliding short file names to disambiguate them. This cl sorts the list of file paths so that colliding files always get the same disambiguating digit from one run to the next rather than possibly alternating. Test: make aapt2_tests Change-Id: I983a1448c21f2c79d7cdb1de232e7758c04fc256
2019-07-08Fix bug where aapt2 optimize obfuscated color-* resourcesMohamed Heikal
aapt2 optimize --enable-resource-path-shortening should ignore res/color resources since android uses the path while loading them. This cl fixes a bug where res/color-* (eg: res/color-v21) resource paths are shortened when they should not be. Test: make aapt2_tests Bug: b/75965637 Change-Id: Ibbc3fe4d2e6bd4f31765a5aa85980907dc013ecd
2019-04-26Fix bug where path shortening breaks ColorStateListsMohamed Heikal
Android resource loader uses the file path to check if a resource is a ColorStateList. Path shortening removed that part of the path and thus broke the resource loader of APKs optimized with path shortening. This cl skips path shortening for resources under "res/color/" Test: make aapt2_tests Bug: b/75965637 Change-Id: If94dfa398efd81522d4faed157afd35f6dabe856
2018-12-20Resource Path ObfuscationMohamed Heikal
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