From: Dianne Hackborn Date: Sun, 23 Jan 2011 20:57:33 +0000 (-0800) Subject: am bcf2adeb: Merge "aapt: Allow raw "%" in unformatted string-arrays" X-Git-Url: https://git.saurik.com/android/aapt.git/commitdiff_plain/c7f6ad837eb3f04dafbc96939d18fe90afd38dbf?hp=b3a9ca1e671a74fe41d2d9cd97acc2553f3a6bc7 am bcf2adeb: Merge "aapt: Allow raw "%" in unformatted string-arrays" * commit 'bcf2adeb10c41becec3baa2bcb8de9212272399a': aapt: Allow raw "%" in unformatted string-arrays --- diff --git a/ResourceTable.cpp b/ResourceTable.cpp index fc576a6..818c3c6 100644 --- a/ResourceTable.cpp +++ b/ResourceTable.cpp @@ -1322,6 +1322,22 @@ status_t compileResourceFile(Bundle* bundle, } } } else if (strcmp16(block.getElementName(&len), string_array16.string()) == 0) { + // Check whether these strings need valid formats. + // (simplified form of what string16 does above) + size_t n = block.getAttributeCount(); + for (size_t i = 0; i < n; i++) { + size_t length; + const uint16_t* attr = block.getAttributeName(i, &length); + if (strcmp16(attr, translatable16.string()) == 0 + || strcmp16(attr, formatted16.string()) == 0) { + const uint16_t* value = block.getAttributeStringValue(i, &length); + if (strcmp16(value, false16.string()) == 0) { + curIsFormatted = false; + break; + } + } + } + curTag = &string_array16; curType = array16; curFormat = ResTable_map::TYPE_REFERENCE|ResTable_map::TYPE_STRING;