Struct dex::Dex[][src]

pub struct Dex<T> { /* fields omitted */ }
Expand description

Represents a Dex file

Implementations

impl<T> Dex<T> where
    T: AsRef<[u8]>, 
[src]

pub fn header(&self) -> &Header[src]

The Header section

pub fn map_list(&self) -> &MapList[src]

pub fn get_source_file(&self, file_id: StringId) -> Result<Option<DexString>>[src]

Source file name in which a class is defined.

pub fn get_string(&self, string_id: StringId) -> Result<DexString>[src]

Returns a reference to the DexString represented by the given id.

pub fn get_type_from_descriptor(&self, descriptor: &str) -> Result<Option<Type>>[src]

Returns the Type corresponding to the descriptor.

pub fn get_type(&self, type_id: TypeId) -> Result<Type>[src]

Returns the Type represented by the give type_id.

pub fn find_class_by_name(&self, type_descriptor: &str) -> Result<Option<Class>>[src]

Finds Class by the given class name. The name should be in smali format. This method uses binary search to find the class definition using the property that the strings, type ids and class defs sections are in sorted.

pub fn get_interfaces(&self, offset: uint) -> Result<Vec<Type>>[src]

Returns the list of types which represent the interfaces of a class.

pub fn get_field_item(&self, field_id: FieldId) -> Result<FieldIdItem>[src]

Returns the FieldIdItem represented by a FieldId.

pub fn get_proto_item(&self, proto_id: ProtoId) -> Result<ProtoIdItem>[src]

Returns the ProtoIdItem represented by ProtoId.

pub fn get_method_item(&self, method_id: MethodId) -> Result<MethodIdItem>[src]

Returns the MethodIdItem represented by MethodId.

pub fn strings(&self) -> impl Iterator<Item = Result<DexString>>[src]

Iterator over the strings

pub fn get_field(
    &self,
    encoded_field: &EncodedField,
    initial_value: Option<EncodedValue>,
    annotations: AnnotationSetItem
) -> Result<Field>
[src]

Returns a Field given its component items.

pub fn get_method(
    &self,
    encoded_method: &EncodedMethod,
    method_annotations: AnnotationSetItem,
    parameter_annotations: AnnotationSetRefList
) -> Result<Method>
[src]

Returns a Method given its component items.

pub fn get_class_data(&self, offset: uint) -> Result<Option<ClassDataItem>>[src]

Returns the ClassDataItem at the given offset.

pub fn get_method_handle_item(
    &self,
    method_handle_id: MethodHandleId
) -> Result<MethodHandleItem>
[src]

Returns the MethodHandleItem represented by the MethodHandleId.

pub fn get_endian(&self) -> Endian[src]

Returns the endianness in the header section.

pub fn class_defs(&self) -> impl Iterator<Item = Result<ClassDefItem>> + '_[src]

Iterator over the class_defs section.

pub fn types(&self) -> impl Iterator<Item = Result<Type>> + '_[src]

Iterator over the type_ids section.

pub fn proto_ids(&self) -> impl Iterator<Item = Result<ProtoIdItem>> + '_[src]

Iterator over the proto_ids section.

pub fn field_ids(&self) -> impl Iterator<Item = Result<FieldIdItem>> + '_[src]

Iterator over the field_ids section.

pub fn method_ids(&self) -> impl Iterator<Item = Result<MethodIdItem>> + '_[src]

Iterator over the method_ids section.

pub fn method_handles(
    &self
) -> impl Iterator<Item = Result<MethodHandleItem>> + '_
[src]

Iterator over the method_handles section.

pub fn classes(&self) -> impl Iterator<Item = Result<Class>> + '_[src]

Iterator over the classes

pub fn get_code_item(&self, code_off: ulong) -> Result<Option<CodeItem>>[src]

Returns the CodeItem at the offset.

pub fn get_annotation_item(
    &self,
    annotation_off: uint
) -> Result<AnnotationItem>
[src]

Returns the AnnotationItem at the offset.

pub fn get_annotation_set_item(
    &self,
    annotation_set_item_off: uint
) -> Result<AnnotationSetItem>
[src]

Returns the AnnotationSetItem at the offset.

pub fn get_annotation_set_ref_list(
    &self,
    annotation_set_ref_list_off: uint
) -> Result<AnnotationSetRefList>
[src]

Returns the AnnotationSetRefList at the offset.

pub fn get_static_values(&self, static_values_off: uint) -> Result<EncodedArray>[src]

Returns the EncodedArray representing the static values of a class at the given offset.

pub fn get_annotations_directory_item(
    &self,
    annotations_directory_item_off: uint
) -> Result<AnnotationsDirectoryItem>
[src]

Returns the AnnotationsDirectoryItem at the offset.

pub fn get_debug_info_item(&self, debug_info_off: uint) -> Result<DebugInfoItem>[src]

Returns the DebugInfoItem at the offset.

Trait Implementations

impl<'a, S> TryFromCtx<'a, &'_ Dex<S>, [u8]> for EncodedAnnotation where
    S: AsRef<[u8]>, 
[src]

type Error = Error

type Size = usize

fn try_from_ctx(source: &'a [u8], ctx: &Dex<S>) -> Result<(Self, Self::Size)>[src]

impl<'a, S> TryFromCtx<'a, &'_ Dex<S>, [u8]> for AnnotationElement where
    S: AsRef<[u8]>, 
[src]

type Error = Error

type Size = usize

fn try_from_ctx(source: &'a [u8], ctx: &Dex<S>) -> Result<(Self, Self::Size)>[src]

impl<'a, S> TryFromCtx<'a, &'_ Dex<S>, [u8]> for DebugInfoItem where
    S: AsRef<[u8]>, 
[src]

type Error = Error

type Size = usize

fn try_from_ctx(
    source: &'a [u8],
    dex: &Dex<S>
) -> Result<(Self, Self::Size), Self::Error>
[src]

impl<'a, S> TryFromCtx<'a, &'_ Dex<S>, [u8]> for CodeItem where
    S: AsRef<[u8]>, 
[src]

type Error = Error

type Size = usize

fn try_from_ctx(
    source: &'a [u8],
    dex: &Dex<S>
) -> Result<(Self, Self::Size), Self::Error>
[src]

impl<'a, S> TryFromCtx<'a, &'_ Dex<S>, [u8]> for EncodedValue where
    S: AsRef<[u8]>, 
[src]

type Error = Error

type Size = usize

fn try_from_ctx(source: &'a [u8], dex: &Dex<S>) -> Result<(Self, Self::Size)>[src]

impl<'a, S> TryFromCtx<'a, &'_ Dex<S>, [u8]> for EncodedArray where
    S: AsRef<[u8]>, 
[src]

type Error = Error

type Size = usize

fn try_from_ctx(source: &'a [u8], ctx: &Dex<S>) -> Result<(Self, Self::Size)>[src]

impl<'a, S: AsRef<[u8]>> TryFromCtx<'a, &'_ Dex<S>, [u8]> for MethodHandleItem[src]

type Error = Error

type Size = usize

fn try_from_ctx(source: &'a [u8], dex: &Dex<S>) -> Result<(Self, Self::Size)>[src]

impl<'a, S> TryFromCtx<'a, &'_ Dex<S>, [u8]> for AnnotationItem where
    S: AsRef<[u8]>, 
[src]

type Error = Error

type Size = usize

fn try_from_ctx(source: &'a [u8], ctx: &Dex<S>) -> Result<(Self, Self::Size)>[src]

impl<'a, S> TryFromCtx<'a, &'_ Dex<S>, [u8]> for AnnotationSetRefList where
    S: AsRef<[u8]>, 
[src]

type Error = Error

type Size = usize

fn try_from_ctx(source: &'a [u8], ctx: &Dex<S>) -> Result<(Self, Self::Size)>[src]

impl<'a, S> TryFromCtx<'a, &'_ Dex<S>, [u8]> for AnnotationSetItem where
    S: AsRef<[u8]>, 
[src]

type Error = Error

type Size = usize

fn try_from_ctx(source: &'a [u8], ctx: &Dex<S>) -> Result<(Self, Self::Size)>[src]

impl<'a, S> TryFromCtx<'a, &'_ Dex<S>, [u8]> for ParameterAnnotations where
    S: AsRef<[u8]>, 
[src]

type Error = Error

type Size = usize

fn try_from_ctx(source: &'a [u8], ctx: &Dex<S>) -> Result<(Self, Self::Size)>[src]

impl<'a, S> TryFromCtx<'a, &'_ Dex<S>, [u8]> for MethodAnnotations where
    S: AsRef<[u8]>, 
[src]

type Error = Error

type Size = usize

fn try_from_ctx(source: &'a [u8], ctx: &Dex<S>) -> Result<(Self, Self::Size)>[src]

impl<'a, S> TryFromCtx<'a, &'_ Dex<S>, [u8]> for FieldAnnotations where
    S: AsRef<[u8]>, 
[src]

type Error = Error

type Size = usize

fn try_from_ctx(source: &'a [u8], ctx: &Dex<S>) -> Result<(Self, Self::Size)>[src]

impl<'a, S> TryFromCtx<'a, &'_ Dex<S>, [u8]> for AnnotationsDirectoryItem where
    S: AsRef<[u8]>, 
[src]

type Error = Error

type Size = usize

fn try_from_ctx(source: &'a [u8], ctx: &Dex<S>) -> Result<(Self, Self::Size)>[src]

impl<'a, S> TryFromCtx<'a, &'_ Dex<S>, [u8]> for ClassDataItem where
    S: AsRef<[u8]>, 
[src]

type Error = Error

type Size = usize

fn try_from_ctx(source: &'a [u8], dex: &Dex<S>) -> Result<(Self, Self::Size)>[src]

Auto Trait Implementations

impl<T> !RefUnwindSafe for Dex<T>

impl<T> !Send for Dex<T>

impl<T> !Sync for Dex<T>

impl<T> Unpin for Dex<T>

impl<T> !UnwindSafe for Dex<T>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.