diff options
| author | 2017-02-03 18:49:34 +0000 | |
|---|---|---|
| committer | 2017-02-03 18:49:37 +0000 | |
| commit | 1d23c581645c891f5d24247e766fe1f06c616d6d (patch) | |
| tree | 13f72c86933589cf46c1db963206f3e0c557988c /tools/aapt2/LoadedApk.h | |
| parent | e7da87a41f7860c2240b744947656d8c298bba95 (diff) | |
| parent | 2599aa4dfd29627a5690460bdcd5568d1029d4dc (diff) | |
Merge "Add a method LoadedApk::WriteToArchive."
Diffstat (limited to 'tools/aapt2/LoadedApk.h')
| -rw-r--r-- | tools/aapt2/LoadedApk.h | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/tools/aapt2/LoadedApk.h b/tools/aapt2/LoadedApk.h index 0cc2d22eb7b7..f8878d13ae35 100644 --- a/tools/aapt2/LoadedApk.h +++ b/tools/aapt2/LoadedApk.h @@ -19,12 +19,11 @@ #include "androidfw/StringPiece.h" -#include "io/ZipArchive.h" #include "ResourceTable.h" +#include "flatten/Archive.h" +#include "io/ZipArchive.h" #include "unflatten/BinaryResourceParser.h" -using android::StringPiece; - namespace aapt { /** Info about an APK loaded in memory. */ @@ -42,8 +41,14 @@ class LoadedApk { const Source& GetSource() { return source_; } - static std::unique_ptr<LoadedApk> LoadApkFromPath( - IAaptContext* context, const StringPiece& path); + /** + * Writes the APK on disk at the given path, while also removing the resource + * files that are not referenced in the resource table. + */ + bool WriteToArchive(IAaptContext* context, IArchiveWriter* writer); + + static std::unique_ptr<LoadedApk> LoadApkFromPath(IAaptContext* context, + const android::StringPiece& path); private: Source source_; |