proguard/lib.rs
1//! This crate implements handling of proguard mapping files.
2//!
3//! The main use case is to re-map classes or complete stack frames, but it can
4//! also be used to parse a proguard mapping line-by-line.
5//!
6//! The `uuid` feature also allows getting the UUID of the proguard file.
7//!
8//! # Examples
9//!
10//! ```
11//! let mapping = r#"
12//! android.arch.core.internal.SafeIterableMap -> a.a.a.b.c:
13//! 13:13:java.util.Map$Entry eldest():168:168 -> a
14//! "#;
15//! let mapper = proguard::ProguardMapper::from(mapping);
16//!
17//! // re-mapping a classname
18//! assert_eq!(
19//! mapper.remap_class("a.a.a.b.c"),
20//! Some("android.arch.core.internal.SafeIterableMap"),
21//! );
22//!
23//! // re-map a stack frame
24//! assert_eq!(
25//! mapper
26//! .remap_frame(&proguard::StackFrame::new("a.a.a.b.c", "a", 13))
27//! .collect::<Vec<_>>(),
28//! vec![proguard::StackFrame::new(
29//! "android.arch.core.internal.SafeIterableMap",
30//! "eldest",
31//! 168
32//! )],
33//! );
34//! ```
35
36#![warn(missing_docs)]
37
38mod builder;
39mod cache;
40mod java;
41mod mapper;
42mod mapping;
43mod stacktrace;
44
45pub use cache::{
46 class_name_to_descriptor, CacheError, CacheErrorKind, ProguardCache, PRGCACHE_VERSION,
47};
48pub use mapper::{DeobfuscatedSignature, ProguardMapper, RemappedFrameIter};
49pub use mapping::{
50 LineMapping, MappingSummary, ParseError, ParseErrorKind, ProguardMapping, ProguardRecord,
51 ProguardRecordIter,
52};
53pub use stacktrace::{StackFrame, StackTrace, Throwable};