From d7ce8f8081e218d18fe6871f901f7fc5cb3c13dc Mon Sep 17 00:00:00 2001 From: Kenny Root Date: Wed, 24 Feb 2010 23:49:59 -0800 Subject: [PATCH] Create own reference for minSdkVersion in aapt Fix bug where applications defining a minSdkVersion were experiencing transient errors from memory corruption in aapt. Change-Id: I839d5eda7388baac6133e735fa59f9799ca2822d --- Resource.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Resource.cpp b/Resource.cpp index f8c5c38..ae4bd14 100644 --- a/Resource.cpp +++ b/Resource.cpp @@ -224,9 +224,9 @@ static status_t parsePackage(Bundle* bundle, const sp& assets, ssize_t minSdkIndex = block.indexOfAttribute(RESOURCES_ANDROID_NAMESPACE, "minSdkVersion"); if (minSdkIndex >= 0) { - String8 minSdkString = String8( - block.getAttributeStringValue(minSdkIndex, &len)); - bundle->setMinSdkVersion(minSdkString.string()); + const uint16_t* minSdk16 = block.getAttributeStringValue(minSdkIndex, &len); + const char* minSdk8 = strdup(String8(minSdk16).string()); + bundle->setMinSdkVersion(minSdk8); } } } -- 2.45.2