AAPT2: Fix dump apk format
Dumping resources printed the incorrect apk type.
Bug: 113062289
Test: manual
Change-Id: I8b250a470afa26697f80b1dfa8ba677ed654a958
diff --git a/tools/aapt2/cmd/Dump.cpp b/tools/aapt2/cmd/Dump.cpp
index 29e471e..5cb30b6 100644
--- a/tools/aapt2/cmd/Dump.cpp
+++ b/tools/aapt2/cmd/Dump.cpp
@@ -298,7 +298,7 @@
return 1;
}
- if (loaded_apk->GetApkFormat()) {
+ if (loaded_apk->GetApkFormat() == ApkFormat::kProto) {
printer.Println("Proto APK");
} else {
printer.Println("Binary APK");
@@ -356,7 +356,7 @@
for (auto xml_file : files_) {
android::ResXMLTree tree;
- if (loaded_apk->GetApkFormat() == kProto) {
+ if (loaded_apk->GetApkFormat() == ApkFormat::kProto) {
auto xml = loaded_apk->LoadXml(xml_file, diag_);
if (!xml) {
return 1;
@@ -375,7 +375,7 @@
std::string data = buffer.to_string();
tree.setTo(data.data(), data.size(), /** copyData */ true);
- } else if (loaded_apk->GetApkFormat() == kBinary) {
+ } else if (loaded_apk->GetApkFormat() == ApkFormat::kBinary) {
io::IFile* file = loaded_apk->GetFileCollection()->FindFile(xml_file);
if (!file) {
diag_->Error(DiagMessage(xml_file) << "file '" << xml_file << "' not found in APK");