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

Method CheckEncodedAnnotation

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

Source from the content-addressed store, hash-verified

913}
914
915bool DexFileVerifier::CheckEncodedAnnotation() {
916 DECODE_UNSIGNED_CHECKED_FROM(ptr_, anno_idx);
917 if (!CheckIndex(anno_idx, header_->type_ids_size_, "encoded_annotation type_idx")) {
918 return false;
919 }
920
921 DECODE_UNSIGNED_CHECKED_FROM(ptr_, size);
922 uint32_t last_idx = 0;
923
924 for (uint32_t i = 0; i < size; i++) {
925 DECODE_UNSIGNED_CHECKED_FROM(ptr_, idx);
926 if (!CheckIndex(idx, header_->string_ids_size_, "annotation_element name_idx")) {
927 return false;
928 }
929
930 if (UNLIKELY(last_idx >= idx && i != 0)) {
931 ErrorStringPrintf("Out-of-order annotation_element name_idx: %x then %x",
932 last_idx, idx);
933 return false;
934 }
935
936 if (!CheckEncodedValue()) {
937 return false;
938 }
939
940 last_idx = idx;
941 }
942 return true;
943}
944
945bool DexFileVerifier::FindClassIndexAndDef(uint32_t index,
946 bool is_field,

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected