1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
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(())
}
}