summaryrefslogtreecommitdiff
path: root/tools/aapt2/ResourceUtils.cpp
diff options
context:
space:
mode:
authorRyan Mitchell <rtmitchell@google.com>2018-11-13 10:40:07 -0800
committerRyan Mitchell <rtmitchell@google.com>2018-11-15 11:37:01 -0800
commit4e9a922ede24f7f7bfe793321f7328623ee2a061 (patch)
treeb74d2ecefc7e6902ff37c1be7798adc5861ae13d /tools/aapt2/ResourceUtils.cpp
parent67dd91e6a301c9dd15f4f95ac715064534296a53 (diff)
Fix loaded apk string pool order
Loading in an APk changed the ordering of strings in the string pool. When loading an apk, assign the strings to the same index as they are in the ResStringPool. Bug: 118831219 Test: "aapt2 dump strings left.apk" prints in the correct order, "aapt2 convert left.apk --output-format binary -o left_binary.apk" has entries in the correct order, and aapt2_tests Change-Id: I00014c02195f39c1152a110e90083d9b14e9216e
Diffstat (limited to 'tools/aapt2/ResourceUtils.cpp')
-rw-r--r--tools/aapt2/ResourceUtils.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/aapt2/ResourceUtils.cpp b/tools/aapt2/ResourceUtils.cpp
index dbe5ac5adb98..da22e885b917 100644
--- a/tools/aapt2/ResourceUtils.cpp
+++ b/tools/aapt2/ResourceUtils.cpp
@@ -718,7 +718,7 @@ std::unique_ptr<Item> ParseBinaryResValue(const ResourceType& type, const Config
// This must be a FileReference.
std::unique_ptr<FileReference> file_ref =
util::make_unique<FileReference>(dst_pool->MakeRef(
- str, StringPool::Context(StringPool::Context::kHighPriority, config)));
+ str, StringPool::Context(StringPool::Context::kHighPriority, config), data));
if (type == ResourceType::kRaw) {
file_ref->type = ResourceFile::Type::kUnknown;
} else if (util::EndsWith(*file_ref->path, ".xml")) {
@@ -730,7 +730,7 @@ std::unique_ptr<Item> ParseBinaryResValue(const ResourceType& type, const Config
}
// There are no styles associated with this string, so treat it as a simple string.
- return util::make_unique<String>(dst_pool->MakeRef(str, StringPool::Context(config)));
+ return util::make_unique<String>(dst_pool->MakeRef(str, StringPool::Context(config), data));
}
} break;