Thanks to visit codestin.com
Credit goes to docs.rs

Crate apk_info

Crate apk_info 

Source
Expand description

apk-info provides an easy way to parse apk files using rust

§Introduction

  • A malware-friendly zip extractor. Great article about BadPack technique;
  • 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:
  • 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§

pub use apk::Apk;
pub use errors::APKError;

Modules§

apk
The main structure that represents the apk file.
compression
Possible types of compression.
entry
Describes a zip archive
errors
Errors returned by this crate.
models
Abstractions over manifest tags.
signature
Describes signatures contained in the APK Signature Block.
structs
Describes all the structures that are necessary for AXML and ARSC parsing.

Structs§

ARSC
Represents an Android Resource Table (ARSC) file.
AXML
Represents an Android Binary XML (AXML) file.
CertificateInfo
Represents detailed information about an APK signing certificate.
ZipEntry
Represents a parsed ZIP archive.

Enums§

CertificateError
Represents all errors that can occur while handling certificates.
FileCompressionType
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