apk-info provides an easy way to parse apk files using rust
Introduction
- A malware-friendly zip extractor. Great article about
BadPacktechnique; - A malware-friendly axml and arsc extractor;
- A full AXML (Android Binary XML) implementation;
- A full ARSC (Android Resource) implementation;
- Support for extracting information contained in the
APK Signature Block 42:- APK Signature scheme v1;
- APK Signature scheme v2;
- APK Signature scheme v3;
- APK Signature scheme v3.1;
- Stamp Block v1;
- Stamp Block v2;
- Apk Channel Block;
- Google Play Frosting (there are plans, but there is critically little information about it);
- Correct extraction of the MainActivity based on how the Android OS does it;
Example
Get a package from given file:
use apk_info::Apk;
let apk = Apk::new("./file.apk").expect("can't parse apk file");
println!("{:?}", apk.get_package_name());
Get main activity:
use apk_info::Apk;
let apk = Apk::new("./file.apk").expect("can't parse apk file");
let package_name = apk.get_package_name().expect("empty package name!");
let main_activity = apk.get_main_activity().expect("main activity not found!");
println!("{}/{}", package_name, main_activity);