Skip to content

Commit

Permalink
x
Browse files Browse the repository at this point in the history
  • Loading branch information
littledivy committed Jul 23, 2024
1 parent 1f16561 commit 05cef2c
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -539,15 +539,14 @@ impl Macho {
Ok(())
}

pub fn build_and_sign<W: Write>(self, writer: W) -> Result<(), Error> {
let mut data = Vec::new();
self.build(&mut data)?;
pub fn build_and_sign<W: Write>(self, mut writer: W) -> Result<(), Error> {
if self.header.cputype & CPU_TYPE_ARM != 0 {
let mut data = Vec::new();
self.build(&mut data)?;
let codesign = apple_codesign::MachoSigner::new(data)?;
codesign.sign(writer)
} else {
writer.write_all(&data)?;
Ok(())
self.build(&mut writer)
}
}
}
Expand Down

0 comments on commit 05cef2c

Please sign in to comment.