Loading tools/aapt2/io/ZipArchive.cpp +8 −0 Original line number Diff line number Diff line Loading @@ -75,11 +75,19 @@ ZipFileCollection::ZipFileCollection() : mHandle(nullptr) { std::unique_ptr<ZipFileCollection> ZipFileCollection::create(const StringPiece& path, std::string* outError) { constexpr static const int32_t kEmptyArchive = -6; std::unique_ptr<ZipFileCollection> collection = std::unique_ptr<ZipFileCollection>( new ZipFileCollection()); int32_t result = OpenArchive(path.data(), &collection->mHandle); if (result != 0) { // If a zip is empty, result will be an error code. This is fine and we should // return an empty ZipFileCollection. if (result == kEmptyArchive) { return collection; } if (outError) *outError = ErrorCodeString(result); return {}; } Loading tools/aapt2/link/Link.cpp +5 −4 Original line number Diff line number Diff line Loading @@ -551,14 +551,15 @@ public: if (resourceFile) { return mergeCompiledFile(file, std::move(resourceFile), override); } } else { // Ignore non .flat files. This could be classes.dex or something else that happens // to be in an archive. } return false; } // Ignore non .flat files. This could be classes.dex or something else that happens // to be in an archive. return true; } int run(const std::vector<std::string>& inputFiles) { // Load the AndroidManifest.xml std::unique_ptr<xml::XmlResource> manifestXml = loadXml(mOptions.manifestPath, Loading Loading
tools/aapt2/io/ZipArchive.cpp +8 −0 Original line number Diff line number Diff line Loading @@ -75,11 +75,19 @@ ZipFileCollection::ZipFileCollection() : mHandle(nullptr) { std::unique_ptr<ZipFileCollection> ZipFileCollection::create(const StringPiece& path, std::string* outError) { constexpr static const int32_t kEmptyArchive = -6; std::unique_ptr<ZipFileCollection> collection = std::unique_ptr<ZipFileCollection>( new ZipFileCollection()); int32_t result = OpenArchive(path.data(), &collection->mHandle); if (result != 0) { // If a zip is empty, result will be an error code. This is fine and we should // return an empty ZipFileCollection. if (result == kEmptyArchive) { return collection; } if (outError) *outError = ErrorCodeString(result); return {}; } Loading
tools/aapt2/link/Link.cpp +5 −4 Original line number Diff line number Diff line Loading @@ -551,14 +551,15 @@ public: if (resourceFile) { return mergeCompiledFile(file, std::move(resourceFile), override); } } else { // Ignore non .flat files. This could be classes.dex or something else that happens // to be in an archive. } return false; } // Ignore non .flat files. This could be classes.dex or something else that happens // to be in an archive. return true; } int run(const std::vector<std::string>& inputFiles) { // Load the AndroidManifest.xml std::unique_ptr<xml::XmlResource> manifestXml = loadXml(mOptions.manifestPath, Loading