clean doc
This commit is contained in:
parent
b5ae8c5088
commit
df2a441148
13 changed files with 84 additions and 80 deletions
|
|
@ -4,7 +4,7 @@ use std::io::Write;
|
|||
// To derive Serializable
|
||||
use crate as androscalpel_serializer;
|
||||
|
||||
/// Encoded Annotation https://source.android.com/docs/core/runtime/dex-format#encoded-annotation
|
||||
/// <https://source.android.com/docs/core/runtime/dex-format#encoded-annotation>
|
||||
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||
pub struct EncodedAnnotation {
|
||||
/// Type of the annotation. This must be a class (not array or primitive) type.
|
||||
|
|
@ -20,7 +20,7 @@ impl EncodedAnnotation {
|
|||
}
|
||||
}
|
||||
|
||||
/// Annotation: https://source.android.com/docs/core/runtime/dex-format#annotation-element
|
||||
/// <https://source.android.com/docs/core/runtime/dex-format#annotation-element>
|
||||
#[derive(Serializable, Debug, Clone, PartialEq, Eq)]
|
||||
pub struct AnnotationElement {
|
||||
pub name_idx: Uleb128,
|
||||
|
|
|
|||
|
|
@ -7,23 +7,23 @@ use crate as androscalpel_serializer;
|
|||
use crate::{ReadSeek, Result, Serializable};
|
||||
use std::io::Write;
|
||||
|
||||
/// https://source.android.com/docs/core/runtime/dex-format#referenced-from-class_def_item_1
|
||||
/// <https://source.android.com/docs/core/runtime/dex-format#referenced-from-class_def_item_1>
|
||||
/// alignment: 4 bytes
|
||||
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||
pub struct AnnotationDirectoryItem {
|
||||
/// 0 if they are no annotation, else offset of an [`AnnotationSetItem`].
|
||||
/// 0 if they are no annotation, else offset of an [`crate::AnnotationSetItem`].
|
||||
pub class_annotations_off: u32,
|
||||
// pub fields_size: u32,
|
||||
// pub annotated_methods_size: u32,
|
||||
// pub annotated_parameters_size: u32,
|
||||
/// List of field annotation. The field annotations must be sorted by
|
||||
/// increasing order of [`FieldAnnotation.field_idx`].
|
||||
/// increasing order of [`crate::FieldAnnotation.field_idx`].
|
||||
pub field_annotations: Vec<FieldAnnotation>,
|
||||
/// List of method annotation. The method annotations must be sorted by
|
||||
/// increasing order of [`MethodAnnotation.method_idx`].
|
||||
/// increasing order of [`crate::MethodAnnotation.method_idx`].
|
||||
pub method_annotation: Vec<MethodAnnotation>,
|
||||
/// List of associated method parameter annotation. The parameter annotations
|
||||
/// must be sorted by increasing order of [`ParameterAnnotation.parameter_size`].
|
||||
/// must be sorted by increasing order of [`crate::ParameterAnnotation.parameter_size`].
|
||||
pub parameter_annotations: Vec<ParameterAnnotation>,
|
||||
}
|
||||
|
||||
|
|
@ -105,7 +105,7 @@ impl Serializable for AnnotationDirectoryItem {
|
|||
}
|
||||
}
|
||||
|
||||
/// https://source.android.com/docs/core/runtime/dex-format#field-annotation
|
||||
/// <https://source.android.com/docs/core/runtime/dex-format#field-annotation>
|
||||
#[derive(Serializable, Debug, Clone, PartialEq, Eq)]
|
||||
pub struct FieldAnnotation {
|
||||
pub field_idx: u32,
|
||||
|
|
@ -113,7 +113,7 @@ pub struct FieldAnnotation {
|
|||
pub annotation_off: u32,
|
||||
}
|
||||
|
||||
/// https://source.android.com/docs/core/runtime/dex-format#method-annotation
|
||||
/// <https://source.android.com/docs/core/runtime/dex-format#method-annotation>
|
||||
#[derive(Serializable, Debug, Clone, PartialEq, Eq)]
|
||||
pub struct MethodAnnotation {
|
||||
pub method_idx: u32,
|
||||
|
|
@ -121,7 +121,7 @@ pub struct MethodAnnotation {
|
|||
pub annotation_off: u32,
|
||||
}
|
||||
|
||||
/// https://source.android.com/docs/core/runtime/dex-format#parameter-annotation
|
||||
/// <https://source.android.com/docs/core/runtime/dex-format#parameter-annotation>
|
||||
#[derive(Serializable, Debug, Clone, PartialEq, Eq)]
|
||||
pub struct ParameterAnnotation {
|
||||
pub field_idx: u32,
|
||||
|
|
@ -129,7 +129,7 @@ pub struct ParameterAnnotation {
|
|||
pub annotation_off: u32,
|
||||
}
|
||||
|
||||
/// https://source.android.com/docs/core/runtime/dex-format#set-ref-list
|
||||
/// <https://source.android.com/docs/core/runtime/dex-format#set-ref-list>
|
||||
/// alignment: 4 bytes
|
||||
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||
pub struct AnnotationSetRefList {
|
||||
|
|
@ -164,14 +164,14 @@ impl Serializable for AnnotationSetRefList {
|
|||
}
|
||||
}
|
||||
|
||||
/// https://source.android.com/docs/core/runtime/dex-format#set-ref-item
|
||||
/// <https://source.android.com/docs/core/runtime/dex-format#set-ref-item>
|
||||
#[derive(Serializable, Debug, Clone, Copy, PartialEq, Eq)]
|
||||
pub struct AnnotationSetRefItem {
|
||||
/// 0 if there are no annotation, offset to a [`AnnotationSetItem`] else.
|
||||
pub annotations_off: u32,
|
||||
}
|
||||
|
||||
/// https://source.android.com/docs/core/runtime/dex-format#annotation-set-item
|
||||
/// <https://source.android.com/docs/core/runtime/dex-format#annotation-set-item>
|
||||
/// alignment: 4
|
||||
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||
pub struct AnnotationSetItem {
|
||||
|
|
@ -207,14 +207,14 @@ impl Serializable for AnnotationSetItem {
|
|||
}
|
||||
}
|
||||
|
||||
/// https://source.android.com/docs/core/runtime/dex-format#off-item
|
||||
/// <https://source.android.com/docs/core/runtime/dex-format#off-item>
|
||||
#[derive(Serializable, Debug, Clone, Copy, PartialEq, Eq)]
|
||||
pub struct AnnotationOffItem {
|
||||
/// Offset to a [`AnnotationItem`]
|
||||
/// Offset to a [`crate::AnnotationItem`]
|
||||
pub annotation_off: u32,
|
||||
}
|
||||
|
||||
/// https://source.android.com/docs/core/runtime/dex-format#annotation-item
|
||||
/// <https://source.android.com/docs/core/runtime/dex-format#annotation-item>
|
||||
#[derive(Serializable, Debug, Clone, PartialEq, Eq)]
|
||||
pub struct AnnotationItem {
|
||||
pub visibility: AnnotationVisibility,
|
||||
|
|
@ -222,7 +222,7 @@ pub struct AnnotationItem {
|
|||
}
|
||||
|
||||
// TODO: Enum or flags ?
|
||||
/// https://source.android.com/docs/core/runtime/dex-format#annotation-item
|
||||
/// <https://source.android.com/docs/core/runtime/dex-format#annotation-item>
|
||||
#[derive(Serializable, Debug, Clone, PartialEq, Eq)]
|
||||
#[prefix_type(u8)]
|
||||
pub enum AnnotationVisibility {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue