Skip to main content

apk_info/
lib.rs

1//! `apk-info` provides an easy way to parse apk files using rust
2//!
3//! ## Introduction
4//!
5//! - A malware-friendly zip extractor. Great [article](https://unit42.paloaltonetworks.com/apk-badpack-malware-tampered-headers/) about `BadPack` technique;
6//! - A malware-friendly axml and arsc extractor;
7//! - A full AXML (Android Binary XML) implementation;
8//! - A full ARSC (Android Resource) implementation;
9//! - Support for extracting information contained in the `APK Signature Block 42`:
10//!     - [APK Signature scheme v1](https://source.android.com/docs/security/features/apksigning);
11//!     - [APK Signature scheme v2](https://source.android.com/docs/security/features/apksigning/v2);
12//!     - [APK Signature scheme v3](https://source.android.com/docs/security/features/apksigning/v3);
13//!     - [APK Signature scheme v3.1](https://source.android.com/docs/security/features/apksigning/v3-1);
14//!     - Stamp Block v1;
15//!     - Stamp Block v2;
16//!     - Apk Channel Block;
17//!     - Google Play Frosting (there are plans, but there is critically little information about it);
18//! - Correct extraction of the MainActivity based on how the Android OS [does it](https://xrefandroid.com/android-16.0.0_r2/xref/frameworks/base/core/java/android/app/ApplicationPackageManager.java#310);
19//!
20//! ## Example
21//!
22//! Get a package from given file:
23//!
24//! ```no_run
25//! use apk_info::Apk;
26//!
27//! let apk = Apk::new("./file.apk").expect("can't parse apk file");
28//! println!("{:?}", apk.get_package_name());
29//! ```
30//!
31//! Get main activity:
32//!
33//! ```no_run
34//! use apk_info::Apk;
35//!
36//! let apk = Apk::new("./file.apk").expect("can't parse apk file");
37//! let package_name = apk.get_package_name().expect("empty package name!");
38//! let main_activity = apk.get_main_activity().expect("main activity not found!");
39//! println!("{}/{}", package_name, main_activity);
40//! ```
41
42pub mod apk;
43pub mod errors;
44pub mod models;
45
46pub use apk::Apk;
47pub use apk_info_axml::*;
48pub use apk_info_zip::*;
49pub use errors::APKError;