Expand description
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);Re-exports§
Modules§
- apk
- The main structure that represents the
apkfile. - compression
- Possible types of compression.
- entry
- Describes a
ziparchive - errors
- Errors returned by this crate.
- models
- Abstractions over
manifesttags. - signature
- Describes signatures contained in the
APK Signature Block. - structs
- Describes all the structures that are necessary for
AXMLandARSCparsing.
Structs§
- ARSC
- Represents an Android Resource Table (ARSC) file.
- AXML
- Represents an Android Binary XML (AXML) file.
- Certificate
Info - Represents detailed information about an APK signing certificate.
- ZipEntry
- Represents a parsed ZIP archive.
Enums§
- Certificate
Error - Represents all errors that can occur while handling certificates.
- File
Compression Type - Represents the type of compression used for a file in a ZIP archive.
- Signature
- Describe used signature scheme in APK
- ZipError
- Represents all possible errors that can occur while parsing a ZIP archive.
Constants§
- ANDROID_
NAMESPACE - Default android namespace