From: Android (Google) Code Review Date: Fri, 19 Jun 2009 23:44:07 +0000 (-0700) Subject: am 1585bd24: Merge change 4828 into donut X-Git-Url: https://git.saurik.com/android/aapt.git/commitdiff_plain/e2b8897082298875339f82d006c3742086cd83dd?ds=inline;hp=-c am 1585bd24: Merge change 4828 into donut Merge commit '1585bd24c10d16351f89e32dddbfa799f18db6bd' * commit '1585bd24c10d16351f89e32dddbfa799f18db6bd': Report densities in badging, debugging for nine patch bug. --- e2b8897082298875339f82d006c3742086cd83dd diff --combined Bundle.h index 9e712b8,a6fedf3..a671bd7 --- a/Bundle.h +++ b/Bundle.h @@@ -7,10 -7,7 +7,10 @@@ #define __BUNDLE_H #include -#include // android +#include +#include +#include +#include #include #include @@@ -37,6 -34,7 +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 -73,8 +76,8 @@@ 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 -154,7 +157,7 @@@ private bool mExtending; bool mRequireLocalization; bool mPseudolocalize; + bool mValues; int mCompressionMethod; const char* mOutputAPKFile; const char* mAssetSourceDir; diff --combined Command.cpp index 0e889f5,503f661..dcda379 --- a/Command.cpp +++ b/Command.cpp @@@ -8,10 -8,8 +8,10 @@@ #include "ResourceTable.h" #include "XMLNode.h" -#include -#include +#include +#include +#include +#include #include #include @@@ -198,7 -196,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 -380,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 -732,12 +734,12 @@@ activityIcon.string()); } } + printf("locales:"); Vector locales; res.getLocales(&locales); - const size_t N = locales.size(); - for (size_t i=0; i configs; + res.getConfigurations(&configs); + SortedVector densities; + const size_t NC = configs.size(); + for (size_t i=0; igetFileCount() > 0) { diff --combined Main.cpp index a33b4d7,12a0445..882714c --- a/Main.cpp +++ b/Main.cpp @@@ -6,10 -6,8 +6,10 @@@ #include "Main.h" #include "Bundle.h" -#include -#include +#include +#include +#include +#include #include #include @@@ -47,7 -45,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 -123,8 +125,8 @@@ " 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 -398,8 +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;