Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions Formula/binary-analyzer.rb
Original file line number Diff line number Diff line change
@@ -1,33 +1,33 @@
class BinaryAnalyzer < Formula
desc "Static analysis tool for mobile apps using the Airbridge SDK"
homepage "https://www.airbridge.io/"
homepage "https://sdk-internal.airbridge.io/binary-analyzer/latest/"

version = "0.0.0"
sha_macos_aarch64 = "72a0f59075c35eeaec705f192cb4abca6594231f01846e54aa5d970f0acb4498"
sha_macos_x64 = "96f1293f5359c2f22e39107bcf4cf36f8811916f00ef90dcdf94f0f32c319406"
binary_analyzer_version = "0.0.1"
sha_macos_aarch64 = "0fa5eee9a44dfc6de144f975d333e96031b5d8d0fd9f0f23ca20966adc32ea1b"
sha_macos_x64 = "1a4d2887934fddc0ffa7d01811dc52315f50bd7faaadce3bf146078fbdd9c262"
Comment on lines +5 to +7
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Homebrew DSL의 version을 그대로 활용하면 중복 정의를 피할 수 있습니다
binary_analyzer_version 변수를 따로 두면 값 변경 시 DSL version 과 불일치할 여지가 생깁니다. 다음과 같이 상단에 version "0.0.1" 한 줄만 선언하고 URL에는 \#{version}을 사용하면 DRY 원칙을 지킬 수 있습니다.

- binary_analyzer_version = "0.0.1"
+ version "0.0.1"

그리고

- url "https://sdk-internal.airbridge.io/binary-analyzer/#{binary_analyzer_version}/macos-aarch64/binary-analyzer.tar.gz"
+ url "https://sdk-internal.airbridge.io/binary-analyzer/#{version}/macos-aarch64/binary-analyzer.tar.gz"

같은 방식으로 모든 URL을 수정할 수 있습니다.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
binary_analyzer_version = "0.0.1"
sha_macos_aarch64 = "0fa5eee9a44dfc6de144f975d333e96031b5d8d0fd9f0f23ca20966adc32ea1b"
sha_macos_x64 = "1a4d2887934fddc0ffa7d01811dc52315f50bd7faaadce3bf146078fbdd9c262"
version "0.0.1"
sha_macos_aarch64 = "0fa5eee9a44dfc6de144f975d333e96031b5d8d0fd9f0f23ca20966adc32ea1b"
sha_macos_x64 = "1a4d2887934fddc0ffa7d01811dc52315f50bd7faaadce3bf146078fbdd9c262"
🤖 Prompt for AI Agents
In Formula/binary-analyzer.rb around lines 5 to 7, avoid defining the version in
a separate variable named binary_analyzer_version. Instead, declare the version
once at the top using the Homebrew DSL's version "0.0.1" syntax. Then update all
URLs to reference this version via #{version} interpolation to prevent
duplication and ensure consistency.

# sha_linux_aarch64 = ""
sha_linux_x64 = "e4fcb32135a385bb9483e045f5584b92d9c8dc5a7147a7f252197a839253218d"
sha_linux_x64 = "59a937942c9c84edeedc8688b9f225ecb1a9f9a5b5d2560b37f714142f8e8118"

on_macos do
if Hardware::CPU.arm?
url "https://sdk-internal.airbridge.io/binary-analyzer/#{version}/macos-aarch64/binary-analyzer.tar.gz"
url "https://sdk-internal.airbridge.io/binary-analyzer/#{binary_analyzer_version}/macos-aarch64/binary-analyzer.tar.gz"
sha256 sha_macos_aarch64
else
url "https://sdk-internal.airbridge.io/binary-analyzer/#{version}/macos-x64/binary-analyzer.tar.gz"
url "https://sdk-internal.airbridge.io/binary-analyzer/#{binary_analyzer_version}/macos-x64/binary-analyzer.tar.gz"
sha256 sha_macos_x64
end
end

on_linux do
# if Hardware::CPU.arm? && Hardware::CPU.is_64_bit?
# url "https://sdk-internal.airbridge.io/binary-analyzer/#{version}/linux-aarch64/binary-analyzer.tar.gz"
# url "https://sdk-internal.airbridge.io/binary-analyzer/#{binary_analyzer_version}/linux-aarch64/binary-analyzer.tar.gz"
# sha256 sha_linux_aarch64
# end
if Hardware::CPU.intel?
url "https://sdk-internal.airbridge.io/binary-analyzer/#{version}/linux-x64/binary-analyzer.tar.gz"
url "https://sdk-internal.airbridge.io/binary-analyzer/#{binary_analyzer_version}/linux-x64/binary-analyzer.tar.gz"
sha256 sha_linux_x64
else
version "0.0.0"
version binary_analyzer_version
# Dummy URL and SHA256 just to satisfy Homebrew audit for Linux ARM
url "https://example.com/unsupported-linux-arm.tar.gz"
sha256 "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" # SHA of empty file
Comment on lines +30 to 33
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

version DSL 호출 위치가 특정 분기 안에만 존재합니다
Linux ARM 비지원 분기에서만 version binary_analyzer_version를 호출하면, 다른 플랫폼(예: macOS, Linux x64)에서는 DSL version이 설정되지 않은 상태가 됩니다. 상단에 단일 version 선언을 두면 이 문제도 자연히 해결됩니다.

🤖 Prompt for AI Agents
In Formula/binary-analyzer.rb around lines 30 to 33, the version DSL call is
placed only inside a specific conditional branch for Linux ARM, causing other
platforms to lack a version declaration. Move the version
binary_analyzer_version call outside and above all platform-specific
conditionals so it is always set regardless of platform, ensuring consistent
version declaration across all builds.

Expand Down
17 changes: 10 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,20 @@

## How do I install these formulae?

`brew install ab180/binary-analyzer/<formula>`
### Install

Or `brew tap ab180/binary-analyzer` and then `brew install <formula>`.
```shell
brew tap ab180/binary-analyzer
brew install binary-analyzer
```

Or, in a `brew bundle` `Brewfile`:
### Uninstall

```ruby
tap "ab180/binary-analyzer"
brew "<formula>"
```shell
brew uninstall binary-analyzer
brew untap ab180/binary-analyzer
```

## Documentation

`brew help`, `man brew` or check [Homebrew's documentation](https://docs.brew.sh).
`brew help`, `man brew` or check [Homebrew's documentation](https://docs.brew.sh).
Loading