use crate::error::*;
use std::path::{Path, PathBuf};
use std::process::Command;
pub struct ExtractApks {
apks: PathBuf,
device_spec: PathBuf,
output_dir: PathBuf,
}
impl ExtractApks {
pub fn new(apks: &Path, device_spec: &Path, output_dir: &Path) -> Self {
Self {
apks: apks.to_owned(),
device_spec: device_spec.to_owned(),
output_dir: output_dir.to_owned(),
}
}
pub fn run(&self) -> Result<()> {
let mut extract_apks = Command::new("extract-apks");
extract_apks.arg("--apks");
extract_apks.arg(&self.apks);
extract_apks.arg("--device-spec");
extract_apks.arg(&self.device_spec);
extract_apks.arg("--output-dir");
extract_apks.arg(&self.output_dir);
extract_apks.output_err(true)?;
Ok(())
}
}