return new DexZipArchive instance on success, null on error.
| 112 | public: |
| 113 | // return new DexZipArchive instance on success, null on error. |
| 114 | static DexZipArchive* Open(const uint8_t* base, size_t size, std::string* error_msg) { |
| 115 | ZipArchiveHandle handle; |
| 116 | uint8_t* nonconst_base = const_cast<uint8_t*>(base); |
| 117 | const int32_t error = OpenArchiveFromMemory(nonconst_base, size, "ZipArchiveMemory", &handle); |
| 118 | if (error) { |
| 119 | *error_msg = std::string(ErrorCodeString(error)); |
| 120 | CloseArchive(handle); |
| 121 | return nullptr; |
| 122 | } |
| 123 | return new DexZipArchive(handle); |
| 124 | } |
| 125 | |
| 126 | DexZipEntry* Find(const char* name, std::string* error_msg) const { |
| 127 | DCHECK(name != nullptr); |
nothing calls this directly
no test coverage detected