From 8780eb6e4918ae24fb1ae74d631042c32e41dc3d Mon Sep 17 00:00:00 2001 From: Adam Lesinski Date: Tue, 31 Oct 2017 17:44:39 -0700 Subject: 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 --- tools/aapt2/Main.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'tools/aapt2/Main.cpp') diff --git a/tools/aapt2/Main.cpp b/tools/aapt2/Main.cpp index 36ab30c7fb6e..808b29cfd844 100644 --- a/tools/aapt2/Main.cpp +++ b/tools/aapt2/Main.cpp @@ -50,7 +50,7 @@ static void PrintVersion() { } static void PrintUsage() { - std::cerr << "\nusage: aapt2 [compile|link|dump|diff|optimize|version] ..." << std::endl; + std::cerr << "\nusage: aapt2 [compile|link|dump|diff|optimize|convert|version] ..." << std::endl; } extern int Compile(const std::vector& args, IDiagnostics* diagnostics); @@ -58,6 +58,7 @@ extern int Link(const std::vector& args, IDiagnostics* diagnostics) extern int Dump(const std::vector& args); extern int Diff(const std::vector& args); extern int Optimize(const std::vector& args); +extern int Convert(const std::vector& args); static int ExecuteCommand(const StringPiece& command, const std::vector& args, IDiagnostics* diagnostics) { @@ -71,6 +72,8 @@ static int ExecuteCommand(const StringPiece& command, const std::vector