X-Git-Url: https://git.saurik.com/android/aapt.git/blobdiff_plain/21c5c61adf6057d794d60b3623af4506bcc182e6..9171b2f37058b37bf08464cb67286dd2e503c89a:/Resource.cpp diff --git a/Resource.cpp b/Resource.cpp index 1084992..02b46aa 100644 --- a/Resource.cpp +++ b/Resource.cpp @@ -1285,10 +1285,10 @@ static status_t writeLayoutClasses( hasTable = true; fprintf(fp, "%s

Includes the following attributes:

\n" - "%s \n" + "%s
\n" "%s \n" "%s \n" - "%s \n", + "%s \n", indentStr, indentStr, indentStr, @@ -1322,7 +1322,7 @@ static status_t writeLayoutClasses( } String16 name(name8); fixupSymbol(&name); - fprintf(fp, "%s \n", + fprintf(fp, "%s \n", indentStr, nclassName.string(), String8(name).string(), assets->getPackage().string(), @@ -1745,31 +1745,33 @@ writeProguardForAndroidManifest(ProguardKeepSet* keep, const sp& ass fprintf(stderr, "ERROR: %s\n", error.string()); return -1; } - // asdf --> package.asdf - // .asdf .a.b --> package.asdf package.a.b - // asdf.adsf --> asdf.asdf - String8 rule("-keep class "); - const char* p = name.string(); - const char* q = strchr(p, '.'); - if (p == q) { - rule += pkg; - rule += name; - } else if (q == NULL) { - rule += pkg; - rule += "."; - rule += name; - } else { - rule += name; - } + if (name.length() > 0) { + // asdf --> package.asdf + // .asdf .a.b --> package.asdf package.a.b + // asdf.adsf --> asdf.asdf + String8 rule("-keep class "); + const char* p = name.string(); + const char* q = strchr(p, '.'); + if (p == q) { + rule += pkg; + rule += name; + } else if (q == NULL) { + rule += pkg; + rule += "."; + rule += name; + } else { + rule += name; + } - String8 location = tag; - location += " "; - location += assFile->getSourceFile(); - char lineno[20]; - sprintf(lineno, ":%d", tree.getLineNumber()); - location += lineno; + String8 location = tag; + location += " "; + location += assFile->getSourceFile(); + char lineno[20]; + sprintf(lineno, ":%d", tree.getLineNumber()); + location += lineno; - keep->add(rule, location); + keep->add(rule, location); + } } } }
AttributeSummary
AttributeDescription
{@link #%s_%s %s:%s}%s
{@link #%s_%s %s:%s}%s