diff options
Diffstat (limited to 'tools/aapt/Command.cpp')
-rw-r--r-- | tools/aapt/Command.cpp | 58 |
1 files changed, 37 insertions, 21 deletions
diff --git a/tools/aapt/Command.cpp b/tools/aapt/Command.cpp index 70044f2..8a0a39c 100644 --- a/tools/aapt/Command.cpp +++ b/tools/aapt/Command.cpp @@ -308,6 +308,7 @@ enum { PUBLIC_KEY_ATTR = 0x010103a6, CATEGORY_ATTR = 0x010103e8, BANNER_ATTR = 0x10103f2, + ISGAME_ATTR = 0x10103f4, }; String8 getComponentName(String8 &pkgName, String8 &componentName) { @@ -516,12 +517,10 @@ static void printFeatureGroup(const FeatureGroup& grp, const size_t numFeatures = grp.features.size(); for (size_t i = 0; i < numFeatures; i++) { - if (!grp.features[i]) { - continue; - } + const bool required = grp.features[i]; const String8& featureName = grp.features.keyAt(i); - printf(" uses-feature: name='%s'\n", + printf(" uses-feature%s: name='%s'\n", (required ? "" : "-not-required"), ResTable::normalizeForOutput(featureName.string()).string()); } @@ -1125,13 +1124,35 @@ int doDump(Bundle* bundle) error.string()); goto bail; } + + String8 banner = AaptXml::getResolvedAttribute(res, tree, BANNER_ATTR, &error); + if (error != "") { + fprintf(stderr, "ERROR getting 'android:banner' attribute: %s\n", + error.string()); + goto bail; + } printf("application: label='%s' ", ResTable::normalizeForOutput(label.string()).string()); - printf("icon='%s'\n", ResTable::normalizeForOutput(icon.string()).string()); + printf("icon='%s'", ResTable::normalizeForOutput(icon.string()).string()); + if (banner != "") { + printf(" banner='%s'", ResTable::normalizeForOutput(banner.string()).string()); + } + printf("\n"); if (testOnly != 0) { printf("testOnly='%d'\n", testOnly); } + int32_t isGame = AaptXml::getResolvedIntegerAttribute(res, tree, + ISGAME_ATTR, 0, &error); + if (error != "") { + fprintf(stderr, "ERROR getting 'android:isGame' attribute: %s\n", + error.string()); + goto bail; + } + if (isGame != 0) { + printf("application-isGame\n"); + } + int32_t debuggable = AaptXml::getResolvedIntegerAttribute(res, tree, DEBUGGABLE_ATTR, 0, &error); if (error != "") { @@ -1819,7 +1840,7 @@ int doDump(Bundle* bundle) } } - if (!grp.features.isEmpty()) { + if (!grp.features.isEmpty()) { printFeatureGroup(grp); } } @@ -2510,22 +2531,17 @@ int doSingleCrunch(Bundle* bundle) int runInDaemonMode(Bundle* bundle) { std::cout << "Ready" << std::endl; - for (std::string line; std::getline(std::cin, line);) { - if (line == "quit") { + for (std::string cmd; std::getline(std::cin, cmd);) { + if (cmd == "quit") { return NO_ERROR; - } - std::stringstream ss; - ss << line; - std::string s; - - std::string command, parameterOne, parameterTwo; - std::getline(ss, command, ' '); - std::getline(ss, parameterOne, ' '); - std::getline(ss, parameterTwo, ' '); - if (command[0] == 's') { - bundle->setSingleCrunchInputFile(parameterOne.c_str()); - bundle->setSingleCrunchOutputFile(parameterTwo.c_str()); - std::cout << "Crunching " << parameterOne << std::endl; + } else if (cmd == "s") { + // Two argument crunch + std::string inputFile, outputFile; + std::getline(std::cin, inputFile); + std::getline(std::cin, outputFile); + bundle->setSingleCrunchInputFile(inputFile.c_str()); + bundle->setSingleCrunchOutputFile(outputFile.c_str()); + std::cout << "Crunching " << inputFile << std::endl; if (doSingleCrunch(bundle) != NO_ERROR) { std::cout << "Error" << std::endl; } |