X-Git-Url: https://git.saurik.com/android/aapt.git/blobdiff_plain/2ca01a3759d4a7f39856ff90541b5f267d2c6c13..bd8c05dde553c7da896332f1fae7b3c40da9951c:/ResourceTable.cpp diff --git a/ResourceTable.cpp b/ResourceTable.cpp index a389bfb..a2f085a 100644 --- a/ResourceTable.cpp +++ b/ResourceTable.cpp @@ -27,6 +27,20 @@ status_t compileXmlFile(const sp& assets, return compileXmlFile(assets, root, target, table, options); } +status_t compileXmlFile(const sp& assets, + const sp& target, + const sp& outTarget, + ResourceTable* table, + int options) +{ + sp root = XMLNode::parse(target); + if (root == NULL) { + return UNKNOWN_ERROR; + } + + return compileXmlFile(assets, root, outTarget, table, options); +} + status_t compileXmlFile(const sp& assets, const sp& root, const sp& target, @@ -382,7 +396,7 @@ static status_t compileAttribute(const sp& in, } attr.createIfNeeded(outTable); if (!attr.hasErrors) { - char buf[10]; + char buf[11]; sprintf(buf, "%d", l10n_required); err = outTable->addBag(attr.sourcePos, myPackage, attr16, attr.ident, String16(""), String16("^l10n"), String16(buf), NULL, NULL); @@ -2369,7 +2383,7 @@ ResourceTable::validateLocalizations(void) if (configSet.find(region) == configSet.end()) { if (configSet.count(defaultLocale) == 0) { fprintf(stdout, "aapt: warning: " - "*** string '%s' has no default or required localization " + "**** string '%s' has no default or required localization " "for '%s' in %s\n", String8(nameIter->first).string(), config.string(), @@ -2513,9 +2527,11 @@ status_t ResourceTable::flatten(Bundle* bundle, const sp& dest) const size_t N = mOrderedPackages.size(); size_t pi; + bool useUTF8 = !bundle->getWantUTF16() && bundle->isMinSdkAtLeast(SDK_FROYO); + // Iterate through all data, collecting all values (strings, // references, etc). - StringPool valueStrings = StringPool(false, bundle->getUTF8()); + StringPool valueStrings = StringPool(false, useUTF8); for (pi=0; pi p = mOrderedPackages.itemAt(pi); if (p->getTypes().size() == 0) { @@ -2523,8 +2539,8 @@ status_t ResourceTable::flatten(Bundle* bundle, const sp& dest) continue; } - StringPool typeStrings = StringPool(false, bundle->getUTF8()); - StringPool keyStrings = StringPool(false, bundle->getUTF8()); + StringPool typeStrings = StringPool(false, useUTF8); + StringPool keyStrings = StringPool(false, useUTF8); const size_t N = p->getOrderedTypes().size(); for (size_t ti=0; ti