Skip to content

Commit

Permalink
Added get_qualified_method_names method
Browse files Browse the repository at this point in the history
  • Loading branch information
lukhio committed May 20, 2024
1 parent f2cc84b commit 9d9d84e
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,19 @@ pub fn parse(filepath: &str) -> DexFile {
let readers = DexReader::build_from_file(filepath);
DexFile::merge(readers)
}

pub fn get_qualified_method_names(dex: &DexFile) -> Vec<String> {
let mut methods = Vec::new();

let class_names = dex.get_classes_names();
for class in class_names.iter() {
if let Some(class_def) = dex.classes.get_class_def(class) {
for method in class_def.get_methods() {
let name = method.get_method_name();
methods.push(format!("{class}->{name}"));
}
}
}

methods
}

0 comments on commit 9d9d84e

Please sign in to comment.