blob: a493842b8d10344e27738461add42b46f4dbbe05 [file] [log] [blame]
Adam Lesinski282e1812014-01-23 18:17:42 -08001//
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 Lesinskifab50872014-04-16 14:40:42 -070013#include <utils/StrongPointer.h>
14
Adam Lesinski282e1812014-01-23 18:17:42 -080015#include "AaptAssets.h"
Adam Lesinskifab50872014-04-16 14:40:42 -070016#include "ApkBuilder.h"
17#include "Bundle.h"
18#include "ResourceFilter.h"
Adam Lesinski282e1812014-01-23 18:17:42 -080019#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 Lesinskifab50872014-04-16 14:40:42 -070029class OutputSet;
30
Adam Lesinski282e1812014-01-23 18:17:42 -080031extern int doVersion(Bundle* bundle);
32extern int doList(Bundle* bundle);
33extern int doDump(Bundle* bundle);
34extern int doAdd(Bundle* bundle);
35extern int doRemove(Bundle* bundle);
36extern int doPackage(Bundle* bundle);
37extern int doCrunch(Bundle* bundle);
38extern int doSingleCrunch(Bundle* bundle);
Jerome Dochez6f1280c2014-09-26 10:21:21 -070039extern int runInDaemonMode(Bundle* bundle);
Adam Lesinski282e1812014-01-23 18:17:42 -080040
41extern int calcPercent(long uncompressedLen, long compressedLen);
42
43extern android::status_t writeAPK(Bundle* bundle,
Adam Lesinskifab50872014-04-16 14:40:42 -070044 const android::String8& outputFile,
45 const android::sp<OutputSet>& outputSet);
Adam Lesinski282e1812014-01-23 18:17:42 -080046
47extern android::status_t updatePreProcessedCache(Bundle* bundle);
48
49extern android::status_t buildResources(Bundle* bundle,
Adam Lesinskifab50872014-04-16 14:40:42 -070050 const sp<AaptAssets>& assets, sp<ApkBuilder>& builder);
Adam Lesinski282e1812014-01-23 18:17:42 -080051
52extern android::status_t writeResourceSymbols(Bundle* bundle,
Adam Lesinski1e4663852014-08-15 14:47:28 -070053 const sp<AaptAssets>& assets, const String8& pkgName,
54 bool includePrivate, bool emitCallback);
Adam Lesinski282e1812014-01-23 18:17:42 -080055
56extern android::status_t writeProguardFile(Bundle* bundle, const sp<AaptAssets>& assets);
Rohit Agrawal86229cb2016-04-21 16:29:58 -070057extern android::status_t writeMainDexProguardFile(Bundle* bundle, const sp<AaptAssets>& assets);
Adam Lesinski282e1812014-01-23 18:17:42 -080058
59extern bool isValidResourceType(const String8& type);
60
Adam Lesinski282e1812014-01-23 18:17:42 -080061extern status_t filterResources(Bundle* bundle, const sp<AaptAssets>& assets);
62
63int dumpResources(Bundle* bundle);
64
Adam Lesinski282e1812014-01-23 18:17:42 -080065status_t writeDependencyPreReqs(Bundle* bundle, const sp<AaptAssets>& assets,
66 FILE* fp, bool includeRaw);
Adam Lesinskie572c012014-09-19 15:10:04 -070067
68android::String8 parseResourceName(const String8& pathLeaf);
69
Adam Lesinski282e1812014-01-23 18:17:42 -080070#endif // __MAIN_H