clean doc

This commit is contained in:
Jean-Marie Mineau 2023-08-30 14:18:32 +02:00
parent b5ae8c5088
commit df2a441148
Signed by: histausse
GPG key ID: B66AEEDA9B645AD2
13 changed files with 84 additions and 80 deletions

View file

@ -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 {