PrettyPrint

Trait PrettyPrint 

Source
pub trait PrettyPrint {
    // Required methods
    fn method(&self, index: u16) -> (String, String, String, String);
    fn field(&self, index: u16) -> (String, String, String);
    fn string(&self, index: u32) -> String;
    fn type_name(&self, index: u16) -> String;

    // Provided method
    fn print(&self, inst: &Instruction) -> String { ... }
}
Expand description

Trait for pretty printing dalvik instructions such that they include method names, string literals, field names, etc.

The metadata required is usually in Dex metadata, for which this crate does not parse yet.

Required Methods§

Source

fn method(&self, index: u16) -> (String, String, String, String)

Method lookup. Should return (Class, Name, Params, Return)

Source

fn field(&self, index: u16) -> (String, String, String)

Field lookup. Should return (Class, Name, Type)

Source

fn string(&self, index: u32) -> String

String lookup. Should return contents of the string at the given index.

Source

fn type_name(&self, index: u16) -> String

Type lookup. Should return the encoded name of the type.

Provided Methods§

Source

fn print(&self, inst: &Instruction) -> String

Pretty print the instruction

Newline is not added to the end.

Implementors§