summaryrefslogtreecommitdiff
path: root/tools/aapt2/Main.cpp
diff options
context:
space:
mode:
authorPierre Lecesne <lecesne@google.com>2017-01-31 23:58:27 +0000
committerPierre Lecesne <lecesne@google.com>2017-02-01 18:49:19 +0000
commit8a7b4cb99290ec8c1b7d7df4f6e64999a9f4de6e (patch)
tree19ec30b335440f6fd50e7b371c55261083bd5adc /tools/aapt2/Main.cpp
parentdf7278d842eb89e24b94305890c3932c77e27cf2 (diff)
Backbone of the new aapt2 strip command.
The strip command takes an APK as argument and a --target-densities flag which contains the list of screen densities for which to optimize the APK. All the resources that would be unused for a device having the given densities are stripped from the APK leaving only the ones actually being used. Test: Manual. Change-Id: I68368b00876a18ccdbbfc0a8dd265bd361117933
Diffstat (limited to 'tools/aapt2/Main.cpp')
-rw-r--r--tools/aapt2/Main.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/tools/aapt2/Main.cpp b/tools/aapt2/Main.cpp
index 15d7e2e2241b..3ed698b79764 100644
--- a/tools/aapt2/Main.cpp
+++ b/tools/aapt2/Main.cpp
@@ -37,6 +37,7 @@ extern int Compile(const std::vector<android::StringPiece>& args);
extern int Link(const std::vector<android::StringPiece>& args);
extern int Dump(const std::vector<android::StringPiece>& args);
extern int Diff(const std::vector<android::StringPiece>& args);
+extern int Strip(const std::vector<android::StringPiece>& args);
} // namespace aapt
@@ -59,6 +60,8 @@ int main(int argc, char** argv) {
return aapt::Dump(args);
} else if (command == "diff") {
return aapt::Diff(args);
+ } else if (command == "strip") {
+ return aapt::Strip(args);
} else if (command == "version") {
return aapt::PrintVersion();
}
@@ -67,7 +70,7 @@ int main(int argc, char** argv) {
std::cerr << "no command specified\n";
}
- std::cerr << "\nusage: aapt2 [compile|link|dump|diff|version] ..."
+ std::cerr << "\nusage: aapt2 [compile|link|dump|diff|strip|version] ..."
<< std::endl;
return 1;
}