add annotations to generated dex
This commit is contained in:
parent
53d321c7fe
commit
bd22b7990b
8 changed files with 599 additions and 38 deletions
|
|
@ -10,7 +10,7 @@ use std::io::Write;
|
|||
/// <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 {
|
||||
pub struct AnnotationsDirectoryItem {
|
||||
/// 0 if they are no annotation, else offset of an [`crate::AnnotationSetItem`].
|
||||
pub class_annotations_off: u32,
|
||||
// pub fields_size: u32,
|
||||
|
|
@ -27,7 +27,7 @@ pub struct AnnotationDirectoryItem {
|
|||
pub parameter_annotations: Vec<ParameterAnnotation>,
|
||||
}
|
||||
|
||||
impl AnnotationDirectoryItem {
|
||||
impl AnnotationsDirectoryItem {
|
||||
pub fn fields_size_field(&self) -> u32 {
|
||||
self.field_annotations.len() as u32
|
||||
}
|
||||
|
|
@ -39,7 +39,7 @@ impl AnnotationDirectoryItem {
|
|||
}
|
||||
}
|
||||
|
||||
impl Serializable for AnnotationDirectoryItem {
|
||||
impl Serializable for AnnotationsDirectoryItem {
|
||||
fn serialize(&self, output: &mut dyn Write) -> Result<()> {
|
||||
self.class_annotations_off.serialize(output)?;
|
||||
self.fields_size_field().serialize(output)?;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue