add type lists to generated dex files

This commit is contained in:
Jean-Marie Mineau 2023-12-01 18:08:30 +01:00
parent 211402ae9d
commit 57d6b38746
Signed by: histausse
GPG key ID: B66AEEDA9B645AD2
11 changed files with 338 additions and 25 deletions

View file

@ -1,5 +1,7 @@
//! Class definitions.
use std::hash::Hash;
use crate as androscalpel_serializer;
use crate::{ReadSeek, Result, Serializable, Uleb128};
use std::io::Write;
@ -207,7 +209,7 @@ pub struct EncodedMethod {
/// <https://source.android.com/docs/core/runtime/dex-format#type-list>
/// alignment: 4 bytes
#[derive(Debug, Clone, PartialEq, Eq)]
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct TypeList {
// pub size: u32,
pub list: Vec<TypeItem>,
@ -246,7 +248,7 @@ impl Serializable for TypeList {
}
/// <https://source.android.com/docs/core/runtime/dex-format#type-item-format>
#[derive(Serializable, Debug, Clone, Copy, PartialEq, Eq)]
#[derive(Serializable, Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub struct TypeItem {
/// Index of a [`crate::TypeIdItem`] in the `type_ids` list.
pub type_idx: u16,