pub struct DexPool {
pub dex_labels: Vec<String>,
pub order: Vec<String>,
/* private fields */
}Expand description
Multi-DEX class pool: classes from all images, first definition wins.
Fields§
§dex_labels: Vec<String>Human label per image (“weibo!classes.dex”) for the provenance header; defaults to “dex N” until the CLI names the inputs.
order: Vec<String>Class names in insertion order (stable for output).
Implementations§
Source§impl DexPool
impl DexPool
pub fn new() -> Self
Sourcepub fn proto_desc_parsed(
&self,
di: usize,
proto_idx: u32,
) -> Arc<MethodDescriptor> ⓘ
pub fn proto_desc_parsed( &self, di: usize, proto_idx: u32, ) -> Arc<MethodDescriptor> ⓘ
Shared MethodDescriptor of a proto (one parse per image).
Sourcepub fn type_name_arc(&self, di: usize, type_idx: u32) -> Arc<str> ⓘ
pub fn type_name_arc(&self, di: usize, type_idx: u32) -> Arc<str> ⓘ
Shared internal class name of a type id (one strip+alloc per image).
Sourcepub fn type_java(&self, di: usize, type_idx: u32) -> Arc<JavaType> ⓘ
pub fn type_java(&self, di: usize, type_idx: u32) -> Arc<JavaType> ⓘ
Shared parsed type of a type id.
Sourcepub fn has_dollar_prefix(&self, prefix: &str) -> bool
pub fn has_dollar_prefix(&self, prefix: &str) -> bool
The outer class of name, from the cached map (borrowed).
True when some pool class is named prefix$… (a LITERAL $ in a
class name — R8 desugars j$/util/..., anonymous ids). Used by
print_class_name: a $ boundary is a nesting dot only when the
left side is a known class AND no pool class carries that exact
$-literal prefix (android/os/Parcelable$Creator — the pool
has no android/os/Parcelable$* class, so Creator is a nested
type of an external framework class, not a literal name).
pub fn outer_of(&self, name: &str) -> Option<&str>
Sourcepub fn children_of(&self, internal: &str) -> &[String]
pub fn children_of(&self, internal: &str) -> &[String]
Direct nested children of internal (any $ depth 1), cached.
(Perf: returns a borrowed slice — the owned-Vec clone ran once per
class on 98k-class runs.)
Sourcepub fn add_dex(&mut self, dex: DexFile) -> usize
pub fn add_dex(&mut self, dex: DexFile) -> usize
Adds one image; duplicate class names keep their first definition.
Returns the image’s index — call set_dex_label with it to give the
provenance header a real origin instead of the default “dex N”.
Sourcepub fn add_dex_lazy(&mut self, dex: DexFile) -> usize
pub fn add_dex_lazy(&mut self, dex: DexFile) -> usize
Registers class NAMES only; the PoolClass (annotation reads
included) is materialized on first get. Duplicate class names
keep their first definition, matching add_dex.
Sourcepub fn set_dex_label(&mut self, idx: usize, label: impl Into<String>)
pub fn set_dex_label(&mut self, idx: usize, label: impl Into<String>)
Label the image at idx (see add_dex).
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn get(&self, internal: &str) -> Option<&PoolClass>
Sourcepub fn materialize_all(&self, threads: usize)
pub fn materialize_all(&self, threads: usize)
Materialize every lazy entry (parallel across the given chunk count). After this the pool is observationally identical to an eagerly-built one — including the annotation-aware outer-map — while the annotation reads ran on worker threads instead of the serial pool build (~0.2s on weibo).
Sourcepub fn dex(&self, idx: usize) -> Option<Arc<DexFile>>
pub fn dex(&self, idx: usize) -> Option<Arc<DexFile>>
One image as an Arc snapshot (borrows of the snapshot live as long as the caller holds the Arc).
pub fn dex_count(&self) -> usize
pub fn class_names(&self) -> impl Iterator<Item = &str>
Sourcepub fn is_subtype(&self, sub: &str, sup: &str) -> bool
pub fn is_subtype(&self, sub: &str, sup: &str) -> bool
True when sub is assignable to sup (internal names), walking the
pool’s hierarchy. Unknown classes are never assignable (conservative).
Source§impl DexPool
Classes to emit as their own compilation units: top-level classes plus
anonymous/local/lambda-shaped ones (clean members render inline).
impl DexPool
Classes to emit as their own compilation units: top-level classes plus anonymous/local/lambda-shaped ones (clean members render inline).
Sourcepub fn arm_retirement(&self)
pub fn arm_retirement(&self)
Arm image retirement (full-decompile driver only): count one pending class per image by pool ownership.
Sourcepub fn report_class_done(&self, class_name: &str) -> Option<usize>
pub fn report_class_done(&self, class_name: &str) -> Option<usize>
Report one class finished; Some(image) when it was the image’s last class (driver batches these into release_images).
Sourcepub fn release_images(&self, indexes: &[usize])
pub fn release_images(&self, indexes: &[usize])
Release the images’ inflated bytes. Safe: the driver calls this
only when every class of each image is emitted or failed; new
dex() snapshots still work (tables valid, code accessors empty).