Dex文件结构及对应的数据结构

 



 

Dex文件结构及对应的数据结构_第1张图片

string_ids_off字段:


typedef struct DexStringId {

    u4  stringDataOff;      

} DexStringId;

type_ids_off字段:


struct DexTypeId {

    u4  descriptorIdx;      /* index into stringIds list for type descriptor */

};


proto_ids_off字段:


struct DexProtoId{

    u4 shortyIdx;         /* index into stringIds forshorty descriptor */

    u4 returnTypeIdx;     /* index into typeIds list for return type */

    u4 parametersOff;     /* file offset to type_list for parameter types */

};


field_ids_off字段:


struct DexFieldId{

    u2 classIdx;          /* index into typeIds list for defining class */

    u2 typeIdx;           /* index into typeIds for field type */

    u4 nameIdx;           /* index into stringIds for field name */

};


method_ids_off字段:


struct DexMethodId{

    u2 classIdx;          /* index into typeIds list for defining class */

    u2 protoIdx;          /* index into protoIds for method prototype */

    u4 nameIdx;           /* index into stringIds for method name */

};


class_defs_off字段:


struct DexClassDef{

    u4 classIdx;          /* index into typeIds for this class */

    u4 accessFlags;

    u4 superclassIdx;     /* index into typeIds for superclass */

    u4 interfacesOff;     /* file offset to DexTypeList */

    u4 sourceFileIdx;     /* index into stringIds for source file name */

    u4 annotationsOff;    /* file offset to annotations_directory_item */

    u4 classDataOff;      /* file offset to class_data_item */

    u4 staticValuesOff;   /* file offset to DexEncodedArray */

};

你可能感兴趣的:(Dex文件结构及对应的数据结构)