X-Git-Url: https://git.saurik.com/android/aapt.git/blobdiff_plain/1423619ab908d03f8fcff4d4dd8ee359c4f2dddf..2256a61efe4b45bda947ac32f06b583284805753:/Resource.cpp diff --git a/Resource.cpp b/Resource.cpp index c0ebb59..cafd635 100644 --- a/Resource.cpp +++ b/Resource.cpp @@ -226,7 +226,7 @@ static status_t parsePackage(Bundle* bundle, const sp& assets, if (minSdkIndex >= 0) { const uint16_t* minSdk16 = block.getAttributeStringValue(minSdkIndex, &len); const char* minSdk8 = strdup(String8(minSdk16).string()); - bundle->setMinSdkVersion(minSdk8); + bundle->setManifestMinSdkVersion(minSdk8); } } } @@ -611,7 +611,8 @@ void addTagAttribute(const sp& node, const char* ns8, const String16 attr(attr8); if (node->getAttribute(ns, attr) != NULL) { - fprintf(stderr, "Warning: AndroidManifest.xml already defines %s (in %s)\n", + fprintf(stderr, "Warning: AndroidManifest.xml already defines %s (in %s);" + " using existing value in manifest.\n", String8(attr).string(), String8(ns).string()); return; } @@ -768,7 +769,13 @@ status_t buildResources(Bundle* bundle, const sp& assets) // Standard flags for compiled XML and optional UTF-8 encoding int xmlFlags = XML_COMPILE_STANDARD_RESOURCE; - if (bundle->getUTF8()) { + + /* Only enable UTF-8 if the caller of aapt didn't specifically + * request UTF-16 encoding and the parameters of this package + * allow UTF-8 to be used. + */ + if (!bundle->getWantUTF16() + && bundle->isMinSdkAtLeast(SDK_FROYO)) { xmlFlags |= XML_COMPILE_UTF8; }