MCPcopy Create free account
hub / github.com/CodingGay/BlackDex / CheckMagicAndVersion

Method CheckMagicAndVersion

Bcore/src/main/cpp/dex/dex_file.cc:150–172  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

148}
149
150bool DexFile::CheckMagicAndVersion(std::string* error_msg) const {
151 if (!IsMagicValid()) {
152 std::ostringstream oss;
153 oss << "Unrecognized magic number in " << GetLocation() << ":"
154 << " " << header_->magic_[0]
155 << " " << header_->magic_[1]
156 << " " << header_->magic_[2]
157 << " " << header_->magic_[3];
158 *error_msg = oss.str();
159 return false;
160 }
161 if (!IsVersionValid()) {
162 std::ostringstream oss;
163 oss << "Unrecognized version number in " << GetLocation() << ":"
164 << " " << header_->magic_[4]
165 << " " << header_->magic_[5]
166 << " " << header_->magic_[6]
167 << " " << header_->magic_[7];
168 *error_msg = oss.str();
169 return false;
170 }
171 return true;
172}
173
174void DexFile::InitializeSectionsFromMapList() {
175 const MapList* map_list = reinterpret_cast<const MapList*>(DataBegin() + header_->map_off_);

Callers

nothing calls this directly

Calls 1

strMethod · 0.45

Tested by

no test coverage detected