diff options
author | Adam Lesinski <adamlesinski@google.com> | 2017-10-31 17:44:39 -0700 |
---|---|---|
committer | Adam Lesinski <adamlesinski@google.com> | 2017-11-01 10:58:28 -0700 |
commit | 8780eb6e4918ae24fb1ae74d631042c32e41dc3d (patch) | |
tree | 938e18951a562fcd043ac779c7e758444b4bf0a8 /tools/aapt2/optimize/MultiApkGenerator.cpp | |
parent | 4f340a4f8b50b29b562407e39563ee78a90bea3f (diff) |
AAPT2: Add convert command
This command allows a developer to convert their proto APK
(generated from the link phase using --proto-format) into
a binary APK suitable for use on device.
aapt2 convert -o output.apk input.apk
Test: manual + make aapt2_tests
Change-Id: I10a7c33bb4b57006d01fe00a8bf92f78e04e7e50
Diffstat (limited to 'tools/aapt2/optimize/MultiApkGenerator.cpp')
-rw-r--r-- | tools/aapt2/optimize/MultiApkGenerator.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/tools/aapt2/optimize/MultiApkGenerator.cpp b/tools/aapt2/optimize/MultiApkGenerator.cpp index 680308871af7..473693ce4917 100644 --- a/tools/aapt2/optimize/MultiApkGenerator.cpp +++ b/tools/aapt2/optimize/MultiApkGenerator.cpp @@ -265,12 +265,14 @@ bool MultiApkGenerator::UpdateManifest(const Artifact& artifact, const PostProcessingConfiguration& config, std::unique_ptr<XmlResource>* updated_manifest, IDiagnostics* diag) { - *updated_manifest = apk_->InflateManifest(context_); - XmlResource* manifest = updated_manifest->get(); - if (manifest == nullptr) { + const xml::XmlResource* apk_manifest = apk_->GetManifest(); + if (apk_manifest == nullptr) { return false; } + *updated_manifest = apk_manifest->Clone(); + XmlResource* manifest = updated_manifest->get(); + // Make sure the first element is <manifest> with package attribute. xml::Element* manifest_el = manifest->root.get(); if (manifest_el == nullptr) { |