diff options
author | Ying Wang <wangying@google.com> | 2010-01-12 16:34:13 -0800 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2010-01-12 16:34:13 -0800 |
commit | b4f41119044e5ec7f7b76ed4ac02b5cfbaeb474d (patch) | |
tree | 3386b8095b51f8d56238952cd1d0af916e1c3bad | |
parent | 202a6734fd39289257955d404edf7a1165f6e480 (diff) | |
parent | a1d08886ec8549878ad16c19754a3239706fb61b (diff) | |
download | frameworks_base-b4f41119044e5ec7f7b76ed4ac02b5cfbaeb474d.zip frameworks_base-b4f41119044e5ec7f7b76ed4ac02b5cfbaeb474d.tar.gz frameworks_base-b4f41119044e5ec7f7b76ed4ac02b5cfbaeb474d.tar.bz2 |
am a1d08886: Merge "Only output proguard keep for nonempty attribute name in the AndroidManifest.xml." into eclair
Merge commit 'a1d08886ec8549878ad16c19754a3239706fb61b' into eclair-plus-aosp
* commit 'a1d08886ec8549878ad16c19754a3239706fb61b':
Only output proguard keep for nonempty attribute name in the AndroidManifest.xml.
-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 fdcada4..02b46aa 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); + } } } } |