From bbf429795d0558797e7ac8d1024fa5c16552e96c Mon Sep 17 00:00:00 2001 From: Adam Lesinski Date: Wed, 14 Feb 2018 13:36:09 -0800 Subject: AAPT2: Fix issue with deserializing binary XML We assumed that a raw text value set for an attribute meant there were no compiled values set either. This would only really happen for attributes that did not belong to any namespace (no prefix:), since we always kept their raw string values in case some code relied on it. Bug: 72700446 Test: make aapt2_tests Change-Id: Icba40a1d4b181bfe7cad73131c4dbe5ba7f8b085 --- tools/aapt2/Debug.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'tools/aapt2/Debug.cpp') diff --git a/tools/aapt2/Debug.cpp b/tools/aapt2/Debug.cpp index 249557af921e..f064cb14248f 100644 --- a/tools/aapt2/Debug.cpp +++ b/tools/aapt2/Debug.cpp @@ -450,7 +450,15 @@ class XmlPrinter : public xml::ConstVisitor { if (attr.compiled_value != nullptr) { attr.compiled_value->PrettyPrint(printer_); } else { + printer_->Print("\""); printer_->Print(attr.value); + printer_->Print("\""); + } + + if (!attr.value.empty()) { + printer_->Print(" (Raw: \""); + printer_->Print(attr.value); + printer_->Print("\")"); } printer_->Println(); } -- cgit v1.2.3-59-g8ed1b