From d5c4f8723c2b2c85b588fa07a5d4e7afb671d257 Mon Sep 17 00:00:00 2001 From: Adam Lesinski Date: Tue, 21 Apr 2015 13:56:10 -0700 Subject: Properly mangle file names Change-Id: I49c0f82e8c06f056198eb64b8369d83403b74321 --- tools/aapt2/BinaryResourceParser.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'tools/aapt2/BinaryResourceParser.cpp') diff --git a/tools/aapt2/BinaryResourceParser.cpp b/tools/aapt2/BinaryResourceParser.cpp index 71016c18e974..326a2ac091a7 100644 --- a/tools/aapt2/BinaryResourceParser.cpp +++ b/tools/aapt2/BinaryResourceParser.cpp @@ -603,6 +603,13 @@ std::unique_ptr BinaryResourceParser::parseValue(const ResourceNameRef& na mTable->getValueStringPool().makeRef( styleStr, StringPool::Context{1, config})); } else { + if (name.type != ResourceType::kString && + util::stringStartsWith(str, u"res/")) { + // This must be a FileReference. + return util::make_unique(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( -- cgit v1.2.3-59-g8ed1b