Struct proguard::ProguardMapper[][src]

pub struct ProguardMapper<'s> { /* fields omitted */ }

A Proguard Remapper.

This can remap class names, stack frames one at a time, or the complete raw stacktrace.

Implementations

impl<'s> ProguardMapper<'s>[src]

pub fn new(mapping: ProguardMapping<'s>) -> Self[src]

Create a new ProguardMapper.

pub fn remap_class(&'s self, class: &str) -> Option<&'s str>[src]

Remaps an obfuscated Class.

This works on the fully-qualified name of the class, with its complete module prefix.

Examples

let mapping = r#"android.arch.core.executor.ArchTaskExecutor -> a.a.a.a.c:"#;
let mapper = proguard::ProguardMapper::from(mapping);

let mapped = mapper.remap_class("a.a.a.a.c");
assert_eq!(mapped, Some("android.arch.core.executor.ArchTaskExecutor"));

pub fn remap_frame(&'s self, frame: &StackFrame<'s>) -> RemappedFrameIter<'s>

Notable traits for RemappedFrameIter<'m>

impl<'m> Iterator for RemappedFrameIter<'m> type Item = StackFrame<'m>;
[src]

Remaps a single Stackframe.

Returns zero or more StackFrames, based on the information in the proguard mapping. This can return more than one frame in the case of inlined functions. In that case, frames are sorted top to bottom.

pub fn remap_throwable<'a>(
    &'a self,
    throwable: &Throwable<'a>
) -> Option<Throwable<'a>>
[src]

Remaps a throwable which is the first line of a full stacktrace.

Example

use proguard::{ProguardMapper, Throwable};

let mapping = "com.example.Mapper -> a.b:";
let mapper = ProguardMapper::from(mapping);

let throwable = Throwable::try_parse(b"a.b: Crash").unwrap();
let mapped = mapper.remap_throwable(&throwable);

assert_eq!(
    Some(Throwable::with_message("com.example.Mapper", "Crash")),
    mapped
);

pub fn remap_stacktrace(&self, input: &str) -> Result<String, Error>[src]

Remaps a complete Java StackTrace, similar to Self::remap_stacktrace but instead works on strings as input and output.

pub fn remap_stacktrace_typed<'a>(
    &'a self,
    trace: &StackTrace<'a>
) -> StackTrace<'a>
[src]

Remaps a complete Java StackTrace.

Trait Implementations

impl<'s> Clone for ProguardMapper<'s>[src]

impl<'s> Debug for ProguardMapper<'s>[src]

impl<'s> From<&'s str> for ProguardMapper<'s>[src]

Auto Trait Implementations

impl<'s> RefUnwindSafe for ProguardMapper<'s>

impl<'s> Send for ProguardMapper<'s>

impl<'s> Sync for ProguardMapper<'s>

impl<'s> Unpin for ProguardMapper<'s>

impl<'s> UnwindSafe for ProguardMapper<'s>

Blanket Implementations

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

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

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

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

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

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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.

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.