creator_tools/commands/android/
align_apk.rs1use crate::error::*;
2use crate::tools::*;
3use std::path::{Path, PathBuf};
4
5pub fn align_apk(
8 sdk: &AndroidSdk,
9 unaligned_apk_path: &Path,
10 package: &str,
11 build_dir: &Path,
12) -> Result<PathBuf> {
13 let unsigned_apk_path = build_dir.join(format!("{}.apk", package));
14 let mut zipalign = sdk.build_tool(bin!("zipalign"), None)?;
15 zipalign
16 .arg("-f")
17 .arg("-v")
18 .arg("4")
19 .arg(unaligned_apk_path)
20 .arg(&unsigned_apk_path);
21 zipalign.output_err(true)?;
22 Ok(unsigned_apk_path)
23}