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

Method FindCodeItemOffset

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

Source from the content-addressed store, hash-verified

219}
220
221uint32_t DexFile::FindCodeItemOffset(const DexFile::ClassDef& class_def,
222 uint32_t method_idx) const {
223 const uint8_t* class_data = GetClassData(class_def);
224 CHECK(class_data != nullptr);
225 ClassDataItemIterator it(*this, class_data);
226 it.SkipAllFields();
227 while (it.HasNextDirectMethod()) {
228 if (it.GetMemberIndex() == method_idx) {
229 return it.GetMethodCodeItemOffset();
230 }
231 it.Next();
232 }
233 while (it.HasNextVirtualMethod()) {
234 if (it.GetMemberIndex() == method_idx) {
235 return it.GetMethodCodeItemOffset();
236 }
237 it.Next();
238 }
239 LOG(FATAL) << "Unable to find method " << method_idx;
240 UNREACHABLE();
241}
242
243const DexFile::FieldId* DexFile::FindFieldId(const DexFile::TypeId& declaring_klass,
244 const DexFile::StringId& name,

Callers

nothing calls this directly

Calls 6

SkipAllFieldsMethod · 0.80
HasNextDirectMethodMethod · 0.80
GetMemberIndexMethod · 0.80
HasNextVirtualMethodMethod · 0.80
NextMethod · 0.45

Tested by

no test coverage detected