openpack 0.1.0

Safe archive-reader for ZIP-derived formats (ZIP, CRX, JAR, APK, IPA) with BOM-safe checks.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use openpack::OpenPack;
use std::env;

fn main() -> Result<(), Box<dyn std::error::Error>> {
    let path = env::args().nth(1).expect("provide path to archive");
    let pack = OpenPack::open_default(path)?;
    println!("format={}", pack.format());
    println!("entry count={}", pack.entries()?.len());
    println!("mapped bytes={}", pack.mmap().len());
    for entry in pack.entries()? {
        println!(
            "{} dir={} size={} comp={}",
            entry.name, entry.is_dir, entry.uncompressed_size, entry.compressed_size
        );
    }
    Ok(())
}