Adam Lesinski | 8780eb6 | 2017-10-31 17:44:39 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2017 The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
Ryan Mitchell | 833a1a6 | 2018-07-10 13:51:36 -0700 | [diff] [blame] | 17 | #include "Convert.h" |
| 18 | |
Adam Lesinski | 8780eb6 | 2017-10-31 17:44:39 -0700 | [diff] [blame] | 19 | #include <vector> |
| 20 | |
| 21 | #include "android-base/macros.h" |
| 22 | #include "androidfw/StringPiece.h" |
| 23 | |
Adam Lesinski | 8780eb6 | 2017-10-31 17:44:39 -0700 | [diff] [blame] | 24 | #include "LoadedApk.h" |
| 25 | #include "ValueVisitor.h" |
| 26 | #include "cmd/Util.h" |
| 27 | #include "format/binary/TableFlattener.h" |
| 28 | #include "format/binary/XmlFlattener.h" |
| 29 | #include "format/proto/ProtoDeserialize.h" |
Pierre Lecesne | d8b4bea | 2017-11-10 23:50:17 +0000 | [diff] [blame] | 30 | #include "format/proto/ProtoSerialize.h" |
Adam Lesinski | 8780eb6 | 2017-10-31 17:44:39 -0700 | [diff] [blame] | 31 | #include "io/BigBufferStream.h" |
| 32 | #include "io/Util.h" |
| 33 | #include "process/IResourceTableConsumer.h" |
| 34 | #include "process/SymbolTable.h" |
Pierre Lecesne | d8b4bea | 2017-11-10 23:50:17 +0000 | [diff] [blame] | 35 | #include "util/Util.h" |
Adam Lesinski | 8780eb6 | 2017-10-31 17:44:39 -0700 | [diff] [blame] | 36 | |
| 37 | using ::android::StringPiece; |
Pierre Lecesne | d8b4bea | 2017-11-10 23:50:17 +0000 | [diff] [blame] | 38 | using ::android::base::StringPrintf; |
Adam Lesinski | 8780eb6 | 2017-10-31 17:44:39 -0700 | [diff] [blame] | 39 | using ::std::unique_ptr; |
| 40 | using ::std::vector; |
| 41 | |
| 42 | namespace aapt { |
| 43 | |
Pierre Lecesne | d8b4bea | 2017-11-10 23:50:17 +0000 | [diff] [blame] | 44 | class IApkSerializer { |
Pierre Lecesne | 7e8549d | 2017-11-10 01:22:12 +0000 | [diff] [blame] | 45 | public: |
Pierre Lecesne | d8b4bea | 2017-11-10 23:50:17 +0000 | [diff] [blame] | 46 | IApkSerializer(IAaptContext* context, const Source& source) : context_(context), source_(source) {} |
Pierre Lecesne | 7e8549d | 2017-11-10 01:22:12 +0000 | [diff] [blame] | 47 | |
| 48 | virtual bool SerializeXml(const xml::XmlResource* xml, const std::string& path, bool utf16, |
| 49 | IArchiveWriter* writer) = 0; |
| 50 | virtual bool SerializeTable(ResourceTable* table, IArchiveWriter* writer) = 0; |
David Chaloupka | b66db4e | 2018-01-15 12:35:41 +0000 | [diff] [blame] | 51 | virtual bool SerializeFile(FileReference* file, IArchiveWriter* writer) = 0; |
Pierre Lecesne | 7e8549d | 2017-11-10 01:22:12 +0000 | [diff] [blame] | 52 | |
Pierre Lecesne | d8b4bea | 2017-11-10 23:50:17 +0000 | [diff] [blame] | 53 | virtual ~IApkSerializer() = default; |
Pierre Lecesne | 7e8549d | 2017-11-10 01:22:12 +0000 | [diff] [blame] | 54 | |
| 55 | protected: |
| 56 | IAaptContext* context_; |
| 57 | Source source_; |
| 58 | }; |
Adam Lesinski | 8780eb6 | 2017-10-31 17:44:39 -0700 | [diff] [blame] | 59 | |
Pierre Lecesne | d8b4bea | 2017-11-10 23:50:17 +0000 | [diff] [blame] | 60 | bool ConvertApk(IAaptContext* context, unique_ptr<LoadedApk> apk, IApkSerializer* serializer, |
| 61 | IArchiveWriter* writer) { |
Pierre Lecesne | 7e8549d | 2017-11-10 01:22:12 +0000 | [diff] [blame] | 62 | if (!serializer->SerializeXml(apk->GetManifest(), kAndroidManifestPath, true /*utf16*/, writer)) { |
| 63 | context->GetDiagnostics()->Error(DiagMessage(apk->GetSource()) |
| 64 | << "failed to serialize AndroidManifest.xml"); |
Adam Lesinski | 8780eb6 | 2017-10-31 17:44:39 -0700 | [diff] [blame] | 65 | return false; |
| 66 | } |
| 67 | |
Tom Dobek | 725fb12 | 2017-12-08 14:19:01 +0000 | [diff] [blame] | 68 | if (apk->GetResourceTable() != nullptr) { |
David Chaloupka | b66db4e | 2018-01-15 12:35:41 +0000 | [diff] [blame] | 69 | // The table might be modified by below code. |
| 70 | auto converted_table = apk->GetResourceTable(); |
Tom Dobek | 725fb12 | 2017-12-08 14:19:01 +0000 | [diff] [blame] | 71 | |
| 72 | // Resources |
David Chaloupka | b66db4e | 2018-01-15 12:35:41 +0000 | [diff] [blame] | 73 | for (const auto& package : converted_table->packages) { |
Tom Dobek | 725fb12 | 2017-12-08 14:19:01 +0000 | [diff] [blame] | 74 | for (const auto& type : package->types) { |
| 75 | for (const auto& entry : type->entries) { |
| 76 | for (const auto& config_value : entry->values) { |
David Chaloupka | b66db4e | 2018-01-15 12:35:41 +0000 | [diff] [blame] | 77 | FileReference* file = ValueCast<FileReference>(config_value->value.get()); |
Tom Dobek | 725fb12 | 2017-12-08 14:19:01 +0000 | [diff] [blame] | 78 | if (file != nullptr) { |
| 79 | if (file->file == nullptr) { |
| 80 | context->GetDiagnostics()->Error(DiagMessage(apk->GetSource()) |
| 81 | << "no file associated with " << *file); |
| 82 | return false; |
| 83 | } |
| 84 | |
| 85 | if (!serializer->SerializeFile(file, writer)) { |
| 86 | context->GetDiagnostics()->Error(DiagMessage(apk->GetSource()) |
| 87 | << "failed to serialize file " << *file->path); |
| 88 | return false; |
| 89 | } |
| 90 | } // file |
| 91 | } // config_value |
| 92 | } // entry |
| 93 | } // type |
| 94 | } // package |
David Chaloupka | b66db4e | 2018-01-15 12:35:41 +0000 | [diff] [blame] | 95 | |
| 96 | // Converted resource table |
| 97 | if (!serializer->SerializeTable(converted_table, writer)) { |
| 98 | context->GetDiagnostics()->Error(DiagMessage(apk->GetSource()) |
| 99 | << "failed to serialize the resource table"); |
| 100 | return false; |
| 101 | } |
Adam Lesinski | 8780eb6 | 2017-10-31 17:44:39 -0700 | [diff] [blame] | 102 | } |
| 103 | |
Pierre Lecesne | d55bef7 | 2017-11-10 22:31:01 +0000 | [diff] [blame] | 104 | // Other files |
| 105 | std::unique_ptr<io::IFileCollectionIterator> iterator = apk->GetFileCollection()->Iterator(); |
| 106 | while (iterator->HasNext()) { |
| 107 | io::IFile* file = iterator->Next(); |
| 108 | |
| 109 | std::string path = file->GetSource().path; |
| 110 | // The name of the path has the format "<zip-file-name>@<path-to-file>". |
| 111 | path = path.substr(path.find('@') + 1); |
| 112 | |
| 113 | // Manifest, resource table and resources have already been taken care of. |
| 114 | if (path == kAndroidManifestPath || |
| 115 | path == kApkResourceTablePath || |
| 116 | path == kProtoResourceTablePath || |
| 117 | path.find("res/") == 0) { |
| 118 | continue; |
| 119 | } |
| 120 | |
| 121 | if (!io::CopyFileToArchivePreserveCompression(context, file, path, writer)) { |
| 122 | context->GetDiagnostics()->Error(DiagMessage(apk->GetSource()) |
| 123 | << "failed to copy file " << path); |
| 124 | return false; |
| 125 | } |
| 126 | } |
| 127 | |
Adam Lesinski | 8780eb6 | 2017-10-31 17:44:39 -0700 | [diff] [blame] | 128 | return true; |
| 129 | } |
| 130 | |
Pierre Lecesne | 7e8549d | 2017-11-10 01:22:12 +0000 | [diff] [blame] | 131 | |
Pierre Lecesne | d8b4bea | 2017-11-10 23:50:17 +0000 | [diff] [blame] | 132 | class BinaryApkSerializer : public IApkSerializer { |
Pierre Lecesne | 7e8549d | 2017-11-10 01:22:12 +0000 | [diff] [blame] | 133 | public: |
Pierre Lecesne | d8b4bea | 2017-11-10 23:50:17 +0000 | [diff] [blame] | 134 | BinaryApkSerializer(IAaptContext* context, const Source& source, |
Pierre Lecesne | 7e8549d | 2017-11-10 01:22:12 +0000 | [diff] [blame] | 135 | const TableFlattenerOptions& options) |
Pierre Lecesne | d8b4bea | 2017-11-10 23:50:17 +0000 | [diff] [blame] | 136 | : IApkSerializer(context, source), tableFlattenerOptions_(options) {} |
Pierre Lecesne | 7e8549d | 2017-11-10 01:22:12 +0000 | [diff] [blame] | 137 | |
| 138 | bool SerializeXml(const xml::XmlResource* xml, const std::string& path, bool utf16, |
Pierre Lecesne | d8b4bea | 2017-11-10 23:50:17 +0000 | [diff] [blame] | 139 | IArchiveWriter* writer) override { |
Pierre Lecesne | 7e8549d | 2017-11-10 01:22:12 +0000 | [diff] [blame] | 140 | BigBuffer buffer(4096); |
| 141 | XmlFlattenerOptions options = {}; |
| 142 | options.use_utf16 = utf16; |
Adam Lesinski | bbf4297 | 2018-02-14 13:36:09 -0800 | [diff] [blame] | 143 | options.keep_raw_values = true; |
Pierre Lecesne | 7e8549d | 2017-11-10 01:22:12 +0000 | [diff] [blame] | 144 | XmlFlattener flattener(&buffer, options); |
| 145 | if (!flattener.Consume(context_, xml)) { |
| 146 | return false; |
| 147 | } |
| 148 | |
| 149 | io::BigBufferInputStream input_stream(&buffer); |
| 150 | return io::CopyInputStreamToArchive(context_, &input_stream, path, ArchiveEntry::kCompress, |
| 151 | writer); |
| 152 | } |
| 153 | |
Pierre Lecesne | d8b4bea | 2017-11-10 23:50:17 +0000 | [diff] [blame] | 154 | bool SerializeTable(ResourceTable* table, IArchiveWriter* writer) override { |
Pierre Lecesne | 7e8549d | 2017-11-10 01:22:12 +0000 | [diff] [blame] | 155 | BigBuffer buffer(4096); |
| 156 | TableFlattener table_flattener(tableFlattenerOptions_, &buffer); |
| 157 | if (!table_flattener.Consume(context_, table)) { |
| 158 | return false; |
| 159 | } |
| 160 | |
| 161 | io::BigBufferInputStream input_stream(&buffer); |
| 162 | return io::CopyInputStreamToArchive(context_, &input_stream, kApkResourceTablePath, |
| 163 | ArchiveEntry::kAlign, writer); |
| 164 | } |
| 165 | |
David Chaloupka | b66db4e | 2018-01-15 12:35:41 +0000 | [diff] [blame] | 166 | bool SerializeFile(FileReference* file, IArchiveWriter* writer) override { |
Pierre Lecesne | 7e8549d | 2017-11-10 01:22:12 +0000 | [diff] [blame] | 167 | if (file->type == ResourceFile::Type::kProtoXml) { |
| 168 | unique_ptr<io::InputStream> in = file->file->OpenInputStream(); |
| 169 | if (in == nullptr) { |
| 170 | context_->GetDiagnostics()->Error(DiagMessage(source_) |
| 171 | << "failed to open file " << *file->path); |
| 172 | return false; |
| 173 | } |
| 174 | |
| 175 | pb::XmlNode pb_node; |
| 176 | io::ZeroCopyInputAdaptor adaptor(in.get()); |
| 177 | if (!pb_node.ParseFromZeroCopyStream(&adaptor)) { |
| 178 | context_->GetDiagnostics()->Error(DiagMessage(source_) |
| 179 | << "failed to parse proto XML " << *file->path); |
| 180 | return false; |
| 181 | } |
| 182 | |
| 183 | std::string error; |
| 184 | unique_ptr<xml::XmlResource> xml = DeserializeXmlResourceFromPb(pb_node, &error); |
| 185 | if (xml == nullptr) { |
| 186 | context_->GetDiagnostics()->Error(DiagMessage(source_) |
| 187 | << "failed to deserialize proto XML " |
| 188 | << *file->path << ": " << error); |
| 189 | return false; |
| 190 | } |
| 191 | |
| 192 | if (!SerializeXml(xml.get(), *file->path, false /*utf16*/, writer)) { |
| 193 | context_->GetDiagnostics()->Error(DiagMessage(source_) |
Pierre Lecesne | d8b4bea | 2017-11-10 23:50:17 +0000 | [diff] [blame] | 194 | << "failed to serialize to binary XML: " << *file->path); |
Pierre Lecesne | 7e8549d | 2017-11-10 01:22:12 +0000 | [diff] [blame] | 195 | return false; |
| 196 | } |
David Chaloupka | b66db4e | 2018-01-15 12:35:41 +0000 | [diff] [blame] | 197 | |
| 198 | file->type = ResourceFile::Type::kBinaryXml; |
Pierre Lecesne | 7e8549d | 2017-11-10 01:22:12 +0000 | [diff] [blame] | 199 | } else { |
Pierre Lecesne | d55bef7 | 2017-11-10 22:31:01 +0000 | [diff] [blame] | 200 | if (!io::CopyFileToArchivePreserveCompression(context_, file->file, *file->path, writer)) { |
| 201 | context_->GetDiagnostics()->Error(DiagMessage(source_) |
| 202 | << "failed to copy file " << *file->path); |
| 203 | return false; |
| 204 | } |
Pierre Lecesne | 7e8549d | 2017-11-10 01:22:12 +0000 | [diff] [blame] | 205 | } |
| 206 | |
| 207 | return true; |
| 208 | } |
| 209 | |
| 210 | private: |
| 211 | TableFlattenerOptions tableFlattenerOptions_; |
| 212 | |
Pierre Lecesne | d8b4bea | 2017-11-10 23:50:17 +0000 | [diff] [blame] | 213 | DISALLOW_COPY_AND_ASSIGN(BinaryApkSerializer); |
| 214 | }; |
| 215 | |
| 216 | class ProtoApkSerializer : public IApkSerializer { |
| 217 | public: |
| 218 | ProtoApkSerializer(IAaptContext* context, const Source& source) |
| 219 | : IApkSerializer(context, source) {} |
| 220 | |
| 221 | bool SerializeXml(const xml::XmlResource* xml, const std::string& path, bool utf16, |
| 222 | IArchiveWriter* writer) override { |
| 223 | pb::XmlNode pb_node; |
| 224 | SerializeXmlResourceToPb(*xml, &pb_node); |
| 225 | return io::CopyProtoToArchive(context_, &pb_node, path, ArchiveEntry::kCompress, writer); |
| 226 | } |
| 227 | |
| 228 | bool SerializeTable(ResourceTable* table, IArchiveWriter* writer) override { |
| 229 | pb::ResourceTable pb_table; |
Ryan Mitchell | a15c2a8 | 2018-03-26 11:05:31 -0700 | [diff] [blame] | 230 | SerializeTableToPb(*table, &pb_table, context_->GetDiagnostics()); |
Pierre Lecesne | d8b4bea | 2017-11-10 23:50:17 +0000 | [diff] [blame] | 231 | return io::CopyProtoToArchive(context_, &pb_table, kProtoResourceTablePath, |
| 232 | ArchiveEntry::kCompress, writer); |
| 233 | } |
| 234 | |
David Chaloupka | b66db4e | 2018-01-15 12:35:41 +0000 | [diff] [blame] | 235 | bool SerializeFile(FileReference* file, IArchiveWriter* writer) override { |
Pierre Lecesne | d8b4bea | 2017-11-10 23:50:17 +0000 | [diff] [blame] | 236 | if (file->type == ResourceFile::Type::kBinaryXml) { |
| 237 | std::unique_ptr<io::IData> data = file->file->OpenAsData(); |
| 238 | if (!data) { |
| 239 | context_->GetDiagnostics()->Error(DiagMessage(source_) |
| 240 | << "failed to open file " << *file->path); |
| 241 | return false; |
| 242 | } |
| 243 | |
| 244 | std::string error; |
| 245 | std::unique_ptr<xml::XmlResource> xml = xml::Inflate(data->data(), data->size(), &error); |
| 246 | if (xml == nullptr) { |
| 247 | context_->GetDiagnostics()->Error(DiagMessage(source_) << "failed to parse binary XML: " |
| 248 | << error); |
| 249 | return false; |
| 250 | } |
| 251 | |
| 252 | if (!SerializeXml(xml.get(), *file->path, false /*utf16*/, writer)) { |
| 253 | context_->GetDiagnostics()->Error(DiagMessage(source_) |
| 254 | << "failed to serialize to proto XML: " << *file->path); |
| 255 | return false; |
| 256 | } |
David Chaloupka | b66db4e | 2018-01-15 12:35:41 +0000 | [diff] [blame] | 257 | |
| 258 | file->type = ResourceFile::Type::kProtoXml; |
Pierre Lecesne | d8b4bea | 2017-11-10 23:50:17 +0000 | [diff] [blame] | 259 | } else { |
| 260 | if (!io::CopyFileToArchivePreserveCompression(context_, file->file, *file->path, writer)) { |
| 261 | context_->GetDiagnostics()->Error(DiagMessage(source_) |
| 262 | << "failed to copy file " << *file->path); |
| 263 | return false; |
| 264 | } |
| 265 | } |
| 266 | |
| 267 | return true; |
| 268 | } |
| 269 | |
| 270 | private: |
| 271 | DISALLOW_COPY_AND_ASSIGN(ProtoApkSerializer); |
Pierre Lecesne | 7e8549d | 2017-11-10 01:22:12 +0000 | [diff] [blame] | 272 | }; |
| 273 | |
Adam Lesinski | 8780eb6 | 2017-10-31 17:44:39 -0700 | [diff] [blame] | 274 | class Context : public IAaptContext { |
| 275 | public: |
| 276 | Context() : mangler_({}), symbols_(&mangler_) { |
| 277 | } |
| 278 | |
| 279 | PackageType GetPackageType() override { |
| 280 | return PackageType::kApp; |
| 281 | } |
| 282 | |
| 283 | SymbolTable* GetExternalSymbols() override { |
| 284 | return &symbols_; |
| 285 | } |
| 286 | |
| 287 | IDiagnostics* GetDiagnostics() override { |
| 288 | return &diag_; |
| 289 | } |
| 290 | |
| 291 | const std::string& GetCompilationPackage() override { |
| 292 | return package_; |
| 293 | } |
| 294 | |
| 295 | uint8_t GetPackageId() override { |
| 296 | // Nothing should call this. |
| 297 | UNIMPLEMENTED(FATAL) << "PackageID should not be necessary"; |
| 298 | return 0; |
| 299 | } |
| 300 | |
| 301 | NameMangler* GetNameMangler() override { |
| 302 | UNIMPLEMENTED(FATAL); |
| 303 | return nullptr; |
| 304 | } |
| 305 | |
| 306 | bool IsVerbose() override { |
| 307 | return verbose_; |
| 308 | } |
| 309 | |
| 310 | int GetMinSdkVersion() override { |
| 311 | return 0u; |
| 312 | } |
| 313 | |
| 314 | bool verbose_ = false; |
| 315 | std::string package_; |
| 316 | |
| 317 | private: |
| 318 | DISALLOW_COPY_AND_ASSIGN(Context); |
| 319 | |
| 320 | NameMangler mangler_; |
| 321 | SymbolTable symbols_; |
| 322 | StdErrDiagnostics diag_; |
| 323 | }; |
| 324 | |
Ryan Mitchell | 833a1a6 | 2018-07-10 13:51:36 -0700 | [diff] [blame] | 325 | const char* ConvertCommand::kOutputFormatProto = "proto"; |
| 326 | const char* ConvertCommand::kOutputFormatBinary = "binary"; |
Pierre Lecesne | d8b4bea | 2017-11-10 23:50:17 +0000 | [diff] [blame] | 327 | |
Ryan Mitchell | 833a1a6 | 2018-07-10 13:51:36 -0700 | [diff] [blame] | 328 | int ConvertCommand::Action(const std::vector<std::string>& args) { |
| 329 | if (args.size() != 1) { |
| 330 | std::cerr << "must supply a single proto APK\n"; |
| 331 | Usage(&std::cerr); |
| 332 | return 1; |
| 333 | } |
Pierre Lecesne | d8b4bea | 2017-11-10 23:50:17 +0000 | [diff] [blame] | 334 | |
Adam Lesinski | 8780eb6 | 2017-10-31 17:44:39 -0700 | [diff] [blame] | 335 | Context context; |
Ryan Mitchell | 833a1a6 | 2018-07-10 13:51:36 -0700 | [diff] [blame] | 336 | const StringPiece& path = args[0]; |
Adam Lesinski | 8780eb6 | 2017-10-31 17:44:39 -0700 | [diff] [blame] | 337 | unique_ptr<LoadedApk> apk = LoadedApk::LoadApkFromPath(path, context.GetDiagnostics()); |
| 338 | if (apk == nullptr) { |
| 339 | context.GetDiagnostics()->Error(DiagMessage(path) << "failed to load APK"); |
| 340 | return 1; |
| 341 | } |
| 342 | |
| 343 | Maybe<AppInfo> app_info = |
| 344 | ExtractAppInfoFromBinaryManifest(*apk->GetManifest(), context.GetDiagnostics()); |
| 345 | if (!app_info) { |
| 346 | return 1; |
| 347 | } |
| 348 | |
| 349 | context.package_ = app_info.value().package; |
| 350 | |
| 351 | unique_ptr<IArchiveWriter> writer = |
Ryan Mitchell | 833a1a6 | 2018-07-10 13:51:36 -0700 | [diff] [blame] | 352 | CreateZipFileArchiveWriter(context.GetDiagnostics(), output_path_); |
Adam Lesinski | 8780eb6 | 2017-10-31 17:44:39 -0700 | [diff] [blame] | 353 | if (writer == nullptr) { |
| 354 | return 1; |
| 355 | } |
Pierre Lecesne | d8b4bea | 2017-11-10 23:50:17 +0000 | [diff] [blame] | 356 | |
| 357 | unique_ptr<IApkSerializer> serializer; |
Ryan Mitchell | 833a1a6 | 2018-07-10 13:51:36 -0700 | [diff] [blame] | 358 | if (!output_format_ || output_format_.value() == ConvertCommand::kOutputFormatBinary) { |
| 359 | |
| 360 | serializer.reset(new BinaryApkSerializer(&context, apk->GetSource(), options_)); |
| 361 | } else if (output_format_.value() == ConvertCommand::kOutputFormatProto) { |
Pierre Lecesne | d8b4bea | 2017-11-10 23:50:17 +0000 | [diff] [blame] | 362 | serializer.reset(new ProtoApkSerializer(&context, apk->GetSource())); |
| 363 | } else { |
| 364 | context.GetDiagnostics()->Error(DiagMessage(path) |
Ryan Mitchell | 833a1a6 | 2018-07-10 13:51:36 -0700 | [diff] [blame] | 365 | << "Invalid value for flag --output-format: " |
| 366 | << output_format_.value()); |
Pierre Lecesne | d8b4bea | 2017-11-10 23:50:17 +0000 | [diff] [blame] | 367 | return 1; |
| 368 | } |
| 369 | |
Pierre Lecesne | d8b4bea | 2017-11-10 23:50:17 +0000 | [diff] [blame] | 370 | return ConvertApk(&context, std::move(apk), serializer.get(), writer.get()) ? 0 : 1; |
Adam Lesinski | 8780eb6 | 2017-10-31 17:44:39 -0700 | [diff] [blame] | 371 | } |
| 372 | |
| 373 | } // namespace aapt |