Fixes a few minor problems with AAPT
- Fixes casting problems with stricter compilers
- Adds a couple of missing ifdef guards
This is a first step toward being able to generate APKs on the fly on the device.
Bug: 2766918
Change-Id: Icaaee5a4032afa313256add321b447443861dd85
diff --git a/tools/aapt/Command.cpp b/tools/aapt/Command.cpp
index 83057b8..c40af80 100644
--- a/tools/aapt/Command.cpp
+++ b/tools/aapt/Command.cpp
@@ -197,8 +197,10 @@
if (&res == NULL) {
printf("\nNo resource table found.\n");
} else {
+#ifndef HAVE_ANDROID_OS
printf("\nResource table:\n");
res.print(false);
+#endif
}
Asset* manifestAsset = assets.openNonAsset("AndroidManifest.xml",
@@ -388,8 +390,9 @@
}
if (strcmp("resources", option) == 0) {
+#ifndef HAVE_ANDROID_OS
res.print(bundle->getValues());
-
+#endif
} else if (strcmp("xmltree", option) == 0) {
if (bundle->getFileSpecCount() < 3) {
fprintf(stderr, "ERROR: no dump xmltree resource file specified\n");