diff options
author | Pierre Lecesne <lecesne@google.com> | 2017-02-01 22:47:03 +0000 |
---|---|---|
committer | Pierre Lecesne <lecesne@google.com> | 2017-02-02 21:35:21 +0000 |
commit | 2599aa4dfd29627a5690460bdcd5568d1029d4dc (patch) | |
tree | e7cf03b50d729f80cb85ec15ba1dc68bda841759 /tools/aapt2/LoadedApk.h | |
parent | ddb80216b9d536be0f2af287f44a41872aa1d809 (diff) |
Add a method LoadedApk::WriteToArchive.
Test: Manually.
Change-Id: I61717204e58ca2bbfba9a52c7aecf27882a853f8
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_; |