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
8 changes: 0 additions & 8 deletions .github/workflows/build_executables.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,6 @@ jobs:
- name: Install dependencies
run: npm cache clean --force && npm install

- name: Resign native binaries with ad-hoc signature
if: matrix.os == 'macos-latest'
run: |
codesign --remove-signature resources/mac/qgenie-api || true
codesign --remove-signature resources/mac/qgenie-ai || true
codesign --sign - resources/mac/qgenie-api
codesign --sign - resources/mac/qgenie-ai

- name: Build the app
run: npm run build -- --${{ matrix.os == 'macos-latest' && 'mac' || 'win' }}

Expand Down
1 change: 1 addition & 0 deletions electron-builder.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
appId: com.Queryus.QGenie
productName: QGenie
afterPack: ./scripts/afterPack.js
extraResources:
- from: 'resources/'
to: 'resources'
Expand Down
42 changes: 42 additions & 0 deletions scripts/afterPack.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
// scripts/afterPack.js
import { execSync } from 'child_process'
import path from 'path'

exports.default = async function (context) {
const { appOutDir, packager } = context
const appName = packager.appInfo.productFilename

// macOS 빌드일 경우에만 실행
if (process.platform !== 'darwin') {
return
}

console.log('--- afterPack hook: Resigning native binaries ---')

// 서명할 실행 파일들의 경로를 지정합니다.
const apiPath = path.join(appOutDir, `${appName}.app/Contents/Resources/resources/mac/qgenie-api`)
const aiPath = path.join(appOutDir, `${appName}.app/Contents/Resources/resources/mac/qgenie-ai`)

const binaries = [apiPath, aiPath]

for (const binaryPath of binaries) {
try {
console.log(`Removing existing signature from: ${binaryPath}`)
execSync(`codesign --remove-signature "${binaryPath}"`)
} catch (error) {
console.warn(`Could not remove signature from ${binaryPath}: ${error.message}`)
}

try {
console.log(`Applying ad-hoc signature to: ${binaryPath}`)
// 애드혹 서명을 적용합니다.
execSync(`codesign --sign - "${binaryPath}"`)
console.log(`Successfully signed: ${binaryPath}`)
} catch (error) {
console.error(`Failed to sign ${binaryPath}: ${error.message}`)
throw error // 서명 실패 시 빌드를 중단
}
}

console.log('--- Finished resigning native binaries ---')
}