Skip to content

Commit 44aa26f

Browse files
committed
chore: enforce macOS aarch64 support and refine release pipeline
1 parent 91ecb46 commit 44aa26f

3 files changed

Lines changed: 16 additions & 64 deletions

File tree

README.cn.md

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -74,30 +74,6 @@ insert-dylib --strip-codesig --overwrite @loader_path/libHook.dylib MyApp MyApp.
7474
codesign --force --sign - MyApp.patched
7575
```
7676

77-
## CI 与自动发布
78-
79-
- CI 工作流:`.github/workflows/ci.yml`
80-
-**macOS aarch64** 上执行 `fmt``check``clippy``test`
81-
- Release 工作流:`.github/workflows/release.yml`
82-
- 当推送形如 `v1.0.0` 的 tag 时自动触发
83-
- 构建 **macOS aarch64** 发布二进制并上传到 GitHub Release。
84-
85-
发布示例:
86-
87-
```bash
88-
git tag v0.1.0
89-
git push origin v0.1.0
90-
```
91-
92-
## 发布到 crates.io
93-
94-
发布前建议执行:
95-
96-
```bash
97-
cargo package
98-
cargo publish
99-
```
100-
10177
## 法律与安全
10278

10379
请仅对你有权限修改的二进制使用本工具。

README.md

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -74,30 +74,6 @@ If `LC_CODE_SIGNATURE` is removed, the binary's signature is invalidated. Re-sig
7474
codesign --force --sign - MyApp.patched
7575
```
7676

77-
## CI and Release
78-
79-
- CI workflow: `.github/workflows/ci.yml`
80-
- Runs `fmt`, `check`, `clippy`, and `test` on **macOS aarch64**.
81-
- Release workflow: `.github/workflows/release.yml`
82-
- Triggered when pushing tags like `v1.0.0`
83-
- Builds **macOS aarch64** release binaries and publishes GitHub Release assets.
84-
85-
Create a release tag:
86-
87-
```bash
88-
git tag v0.1.0
89-
git push origin v0.1.0
90-
```
91-
92-
## Publish to crates.io
93-
94-
Before publishing:
95-
96-
```bash
97-
cargo package
98-
cargo publish
99-
```
100-
10177
## Legal / Safety
10278

10379
Use this tool only on binaries you are authorized to modify.

src/main.rs

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -421,22 +421,22 @@ fn check_load_commands(
421421
linkedit_filesize -= datasize;
422422
let linkedit_vmsize = round_up(linkedit_filesize, 0x1000);
423423

424-
if let Some(pos) = linkedit_32_pos {
425-
if let Some(mut seg) = linkedit_32 {
426-
seg.filesize = swap32(linkedit_filesize as u32, mh.magic);
427-
seg.vmsize = swap32(linkedit_vmsize as u32, mh.magic);
428-
429-
file.seek(SeekFrom::Start(pos))?;
430-
write_struct(file, &seg)?;
431-
}
432-
} else if let Some(pos) = linkedit_64_pos {
433-
if let Some(mut seg) = linkedit_64 {
434-
seg.filesize = swap64(linkedit_filesize, mh.magic);
435-
seg.vmsize = swap64(linkedit_vmsize, mh.magic);
436-
437-
file.seek(SeekFrom::Start(pos))?;
438-
write_struct(file, &seg)?;
439-
}
424+
if let Some(pos) = linkedit_32_pos
425+
&& let Some(mut seg) = linkedit_32
426+
{
427+
seg.filesize = swap32(linkedit_filesize as u32, mh.magic);
428+
seg.vmsize = swap32(linkedit_vmsize as u32, mh.magic);
429+
430+
file.seek(SeekFrom::Start(pos))?;
431+
write_struct(file, &seg)?;
432+
} else if let Some(pos) = linkedit_64_pos
433+
&& let Some(mut seg) = linkedit_64
434+
{
435+
seg.filesize = swap64(linkedit_filesize, mh.magic);
436+
seg.vmsize = swap64(linkedit_vmsize, mh.magic);
437+
438+
file.seek(SeekFrom::Start(pos))?;
439+
write_struct(file, &seg)?;
440440
}
441441

442442
mh.ncmds = swap32(ncmds - 1, mh.magic);

0 commit comments

Comments
 (0)