diff options
| author | 2010-01-12 16:31:14 -0800 | |
|---|---|---|
| committer | 2010-01-12 16:31:14 -0800 | |
| commit | a1d08886ec8549878ad16c19754a3239706fb61b (patch) | |
| tree | 9048290ec3f48e434c6ecf01364afa8861f182d5 | |
| parent | 8acdb201bdad2cd03c07ebad9cda29f7971ed164 (diff) | |
| parent | 4199528aab2cbc3ba3c6540670fabb2040c8e081 (diff) | |
Merge "Only output proguard keep for nonempty attribute name in the AndroidManifest.xml." into eclair
| -rw-r--r-- | tools/aapt/Resource.cpp | 48 |
1 files changed, 25 insertions, 23 deletions
diff --git a/tools/aapt/Resource.cpp b/tools/aapt/Resource.cpp index fdcada44a50d..02b46aa50852 100644 --- a/tools/aapt/Resource.cpp +++ b/tools/aapt/Resource.cpp @@ -1745,31 +1745,33 @@ writeProguardForAndroidManifest(ProguardKeepSet* keep, const sp<AaptAssets>& 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); + } } } } |