diff options
author | Ryan Mitchell <rtmitchell@google.com> | 2018-11-13 10:40:07 -0800 |
---|---|---|
committer | Ryan Mitchell <rtmitchell@google.com> | 2018-11-15 11:37:01 -0800 |
commit | 4e9a922ede24f7f7bfe793321f7328623ee2a061 (patch) | |
tree | b74d2ecefc7e6902ff37c1be7798adc5861ae13d /tools/aapt2/Debug.cpp | |
parent | 67dd91e6a301c9dd15f4f95ac715064534296a53 (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/Debug.cpp')
-rw-r--r-- | tools/aapt2/Debug.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/aapt2/Debug.cpp b/tools/aapt2/Debug.cpp index 0bc5221245ca..583f14ac0cbd 100644 --- a/tools/aapt2/Debug.cpp +++ b/tools/aapt2/Debug.cpp @@ -431,7 +431,7 @@ void Debug::DumpHex(const void* data, size_t len) { void Debug::DumpResStringPool(const android::ResStringPool* pool, text::Printer* printer) { using namespace android; - + if (pool->getError() == NO_INIT) { printer->Print("String pool is unitialized.\n"); return; @@ -460,7 +460,7 @@ void Debug::DumpResStringPool(const android::ResStringPool* pool, text::Printer* const size_t NS = pool->size(); for (size_t s=0; s<NS; s++) { String8 str = pool->string8ObjectAt(s); - printer->Print(StringPrintf("String #%zd : %s\n", s, str.string())); + printer->Print(StringPrintf("String #%zd: %s\n", s, str.string())); } } |