| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
#ifndef AAPT2_APKSPLITTER_H |
| 18 |
#define AAPT2_APKSPLITTER_H |
| 19 |
|
| 20 |
#include <memory> |
| 21 |
#include <string> |
| 22 |
#include <unordered_set> |
| 23 |
#include <vector> |
| 24 |
|
| 25 |
#include "androidfw/ConfigDescription.h" |
| 26 |
|
| 27 |
#include "Diagnostics.h" |
| 28 |
#include "LoadedApk.h" |
| 29 |
#include "configuration/ConfigurationParser.h" |
| 30 |
|
| 31 |
namespace aapt { |
| 32 |
|
| 33 |
struct MultiApkGeneratorOptions { |
| 34 |
std::string out_dir; |
| 35 |
std::vector<configuration::OutputArtifact> apk_artifacts; |
| 36 |
TableFlattenerOptions table_flattener_options; |
| 37 |
std::unordered_set<std::string> kept_artifacts; |
| 38 |
}; |
| 39 |
|
| 40 |
|
| 41 |
|
| 42 |
|
| 43 |
|
| 44 |
class MultiApkGenerator { |
| 45 |
public: |
| 46 |
MultiApkGenerator(LoadedApk* apk, IAaptContext* context); |
| 47 |
|
| 48 |
|
| 49 |
|
| 50 |
|
| 51 |
|
| 52 |
bool FromBaseApk(const MultiApkGeneratorOptions& options); |
| 53 |
|
| 54 |
protected: |
| 55 |
virtual std::unique_ptr<ResourceTable> FilterTable(IAaptContext* context, |
| 56 |
const configuration::OutputArtifact& artifact, |
| 57 |
const ResourceTable& old_table, |
| 58 |
FilterChain* chain); |
| 59 |
|
| 60 |
private: |
| 61 |
IDiagnostics* GetDiagnostics() { |
| 62 |
return context_->GetDiagnostics(); |
| 63 |
} |
| 64 |
|
| 65 |
bool UpdateManifest(const configuration::OutputArtifact& artifact, |
| 66 |
std::unique_ptr<xml::XmlResource>* updated_manifest, IDiagnostics* diag); |
| 67 |
|
| 68 |
|
| 69 |
|
| 70 |
|
| 71 |
void AddScreens(const android::ConfigDescription& config, xml::Element* parent); |
| 72 |
|
| 73 |
LoadedApk* apk_; |
| 74 |
IAaptContext* context_; |
| 75 |
}; |
| 76 |
|
| 77 |
} |
| 78 |
|
| 79 |
#endif |