Adam Lesinski | 282e181 | 2014-01-23 18:17:42 -0800 | [diff] [blame] | 1 | // |
| 2 | // Copyright 2006 The Android Open Source Project |
| 3 | // |
| 4 | // Some global defines that don't really merit their own header. |
| 5 | // |
| 6 | #ifndef __MAIN_H |
| 7 | #define __MAIN_H |
| 8 | |
| 9 | #include <utils/Log.h> |
| 10 | #include <utils/threads.h> |
| 11 | #include <utils/List.h> |
| 12 | #include <utils/Errors.h> |
Adam Lesinski | fab5087 | 2014-04-16 14:40:42 -0700 | [diff] [blame] | 13 | #include <utils/StrongPointer.h> |
| 14 | |
Adam Lesinski | 282e181 | 2014-01-23 18:17:42 -0800 | [diff] [blame] | 15 | #include "AaptAssets.h" |
Adam Lesinski | fab5087 | 2014-04-16 14:40:42 -0700 | [diff] [blame] | 16 | #include "ApkBuilder.h" |
| 17 | #include "Bundle.h" |
| 18 | #include "ResourceFilter.h" |
Adam Lesinski | 282e181 | 2014-01-23 18:17:42 -0800 | [diff] [blame] | 19 | #include "ZipFile.h" |
| 20 | |
| 21 | |
| 22 | /* Benchmarking Flag */ |
| 23 | //#define BENCHMARK 1 |
| 24 | |
| 25 | #if BENCHMARK |
| 26 | #include <time.h> |
| 27 | #endif /* BENCHMARK */ |
| 28 | |
Adam Lesinski | fab5087 | 2014-04-16 14:40:42 -0700 | [diff] [blame] | 29 | class OutputSet; |
| 30 | |
Adam Lesinski | 282e181 | 2014-01-23 18:17:42 -0800 | [diff] [blame] | 31 | extern int doVersion(Bundle* bundle); |
| 32 | extern int doList(Bundle* bundle); |
| 33 | extern int doDump(Bundle* bundle); |
| 34 | extern int doAdd(Bundle* bundle); |
| 35 | extern int doRemove(Bundle* bundle); |
| 36 | extern int doPackage(Bundle* bundle); |
| 37 | extern int doCrunch(Bundle* bundle); |
| 38 | extern int doSingleCrunch(Bundle* bundle); |
Jerome Dochez | 6f1280c | 2014-09-26 10:21:21 -0700 | [diff] [blame] | 39 | extern int runInDaemonMode(Bundle* bundle); |
Adam Lesinski | 282e181 | 2014-01-23 18:17:42 -0800 | [diff] [blame] | 40 | |
| 41 | extern int calcPercent(long uncompressedLen, long compressedLen); |
| 42 | |
| 43 | extern android::status_t writeAPK(Bundle* bundle, |
Adam Lesinski | fab5087 | 2014-04-16 14:40:42 -0700 | [diff] [blame] | 44 | const android::String8& outputFile, |
| 45 | const android::sp<OutputSet>& outputSet); |
Adam Lesinski | 282e181 | 2014-01-23 18:17:42 -0800 | [diff] [blame] | 46 | |
| 47 | extern android::status_t updatePreProcessedCache(Bundle* bundle); |
| 48 | |
| 49 | extern android::status_t buildResources(Bundle* bundle, |
Adam Lesinski | fab5087 | 2014-04-16 14:40:42 -0700 | [diff] [blame] | 50 | const sp<AaptAssets>& assets, sp<ApkBuilder>& builder); |
Adam Lesinski | 282e181 | 2014-01-23 18:17:42 -0800 | [diff] [blame] | 51 | |
| 52 | extern android::status_t writeResourceSymbols(Bundle* bundle, |
Adam Lesinski | 1e466385 | 2014-08-15 14:47:28 -0700 | [diff] [blame] | 53 | const sp<AaptAssets>& assets, const String8& pkgName, |
| 54 | bool includePrivate, bool emitCallback); |
Adam Lesinski | 282e181 | 2014-01-23 18:17:42 -0800 | [diff] [blame] | 55 | |
| 56 | extern android::status_t writeProguardFile(Bundle* bundle, const sp<AaptAssets>& assets); |
Rohit Agrawal | 86229cb | 2016-04-21 16:29:58 -0700 | [diff] [blame] | 57 | extern android::status_t writeMainDexProguardFile(Bundle* bundle, const sp<AaptAssets>& assets); |
Adam Lesinski | 282e181 | 2014-01-23 18:17:42 -0800 | [diff] [blame] | 58 | |
| 59 | extern bool isValidResourceType(const String8& type); |
| 60 | |
Adam Lesinski | 282e181 | 2014-01-23 18:17:42 -0800 | [diff] [blame] | 61 | extern status_t filterResources(Bundle* bundle, const sp<AaptAssets>& assets); |
| 62 | |
| 63 | int dumpResources(Bundle* bundle); |
| 64 | |
Adam Lesinski | 282e181 | 2014-01-23 18:17:42 -0800 | [diff] [blame] | 65 | status_t writeDependencyPreReqs(Bundle* bundle, const sp<AaptAssets>& assets, |
| 66 | FILE* fp, bool includeRaw); |
Adam Lesinski | e572c01 | 2014-09-19 15:10:04 -0700 | [diff] [blame] | 67 | |
| 68 | android::String8 parseResourceName(const String8& pathLeaf); |
| 69 | |
Adam Lesinski | 282e181 | 2014-01-23 18:17:42 -0800 | [diff] [blame] | 70 | #endif // __MAIN_H |