Home | History | Annotate | Download | only in recovery

Lines Matching refs:zip

88 bool read_metadata_from_package(ZipArchiveHandle zip, std::string* meta_data) {
95 if (FindEntry(zip, metadata_path, &meta_entry) != 0) {
101 if (ExtractToMemory(zip, &meta_entry, reinterpret_cast<uint8_t*>(&(*meta_data)[0]),
110 static void read_source_target_build(ZipArchiveHandle zip, std::vector<std::string>& log_buffer) {
112 if (!read_metadata_from_package(zip, &meta_data)) {
137 // Extract the update binary from the open zip archive |zip| located at |path| and store into |cmd|
140 int update_binary_command(const std::string& path, ZipArchiveHandle zip, int retry_count,
145 // Parses the metadata of the OTA package in |zip| and checks whether we are
148 static int check_newer_ab_build(ZipArchiveHandle zip) {
150 if (!read_metadata_from_package(zip, &metadata_str)) {
223 int update_binary_command(const std::string& path, ZipArchiveHandle zip, int retry_count,
226 int ret = check_newer_ab_build(zip);
232 // in the zip file.
236 if (FindEntry(zip, property_name, &properties_entry) != 0) {
243 ExtractToMemory(zip, &properties_entry, payload_properties.data(), properties_entry_length);
252 if (FindEntry(zip, payload_name, &payload_entry) != 0) {
269 int update_binary_command(const std::string& path, ZipArchiveHandle zip, int retry_count,
277 if (FindEntry(zip, binary_name, &binary_entry) != 0) {
290 int32_t error = ExtractEntryToFile(zip, &binary_entry, fd);
320 static int try_update_binary(const char* path, ZipArchiveHandle zip, bool* wipe_cache,
323 read_source_target_build(zip, log_buffer);
329 int ret = update_binary_command(path, zip, retry_count, pipefd[1], &args);
378 // - the name of the package zip file.
492 // entry doesn't exist. Note that the compatibility info is packed in a zip file inside the OTA
497 static constexpr const char* COMPATIBILITY_ZIP_ENTRY = "compatibility.zip";
526 LOG(ERROR) << "Failed to start iterating zip entries: " << ErrorCodeString(ret);
595 ZipArchiveHandle zip;
596 int err = OpenArchiveFromMemory(map.addr, map.length, path, &zip);
602 CloseArchive(zip);
607 if (!verify_package_compatibility(zip)) {
610 CloseArchive(zip);
620 int result = try_update_binary(path, zip, wipe_cache, log_buffer, retry_count, max_temperature);
625 CloseArchive(zip);