diff options
author | Adam Lesinski <adamlesinski@google.com> | 2015-04-21 13:56:10 -0700 |
---|---|---|
committer | Adam Lesinski <adamlesinski@google.com> | 2015-04-22 17:34:55 -0700 |
commit | d5c4f8723c2b2c85b588fa07a5d4e7afb671d257 (patch) | |
tree | 33d2fcaa40a7abf16041ceb522b799ef5534a97f /tools/aapt2/BinaryResourceParser.cpp | |
parent | d981c0d4f01bb25ba378e865952cf9d48109b9fe (diff) | |
download | frameworks_base-d5c4f8723c2b2c85b588fa07a5d4e7afb671d257.zip frameworks_base-d5c4f8723c2b2c85b588fa07a5d4e7afb671d257.tar.gz frameworks_base-d5c4f8723c2b2c85b588fa07a5d4e7afb671d257.tar.bz2 |
Properly mangle file names
Change-Id: I49c0f82e8c06f056198eb64b8369d83403b74321
Diffstat (limited to 'tools/aapt2/BinaryResourceParser.cpp')
-rw-r--r-- | tools/aapt2/BinaryResourceParser.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/tools/aapt2/BinaryResourceParser.cpp b/tools/aapt2/BinaryResourceParser.cpp index 71016c1..326a2ac 100644 --- a/tools/aapt2/BinaryResourceParser.cpp +++ b/tools/aapt2/BinaryResourceParser.cpp @@ -603,6 +603,13 @@ std::unique_ptr<Item> BinaryResourceParser::parseValue(const ResourceNameRef& na mTable->getValueStringPool().makeRef( styleStr, StringPool::Context{1, config})); } else { + if (name.type != ResourceType::kString && + util::stringStartsWith<char16_t>(str, u"res/")) { + // This must be a FileReference. + return util::make_unique<FileReference>(mTable->getValueStringPool().makeRef( + str, StringPool::Context{ 0, config })); + } + // There are no styles associated with this string, so treat it as // a simple string. return util::make_unique<String>( |