OSDN Git Service

AAPT: Modified StringPool uniqueness detection
authory <rtmitchell@google.com>
Fri, 13 Apr 2018 18:25:12 +0000 (11:25 -0700)
committery <rtmitchell@google.com>
Fri, 13 Apr 2018 23:15:42 +0000 (16:15 -0700)
commit35ecb89a8aa68f24d2e991df5bb9964ad15075dc
tree4a6694c3430fea5d6ae5b0bd3680aab24a303232
parenta668c663019dcabe62d1f667ec5402806a22b0a8
AAPT: Modified StringPool uniqueness detection

b/77862560 detected that when converting an apk to binary using aapt2,
all resource ids of attributes that have been replaced with resource
identifiers become set to the identifier of the first attribute. This is
because the attribute names are all empty because the names are not necessary
since the resource ids are present. The empty attribute names all map to
the same string pool reference and cause all the ids to be the first
empty string into the string pool.

Bug: 77862560
Test: Converted apk in listed bug from proto to binary and observed
correct resource ids and correct badging.

Change-Id: I635c13cd1ad7a395fe40a57198cfe5ec91602d01
tools/aapt2/StringPool.cpp
tools/aapt2/StringPool_test.cpp