1
2
3
4
5
6
7
8
9
10
11
12
13
use crate::error::*;
use std::{
    fs,
    path::{Path, PathBuf},
};

/// Allows to extract files from generated APK to use that to generate `.aab`
pub fn extract_archive(archive_path: &Path, output_dir: &Path) -> Result<PathBuf> {
    let file = fs::File::open(archive_path)?;
    let mut archive = zip::ZipArchive::new(file)?;
    archive.extract(output_dir)?;
    Ok(output_dir.to_owned())
}