Lines Matching refs:Header
88 uint8_t data[sizeof(DexFile::Header)];
92 DexFile::Header* header = reinterpret_cast<DexFile::Header*>(&header_data.data);
93 std::copy_n(StandardDexFile::kDexMagic, 4u, header->magic_);
94 std::copy_n(StandardDexFile::kDexMagicVersions[0], 4u, header->magic_ + 4u);
95 header->header_size_ = sizeof(DexFile::Header);
96 header->endian_tag_ = DexFile::kDexEndianConstant;
97 header->link_size_ = 0u; // Unused.
98 header->link_off_ = 0u; // Unused.
99 header->map_off_ = 0u; // Unused. TODO: This is wrong. Dex files created by this builder
104 uint32_t string_ids_offset = sizeof(DexFile::Header);
112 header->string_ids_size_ = strings_.size();
113 header->string_ids_off_ = strings_.empty() ? 0u : string_ids_offset;
121 header->type_ids_size_ = types_.size();
122 header->type_ids_off_ = types_.empty() ? 0u : type_ids_offset;
137 header->proto_ids_size_ = protos_.size();
138 header->proto_ids_off_ = protos_.empty() ? 0u : proto_ids_offset;
146 header->field_ids_size_ = fields_.size();
147 header->field_ids_off_ = fields_.empty() ? 0u : field_ids_offset;
155 header->method_ids_size_ = methods_.size();
156 header->method_ids_off_ = methods_.empty() ? 0u : method_ids_offset;
159 header->class_defs_size_ = 0u;
160 header->class_defs_off_ = 0u;
163 header->data_size_ = data_section_size;
164 header->data_off_ = (data_section_size != 0u) ? data_section_offset : 0u;
219 header->file_size_ = dex_file_data_.size();
221 // Write the complete header early, as part of it needs to be checksummed.
222 std::memcpy(&dex_file_data_[0], header_data.data, sizeof(DexFile::Header));
225 size_t skip = sizeof(header->magic_) + sizeof(header->checksum_);
226 header->checksum_ = adler32(adler32(0L, Z_NULL, 0),
230 // Write the complete header again, just simpler that way.
231 std::memcpy(&dex_file_data_[0], header_data.data, sizeof(DexFile::Header));