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::{Limits, OpenPack};
use std::env;
use std::path::Path;

fn main() -> Result<(), Box<dyn std::error::Error>> {
    let path = env::args().nth(1).expect("provide path");
    let cfg = env::args().nth(2);

    let limits = match cfg {
        Some(cfg_path) => Limits::from_toml_file(Path::new(&cfg_path))?,
        None => Limits::default(),
    };

    let pack = OpenPack::open(path, limits)?;
    println!("entries={}", pack.entries()?.len());
    Ok(())
}