diff --git a/androscalpel/src/lib.rs b/androscalpel/src/lib.rs index 0052c06..086daec 100644 --- a/androscalpel/src/lib.rs +++ b/androscalpel/src/lib.rs @@ -8,6 +8,7 @@ pub mod class; pub mod code; pub mod dex_id; pub mod dex_string; +pub mod dex_writer; pub mod field; pub mod method; pub mod method_handle; @@ -20,6 +21,7 @@ pub use class::*; pub use code::*; pub use dex_id::*; pub use dex_string::*; +pub use dex_writer::*; pub use field::*; pub use method::*; pub use method_handle::*; diff --git a/androscalpel_serializer/src/constant.rs b/androscalpel_serializer/src/constant.rs index 21d606d..7a26840 100644 --- a/androscalpel_serializer/src/constant.rs +++ b/androscalpel_serializer/src/constant.rs @@ -6,7 +6,7 @@ pub use androscalpel_serializer_derive::*; /// [dex-file-magic](https://source.android.com/docs/core/runtime/dex-format#dex-file-magic) /// `version` is the Dex version of this file (encoded decimal digit). -#[derive(Serializable, PartialEq, Eq, Debug)] +#[derive(Serializable, PartialEq, Eq, Debug, Clone)] pub struct DexFileMagic { #[prefix([0x64, 0x65, 0x78, 0x0a])] #[suffix([0x00])] @@ -17,7 +17,7 @@ pub struct DexFileMagic { /// /// The only supported value as of 2023 is [`EndianConstant`] /// ([because](https://cs.android.com/android/platform/superproject/main/+/main:art/libdexfile/dex/dex_file_verifier.cc;l=597;drc=397dd78fcdcfed36ee62302e2b90712e2d784364)) -#[derive(Serializable, PartialEq, Eq, Debug)] +#[derive(Serializable, PartialEq, Eq, Debug, Clone)] #[prefix_type(u32)] pub enum EndianConstant { #[prefix(0x12345678)] diff --git a/androscalpel_serializer/src/items/header.rs b/androscalpel_serializer/src/items/header.rs index 8cf2699..03e53b6 100644 --- a/androscalpel_serializer/src/items/header.rs +++ b/androscalpel_serializer/src/items/header.rs @@ -5,7 +5,7 @@ use crate::{DexFileMagic, EndianConstant, Serializable}; /// /// alignment: 4 bytes -#[derive(Serializable, PartialEq, Eq, Debug)] +#[derive(Serializable, Clone, PartialEq, Eq, Debug)] pub struct HeaderItem { pub magic: DexFileMagic, pub checksum: u32, diff --git a/androscalpel_serializer/src/items/map.rs b/androscalpel_serializer/src/items/map.rs index 10ea0d6..46baddd 100644 --- a/androscalpel_serializer/src/items/map.rs +++ b/androscalpel_serializer/src/items/map.rs @@ -6,7 +6,7 @@ use std::io::Write; /// /// alignment: 4 bytes -#[derive(Clone, PartialEq, Eq, Debug)] +#[derive(Clone, PartialEq, Eq, Debug, Default)] pub struct MapList { // pub size: u32, pub list: Vec,