Properly mangle file names

Change-Id: I49c0f82e8c06f056198eb64b8369d83403b74321
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 @@
                     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>(