// Raw type_id_item. structTypeId {
dex::StringIndex descriptor_idx_; // index into string_ids
private:
DISALLOW_COPY_AND_ASSIGN(TypeId);
};
// Raw field_id_item. struct FieldId {
dex::TypeIndex class_idx_; // index into type_ids_ array for defining class
dex::TypeIndex type_idx_; // index into type_ids_ array for field type
dex::StringIndex name_idx_; // index into string_ids_ array for field name
private:
DISALLOW_COPY_AND_ASSIGN(FieldId);
};
// Raw proto_id_item. struct ProtoId {
dex::StringIndex shorty_idx_; // index into string_ids array for shorty descriptor
dex::TypeIndex return_type_idx_; // index into type_ids array for return type
uint16_t pad_; // padding = 0
uint32_t parameters_off_; // file offset to type_list for parameter types
// Raw method_id_item. struct MethodId {
dex::TypeIndex class_idx_; // index into type_ids_ array for defining class
dex::ProtoIndex proto_idx_; // index into proto_ids_ array for method prototype
dex::StringIndex name_idx_; // index into string_ids_ array for method name
// Base code_item, compact dex and standard dex have different code item layouts. struct CodeItem { protected:
CodeItem() = default;
private:
DISALLOW_COPY_AND_ASSIGN(CodeItem);
};
// Raw class_def_item. struct ClassDef {
dex::TypeIndex class_idx_; // index into type_ids_ array for this class
uint16_t pad1_; // padding = 0
uint32_t access_flags_;
dex::TypeIndex superclass_idx_; // index into type_ids_ array for superclass
uint16_t pad2_; // padding = 0
uint32_t interfaces_off_; // file offset to TypeList
dex::StringIndex source_file_idx_; // index into string_ids_ for source file name
uint32_t annotations_off_; // file offset to annotations_directory_item
uint32_t class_data_off_; // file offset to class_data_item
uint32_t static_values_off_; // file offset to EncodedArray
// Returns the valid access flags, that is, Java modifier bits relevant to the ClassDef type // (class or interface). These are all in the lower 16b and do not contain runtime flags.
uint32_t GetJavaAccessFlags() const { // Make sure that none of our runtime-only flags are set.
static_assert((kAccValidClassFlags & kAccJavaFlagsMask) == kAccValidClassFlags, "Valid class flags not a subset of Java flags");
static_assert((kAccValidInterfaceFlags & kAccJavaFlagsMask) == kAccValidInterfaceFlags, "Valid interface flags not a subset of Java flags");
// Size in bytes of the part of the list that is common. static constexpr size_t GetHeaderSize() { return4U;
}
// Size in bytes of the whole type list including all the stored elements. static constexpr size_t GetListSize(size_t count) { return GetHeaderSize() + sizeof(TypeItem) * count;
}
private:
uint32_t size_; // size of the list, in entries
TypeItem list_[1]; // elements of the list
DISALLOW_COPY_AND_ASSIGN(TypeList);
};
// raw method_handle_item struct MethodHandleItem {
uint16_t method_handle_type_;
uint16_t reserved1_; // Reserved for future use.
uint16_t field_or_method_idx_; // Field index for accessors, method index otherwise.
uint16_t reserved2_; // Reserved for future use. private:
DISALLOW_COPY_AND_ASSIGN(MethodHandleItem);
};
// raw call_site_id_item struct CallSiteIdItem {
uint32_t data_off_; // Offset into data section pointing to encoded array items. private:
DISALLOW_COPY_AND_ASSIGN(CallSiteIdItem);
};
struct HiddenapiClassData {
uint32_t size_; // total size of the item
uint32_t flags_offset_[1]; // array of offsets from the beginning of this item, // indexed by class def index
// Returns a pointer to the beginning of a uleb128-stream of hiddenapi // flags for a class def of given index. Values are in the same order // as fields/methods in the class data. Returns null if the class does // not have class data. const uint8_t* GetFlagsPointer(uint32_t class_def_idx) const { if (flags_offset_[class_def_idx] == 0) { return nullptr;
} else { returnreinterpret_cast<const uint8_t*>(this) + flags_offset_[class_def_idx];
}
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.