X-Git-Url: https://git.saurik.com/android/aapt.git/blobdiff_plain/ec94a847fa1fe53d8f41500baec0a8f5980c9b8b..853cbd5801d6c83dca7ee7ab8f3392b16bde7c96:/Command.cpp?ds=inline diff --git a/Command.cpp b/Command.cpp index d428fef..b98925b 100644 --- a/Command.cpp +++ b/Command.cpp @@ -7,6 +7,7 @@ #include "Bundle.h" #include "ResourceFilter.h" #include "ResourceTable.h" +#include "Images.h" #include "XMLNode.h" #include @@ -1204,7 +1205,9 @@ int doDump(Bundle* bundle) } // If the application has requested WRITE_EXTERNAL_STORAGE, we will - // force them to always take READ_EXTERNAL_STORAGE as well. + // force them to always take READ_EXTERNAL_STORAGE as well. We always + // do this (regardless of target API version) because we can't have + // an app with write permission but not read permission. if (!hasReadExternalStoragePermission && hasWriteExternalStoragePermission) { printf("uses-permission:'android.permission.READ_EXTERNAL_STORAGE'\n"); printf("uses-implied-permission:'android.permission.READ_EXTERNAL_STORAGE'," \ @@ -1837,6 +1840,21 @@ int doCrunch(Bundle* bundle) return NO_ERROR; } +/* + * Do PNG Crunching on a single flag + * -i points to a single png file + * -o points to a single png output file + */ +int doSingleCrunch(Bundle* bundle) +{ + fprintf(stdout, "Crunching single PNG file: %s\n", bundle->getSingleCrunchInputFile()); + fprintf(stdout, "\tOutput file: %s\n", bundle->getSingleCrunchOutputFile()); + + String8 input(bundle->getSingleCrunchInputFile()); + String8 output(bundle->getSingleCrunchOutputFile()); + return preProcessImageToCache(bundle, input, output); +} + char CONSOLE_DATA[2925] = { 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 95, 46, 32, 32, 32, 32, 32, 32, 32, 32, 32,