Home | History | Annotate | Download | only in runtime

Lines Matching refs:DexFile

33     case DexFile::kDexTypeHeaderItem:               return 1 << 0;
34 case DexFile::kDexTypeStringIdItem: return 1 << 1;
35 case DexFile::kDexTypeTypeIdItem: return 1 << 2;
36 case DexFile::kDexTypeProtoIdItem: return 1 << 3;
37 case DexFile::kDexTypeFieldIdItem: return 1 << 4;
38 case DexFile::kDexTypeMethodIdItem: return 1 << 5;
39 case DexFile::kDexTypeClassDefItem: return 1 << 6;
40 case DexFile::kDexTypeMapList: return 1 << 7;
41 case DexFile::kDexTypeTypeList: return 1 << 8;
42 case DexFile::kDexTypeAnnotationSetRefList: return 1 << 9;
43 case DexFile::kDexTypeAnnotationSetItem: return 1 << 10;
44 case DexFile::kDexTypeClassDataItem: return 1 << 11;
45 case DexFile::kDexTypeCodeItem: return 1 << 12;
46 case DexFile::kDexTypeStringDataItem: return 1 << 13;
47 case DexFile::kDexTypeDebugInfoItem: return 1 << 14;
48 case DexFile::kDexTypeAnnotationItem: return 1 << 15;
49 case DexFile::kDexTypeEncodedArrayItem: return 1 << 16;
50 case DexFile::kDexTypeAnnotationsDirectoryItem: return 1 << 17;
57 case DexFile::kDexTypeHeaderItem:
58 case DexFile::kDexTypeStringIdItem:
59 case DexFile::kDexTypeTypeIdItem:
60 case DexFile::kDexTypeProtoIdItem:
61 case DexFile::kDexTypeFieldIdItem:
62 case DexFile::kDexTypeMethodIdItem:
63 case DexFile::kDexTypeClassDefItem:
80 const DexFile::TypeId& type_id = dex_file_->GetTypeId(type_idx);
85 const DexFile::FieldId* DexFileVerifier::CheckLoadFieldId(uint32_t idx, const char* error_string) {
92 const DexFile::MethodId* DexFileVerifier::CheckLoadMethodId(uint32_t idx, const char* err_string) {
115 const DexFile::MethodId* var = CheckLoadMethodId(idx, error_string); \
122 const DexFile::FieldId* var = CheckLoadFieldId(idx, fmt); \
127 bool DexFileVerifier::Verify(const DexFile* dex_file, const byte* begin, size_t size,
262 if (header_->endian_tag_ != DexFile::kDexEndianConstant) {
267 if (header_->header_size_ != sizeof(DexFile::Header)) {
288 const DexFile::MapList* map = reinterpret_cast<const DexFile::MapList*>(begin_ +
291 if (!CheckListSize(map, 1, sizeof(DexFile::MapList), "maplist content")) {
295 const DexFile::MapItem* item = map->list_;
304 if (!CheckListSize(item, count, sizeof(DexFile::MapItem), "map size")) {
348 if (UNLIKELY((used_bits & MapTypeToBitMask(DexFile::kDexTypeHeaderItem)) == 0)) {
352 if (UNLIKELY((used_bits & MapTypeToBitMask(DexFile::kDexTypeMapList)) == 0)) {
356 if (UNLIKELY((used_bits & MapTypeToBitMask(DexFile::kDexTypeStringIdItem)) == 0 &&
361 if (UNLIKELY((used_bits & MapTypeToBitMask(DexFile::kDexTypeTypeIdItem)) == 0 &&
366 if (UNLIKELY((used_bits & MapTypeToBitMask(DexFile::kDexTypeProtoIdItem)) == 0 &&
371 if (UNLIKELY((used_bits & MapTypeToBitMask(DexFile::kDexTypeFieldIdItem)) == 0 &&
376 if (UNLIKELY((used_bits & MapTypeToBitMask(DexFile::kDexTypeMethodIdItem)) == 0 &&
381 if (UNLIKELY((used_bits & MapTypeToBitMask(DexFile::kDexTypeClassDefItem)) == 0 &&
399 bool DexFileVerifier::CheckAndGetHandlerOffsets(const DexFile::CodeItem* code_item,
401 const byte* handlers_base = DexFile::GetCatchHandlerData(*code_item, 0);
527 uint32_t value_type = header_byte & DexFile::kDexAnnotationValueTypeMask;
528 uint32_t value_arg = header_byte >> DexFile::kDexAnnotationValueArgShift;
531 case DexFile::kDexAnnotationByte:
538 case DexFile::kDexAnnotationShort:
539 case DexFile::kDexAnnotationChar:
546 case DexFile::kDexAnnotationInt:
547 case DexFile::kDexAnnotationFloat:
554 case DexFile::kDexAnnotationLong:
555 case DexFile::kDexAnnotationDouble:
558 case DexFile::kDexAnnotationString: {
569 case DexFile::kDexAnnotationType: {
580 case DexFile::kDexAnnotationField:
581 case DexFile::kDexAnnotationEnum: {
592 case DexFile::kDexAnnotationMethod: {
603 case DexFile::kDexAnnotationArray:
612 case DexFile::kDexAnnotationAnnotation:
621 case DexFile::kDexAnnotationNull:
627 case DexFile::kDexAnnotationBoolean:
716 const DexFile::CodeItem* code_item = reinterpret_cast<const DexFile::CodeItem*>(ptr_);
717 if (!CheckListSize(code_item, 1, sizeof(DexFile::CodeItem), "code")) {
759 const DexFile::TryItem* try_items = DexFile::GetTryItems(*code_item, 0);
760 ptr_ = DexFile::GetCatchHandlerData(*code_item, 0);
763 if (!CheckListSize(try_items, try_items_size, sizeof(DexFile::TryItem), "try_items size")) {
920 case DexFile::DBG_END_SEQUENCE: {
923 case DexFile::DBG_ADVANCE_PC: {
927 case DexFile::DBG_ADVANCE_LINE: {
931 case DexFile::DBG_START_LOCAL: {
953 case DexFile::DBG_END_LOCAL:
954 case DexFile::DBG_RESTART_LOCAL: {
962 case DexFile::DBG_START_LOCAL_EXTENDED: {
991 case DexFile::DBG_SET_FILE: {
1012 case DexFile::kDexVisibilityBuild:
1013 case DexFile::kDexVisibilityRuntime:
1014 case DexFile::kDexVisibilitySystem:
1029 const DexFile::AnnotationsDirectoryItem* item =
1030 reinterpret_cast<const DexFile::AnnotationsDirectoryItem*>(ptr_);
1031 if (!CheckListSize(item, 1, sizeof(DexFile::AnnotationsDirectoryItem), "annotations_directory")) {
1036 const DexFile::FieldAnnotationsItem* field_item =
1037 reinterpret_cast<const DexFile::FieldAnnotationsItem*>(item + 1);
1039 if (!CheckListSize(field_item, field_count, sizeof(DexFile::FieldAnnotationsItem), "field_annotations list")) {
1054 const DexFile::MethodAnnotationsItem* method_item =
1055 reinterpret_cast<const DexFile::MethodAnnotationsItem*>(field_item);
1057 if (!CheckListSize(method_item, method_count, sizeof(DexFile::MethodAnnotationsItem), "method_annotations list")) {
1073 const DexFile::ParameterAnnotationsItem* parameter_item =
1074 reinterpret_cast<const DexFile::ParameterAnnotationsItem*>(method_item);
1076 if (!CheckListSize(parameter_item, parameter_count, sizeof(DexFile::ParameterAnnotationsItem),
1102 case DexFile::kDexTypeClassDataItem:
1103 case DexFile::kDexTypeStringDataItem:
1104 case DexFile::kDexTypeDebugInfoItem:
1105 case DexFile::kDexTypeAnnotationItem:
1106 case DexFile::kDexTypeEncodedArrayItem:
1125 case DexFile::kDexTypeStringIdItem: {
1126 if (!CheckListSize(ptr_, 1, sizeof(DexFile::StringId), "string_ids")) {
1129 ptr_ += sizeof(DexFile::StringId);
1132 case DexFile::kDexTypeTypeIdItem: {
1133 if (!CheckListSize(ptr_, 1, sizeof(DexFile::TypeId), "type_ids")) {
1136 ptr_ += sizeof(DexFile::TypeId);
1139 case DexFile::kDexTypeProtoIdItem: {
1140 if (!CheckListSize(ptr_, 1, sizeof(DexFile::ProtoId), "proto_ids")) {
1143 ptr_ += sizeof(DexFile::ProtoId);
1146 case DexFile::kDexTypeFieldIdItem: {
1147 if (!CheckListSize(ptr_, 1, sizeof(DexFile::FieldId), "field_ids")) {
1150 ptr_ += sizeof(DexFile::FieldId);
1153 case DexFile::kDexTypeMethodIdItem: {
1154 if (!CheckListSize(ptr_, 1, sizeof(DexFile::MethodId), "method_ids")) {
1157 ptr_ += sizeof(DexFile::MethodId);
1160 case DexFile::kDexTypeClassDefItem: {
1161 if (!CheckListSize(ptr_, 1, sizeof(DexFile::ClassDef), "class_defs")) {
1164 ptr_ += sizeof(DexFile::ClassDef);
1167 case DexFile::kDexTypeTypeList: {
1168 if (!CheckList(sizeof(DexFile::TypeItem), "type_list", &ptr_)) {
1173 case DexFile::kDexTypeAnnotationSetRefList: {
1174 if (!CheckList(sizeof(DexFile::AnnotationSetRefItem), "annotation_set_ref_list", &ptr_)) {
1179 case DexFile::kDexTypeAnnotationSetItem: {
1185 case DexFile::kDexTypeClassDataItem: {
1191 case DexFile::kDexTypeCodeItem: {
1197 case DexFile::kDexTypeStringDataItem: {
1203 case DexFile::kDexTypeDebugInfoItem: {
1209 case DexFile::kDexTypeAnnotationItem: {
1215 case DexFile::kDexTypeEncodedArrayItem: {
1221 case DexFile::kDexTypeAnnotationsDirectoryItem: {
1254 case DexFile::kDexTypeStringIdItem:
1258 case DexFile::kDexTypeTypeIdItem:
1262 case DexFile::kDexTypeProtoIdItem:
1266 case DexFile::kDexTypeFieldIdItem:
1270 case DexFile::kDexTypeMethodIdItem:
1274 case DexFile::kDexTypeClassDefItem:
1320 const DexFile::MapList* map = reinterpret_cast<const DexFile::MapList*>(begin_ + header_->map_off_);
1321 const DexFile::MapItem* item = map->list_;
1343 case DexFile::kDexTypeHeaderItem:
1355 case DexFile::kDexTypeStringIdItem:
1356 case DexFile::kDexTypeTypeIdItem:
1357 case DexFile::kDexTypeProtoIdItem:
1358 case DexFile::kDexTypeFieldIdItem:
1359 case DexFile::kDexTypeMethodIdItem:
1360 case DexFile::kDexTypeClassDefItem:
1366 case DexFile::kDexTypeMapList:
1376 ptr_ += sizeof(uint32_t) + (map->size_ * sizeof(DexFile::MapItem));
1377 offset = section_offset + sizeof(uint32_t) + (map->size_ * sizeof(DexFile::MapItem));
1379 case DexFile::kDexTypeTypeList:
1380 case DexFile::kDexTypeAnnotationSetRefList:
1381 case DexFile::kDexTypeAnnotationSetItem:
1382 case DexFile::kDexTypeClassDataItem:
1383 case DexFile::kDexTypeCodeItem:
1384 case DexFile::kDexTypeStringDataItem:
1385 case DexFile::kDexTypeDebugInfoItem:
1386 case DexFile::kDexTypeAnnotationItem:
1387 case DexFile::kDexTypeEncodedArrayItem:
1388 case DexFile::kDexTypeAnnotationsDirectoryItem:
1425 *success = false; return DexFile::kDexNoIndex16)
1431 *success = false; return DexFile::kDexNoIndex16)
1435 return DexFile::kDexNoIndex16;
1439 const DexFile::AnnotationsDirectoryItem* item =
1440 reinterpret_cast<const DexFile::AnnotationsDirectoryItem*>(ptr);
1444 DexFile::FieldAnnotationsItem* field_items = (DexFile::FieldAnnotationsItem*) (item + 1);
1446 *success = false; return DexFile::kDexNoIndex16)
1451 DexFile::MethodAnnotationsItem* method_items = (DexFile::MethodAnnotationsItem*) (item + 1);
1453 *success = false; return DexFile::kDexNoIndex16)
1458 DexFile::ParameterAnnotationsItem* parameter_items = (DexFile
1460 *success = false; return DexFile::kDexNoIndex16)
1464 return DexFile::kDexNoIndex16;
1468 const DexFile::StringId* item = reinterpret_cast<const DexFile::StringId*>(ptr_);
1471 if (!CheckOffsetToTypeMap(item->string_data_off_, DexFile::kDexTypeStringDataItem)) {
1477 const DexFile::StringId* prev_item = reinterpret_cast<const DexFile::StringId*>(previous_item_);
1486 ptr_ += sizeof(DexFile::StringId);
1491 const DexFile::TypeId* item = reinterpret_cast<const DexFile::TypeId*>(ptr_);
1503 const DexFile::TypeId* prev_item = reinterpret_cast<const DexFile::TypeId*>(previous_item_);
1511 ptr_ += sizeof(DexFile::TypeId);
1516 const DexFile::ProtoId* item = reinterpret_cast<const DexFile::ProtoId*>(ptr_);
1521 !CheckOffsetToTypeMap(item->parameters_off_, DexFile::kDexTypeTypeList)) {
1552 const DexFile::ProtoId* prev = reinterpret_cast<const DexFile::ProtoId*>(previous_item_);
1563 if (prev_idx == DexFile::kDexNoIndex16) {
1566 if (UNLIKELY(curr_idx == DexFile::kDexNoIndex16)) {
1584 ptr_ += sizeof(DexFile::ProtoId);
1589 const DexFile::FieldId* item = reinterpret_cast<const DexFile::FieldId*>(ptr_);
1614 const DexFile::FieldId* prev_item = reinterpret_cast<const DexFile::FieldId*>(previous_item_);
1631 ptr_ += sizeof(DexFile::FieldId);
1636 const DexFile::MethodId* item = reinterpret_cast<const DexFile::MethodId*>(ptr_);
1661 const DexFile::MethodId* prev_item = reinterpret_cast<const DexFile::MethodId*>(previous_item_);
1678 ptr_ += sizeof(DexFile::MethodId);
1683 const DexFile::ClassDef* item = reinterpret_cast<const DexFile::ClassDef*>(ptr_);
1705 !CheckOffsetToTypeMap(item->interfaces_off_, DexFile::kDexTypeTypeList)) {
1709 !CheckOffsetToTypeMap(item->annotations_off_, DexFile::kDexTypeAnnotationsDirectoryItem)) {
1713 !CheckOffsetToTypeMap(item->class_data_off_, DexFile::kDexTypeClassDataItem)) {
1717 !CheckOffsetToTypeMap(item->static_values_off_, DexFile::kDexTypeEncodedArrayItem)) {
1721 if (item->superclass_idx_ != DexFile::kDexNoIndex16) {
1730 const DexFile::TypeList* interfaces = dex_file_->GetInterfacesList(*item);
1768 if (UNLIKELY((data_definer != item->class_idx_) && (data_definer != DexFile::kDexNoIndex16))) {
1783 (annotations_definer != DexFile::kDexNoIndex16))) {
1789 ptr_ += sizeof(DexFile::ClassDef);
1794 const DexFile::AnnotationSetRefList* list =
1795 reinterpret_cast<const DexFile::AnnotationSetRefList*>(ptr_);
1796 const DexFile::AnnotationSetRefItem* item = list->list_;
1801 !CheckOffsetToTypeMap(item->annotations_off_, DexFile::kDexTypeAnnotationSetItem)) {
1812 const DexFile::AnnotationSetItem* set = reinterpret_cast<const DexFile::AnnotationSetItem*>(ptr_);
1818 if (*offsets != 0 && !CheckOffsetToTypeMap(*offsets, DexFile::kDexTypeAnnotationItem)) {
1823 const DexFile::AnnotationItem* annotation =
1824 reinterpret_cast<const DexFile::AnnotationItem*>(begin_ + *offsets);
1858 if (code_off != 0 && !CheckOffsetToTypeMap(code_off, DexFile::kDexTypeCodeItem)) {
1873 const DexFile::AnnotationsDirectoryItem* item =
1874 reinterpret_cast<const DexFile::AnnotationsDirectoryItem*>(ptr_);
1882 !CheckOffsetToTypeMap(item->class_annotations_off_, DexFile::kDexTypeAnnotationSetItem)) {
1887 const DexFile::FieldAnnotationsItem* field_item =
1888 reinterpret_cast<const DexFile::FieldAnnotationsItem*>(item + 1);
1897 if (!CheckOffsetToTypeMap(field_item->annotations_off_, DexFile::kDexTypeAnnotationSetItem)) {
1904 const DexFile::MethodAnnotationsItem* method_item =
1905 reinterpret_cast<const DexFile::MethodAnnotationsItem*>(field_item);
1914 if (!CheckOffsetToTypeMap(method_item->annotations_off_, DexFile::kDexTypeAnnotationSetItem)) {
1921 const DexFile::ParameterAnnotationsItem* parameter_item =
1922 reinterpret_cast<const DexFile::ParameterAnnotationsItem*>(method_item);
1932 DexFile::kDexTypeAnnotationSetRefList)) {
1946 case DexFile::kDexTypeClassDataItem:
1963 case DexFile::kDexTypeStringIdItem: {
1969 case DexFile::kDexTypeTypeIdItem: {
1975 case DexFile::kDexTypeProtoIdItem: {
1981 case DexFile::kDexTypeFieldIdItem: {
1987 case DexFile::kDexTypeMethodIdItem: {
1993 case DexFile::kDexTypeClassDefItem: {
1999 case DexFile::kDexTypeAnnotationSetRefList: {
2005 case DexFile::kDexTypeAnnotationSetItem: {
2011 case DexFile::kDexTypeClassDataItem: {
2017 case DexFile::kDexTypeAnnotationsDirectoryItem: {
2036 const DexFile::MapList* map = reinterpret_cast<const DexFile::MapList*>(begin_ + header_->map_off_);
2037 const DexFile::MapItem* item = map->list_;
2047 case DexFile::kDexTypeHeaderItem:
2048 case DexFile::kDexTypeMapList:
2049 case DexFile::kDexTypeTypeList:
2050 case DexFile::kDexTypeCodeItem:
2051 case DexFile::kDexTypeStringDataItem:
2052 case DexFile::kDexTypeDebugInfoItem:
2053 case DexFile::kDexTypeAnnotationItem:
2054 case DexFile::kDexTypeEncodedArrayItem:
2056 case DexFile::kDexTypeStringIdItem:
2057 case DexFile::kDexTypeTypeIdItem:
2058 case DexFile::kDexTypeProtoIdItem:
2059 case DexFile::kDexTypeFieldIdItem:
2060 case DexFile::kDexTypeMethodIdItem:
2061 case DexFile::kDexTypeClassDefItem:
2062 case DexFile::kDexTypeAnnotationSetRefList:
2063 case DexFile::kDexTypeAnnotationSetItem:
2064 case DexFile::kDexTypeClassDataItem:
2065 case DexFile::kDexTypeAnnotationsDirectoryItem: {