diff options
| author | Android (Google) Code Review <android-gerrit@google.com> | 2009-06-19 16:44:07 -0700 |
|---|---|---|
| committer | The Android Open Source Project <initial-contribution@android.com> | 2009-06-19 16:44:07 -0700 |
| commit | fc68623c03439db95401a18a435dbc491cd7f6fd (patch) | |
| tree | 318e9310cdb3fd31b912cc11b5f3b65d3d349f3f /tools/aapt | |
| parent | b0774438ea90ce379ac3f20895f95302248a3844 (diff) | |
| parent | 1585bd24c10d16351f89e32dddbfa799f18db6bd (diff) | |
| download | frameworks_base-fc68623c03439db95401a18a435dbc491cd7f6fd.zip frameworks_base-fc68623c03439db95401a18a435dbc491cd7f6fd.tar.gz frameworks_base-fc68623c03439db95401a18a435dbc491cd7f6fd.tar.bz2 | |
am 1585bd24: Merge change 4828 into donut
Merge commit '1585bd24c10d16351f89e32dddbfa799f18db6bd'
* commit '1585bd24c10d16351f89e32dddbfa799f18db6bd':
Report densities in badging, debugging for nine patch bug.
Diffstat (limited to 'tools/aapt')
| -rw-r--r-- | tools/aapt/Bundle.h | 4 | ||||
| -rw-r--r-- | tools/aapt/Command.cpp | 27 | ||||
| -rw-r--r-- | tools/aapt/Main.cpp | 6 |
3 files changed, 32 insertions, 5 deletions
diff --git a/tools/aapt/Bundle.h b/tools/aapt/Bundle.h index 9e712b8..a671bd7 100644 --- a/tools/aapt/Bundle.h +++ b/tools/aapt/Bundle.h @@ -37,6 +37,7 @@ public: mForce(false), mGrayscaleTolerance(0), mMakePackageDirs(false), mUpdate(false), mExtending(false), mRequireLocalization(false), mPseudolocalize(false), + mValues(false), mCompressionMethod(0), mOutputAPKFile(NULL), mAssetSourceDir(NULL), mAndroidManifestFile(NULL), mPublicOutputFile(NULL), @@ -75,6 +76,8 @@ public: void setRequireLocalization(bool val) { mRequireLocalization = val; } bool getPseudolocalize(void) const { return mPseudolocalize; } void setPseudolocalize(bool val) { mPseudolocalize = val; } + bool getValues(void) const { return mValues; } + void setValues(bool val) { mValues = val; } int getCompressionMethod(void) const { return mCompressionMethod; } void setCompressionMethod(int val) { mCompressionMethod = val; } const char* getOutputAPKFile() const { return mOutputAPKFile; } @@ -154,6 +157,7 @@ private: bool mExtending; bool mRequireLocalization; bool mPseudolocalize; + bool mValues; int mCompressionMethod; const char* mOutputAPKFile; const char* mAssetSourceDir; diff --git a/tools/aapt/Command.cpp b/tools/aapt/Command.cpp index 0e889f5..dcda379 100644 --- a/tools/aapt/Command.cpp +++ b/tools/aapt/Command.cpp @@ -198,7 +198,7 @@ int doList(Bundle* bundle) printf("\nNo resource table found.\n"); } else { printf("\nResource table:\n"); - res.print(); + res.print(false); } Asset* manifestAsset = assets.openNonAsset("AndroidManifest.xml", @@ -382,7 +382,7 @@ int doDump(Bundle* bundle) } if (strcmp("resources", option) == 0) { - res.print(); + res.print(bundle->getValues()); } else if (strcmp("xmltree", option) == 0) { if (bundle->getFileSpecCount() < 3) { @@ -734,11 +734,12 @@ int doDump(Bundle* bundle) activityIcon.string()); } } + printf("locales:"); Vector<String8> locales; res.getLocales(&locales); - const size_t N = locales.size(); - for (size_t i=0; i<N; i++) { + const size_t NL = locales.size(); + for (size_t i=0; i<NL; i++) { const char* localeStr = locales[i].string(); if (localeStr == NULL || strlen(localeStr) == 0) { localeStr = "--_--"; @@ -746,6 +747,24 @@ int doDump(Bundle* bundle) printf(" '%s'", localeStr); } printf("\n"); + + Vector<ResTable_config> configs; + res.getConfigurations(&configs); + SortedVector<int> densities; + const size_t NC = configs.size(); + for (size_t i=0; i<NC; i++) { + int dens = configs[i].density; + if (dens == 0) dens = 160; + densities.add(dens); + } + + printf("densities:"); + const size_t ND = densities.size(); + for (size_t i=0; i<ND; i++) { + printf(" '%d'", densities[i]); + } + printf("\n"); + AssetDir* dir = assets.openNonAssetDir(assetsCookie, "lib"); if (dir != NULL) { if (dir->getFileCount() > 0) { diff --git a/tools/aapt/Main.cpp b/tools/aapt/Main.cpp index a33b4d7..882714c 100644 --- a/tools/aapt/Main.cpp +++ b/tools/aapt/Main.cpp @@ -47,7 +47,7 @@ void usage(void) " %s l[ist] [-v] [-a] file.{zip,jar,apk}\n" " List contents of Zip-compatible archive.\n\n", gProgName); fprintf(stderr, - " %s d[ump] WHAT file.{apk} [asset [asset ...]]\n" + " %s d[ump] [--values] WHAT file.{apk} [asset [asset ...]]\n" " badging Print the label and icon for the app declared in APK.\n" " permissions Print the permissions from the APK.\n" " resources Print the resource table from the APK.\n" @@ -125,6 +125,8 @@ void usage(void) " inserts android:targetSdkVersion in to manifest.\n" " --max-sdk-version\n" " inserts android:maxSdkVersion in to manifest.\n" + " --values\n" + " when used with \"dump resources\" also includes resource values.\n" " --version-code\n" " inserts android:versionCode in to manifest.\n" " --version-name\n" @@ -398,6 +400,8 @@ int main(int argc, char* const argv[]) goto bail; } bundle.setVersionName(argv[0]); + } else if (strcmp(cp, "-values") == 0) { + bundle.setValues(true); } else { fprintf(stderr, "ERROR: Unknown option '-%s'\n", cp); wantUsage = true; |
