From 70fdf76c52224217179529be868c47b3194f1551 Mon Sep 17 00:00:00 2001 From: Pierre Lecesne Date: Mon, 27 Nov 2017 19:29:42 +0000 Subject: [PATCH] AAPT2 - Make raw files of type unknown. Bug: 69791607 Test: Manual. Change-Id: I6ee5ef37fb447ab79d46b57e0dc4eaad84eec723 --- tools/aapt2/ResourceUtils.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/aapt2/ResourceUtils.cpp b/tools/aapt2/ResourceUtils.cpp index 24187d96fec53..02ac86c94b462 100644 --- a/tools/aapt2/ResourceUtils.cpp +++ b/tools/aapt2/ResourceUtils.cpp @@ -707,7 +707,9 @@ std::unique_ptr ParseBinaryResValue(const ResourceType& type, const Config std::unique_ptr file_ref = util::make_unique(dst_pool->MakeRef( str, StringPool::Context(StringPool::Context::kHighPriority, config))); - if (util::EndsWith(*file_ref->path, ".xml")) { + if (type == ResourceType::kRaw) { + file_ref->type = ResourceFile::Type::kUnknown; + } else if (util::EndsWith(*file_ref->path, ".xml")) { file_ref->type = ResourceFile::Type::kBinaryXml; } else if (util::EndsWith(*file_ref->path, ".png")) { file_ref->type = ResourceFile::Type::kPng;