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

Function GetClassOrError

Bcore/src/main/cpp/dex/dex_file_verifier.cc:2925–2940  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2923}
2924
2925static std::string GetClassOrError(const uint8_t* const begin,
2926 const DexFile::Header* const header,
2927 dex::TypeIndex class_idx) {
2928 // The `class_idx` is either `FieldId::class_idx_` or `MethodId::class_idx_` and
2929 // it has already been checked in `DexFileVerifier::CheckClassDataItemField()`
2930 // or `DexFileVerifier::CheckClassDataItemMethod()`, respectively, to match
2931 // a valid defining class.
2932 CHECK_LT(class_idx.index_, header->type_ids_size_);
2933
2934 const DexFile::TypeId* type_id =
2935 reinterpret_cast<const DexFile::TypeId*>(begin + header->type_ids_off_) + class_idx.index_;
2936
2937 // Assume that the data is OK at this point. Type id offsets have been checked at this point.
2938
2939 return GetStringOrError(begin, header, type_id->descriptor_idx_);
2940}
2941
2942static std::string GetFieldDescriptionOrError(const uint8_t* const begin,
2943 const DexFile::Header* const header,

Callers 2

Calls 1

GetStringOrErrorFunction · 0.85

Tested by

no test coverage detected