diff --git a/build/after-sign.cjs b/build/after-sign.cjs deleted file mode 100644 index 2f83afb..0000000 --- a/build/after-sign.cjs +++ /dev/null @@ -1,58 +0,0 @@ -const { execFileSync } = require('node:child_process') -const fs = require('node:fs') -const path = require('node:path') - -const BINARIES = ['yt-dlp_macos', 'ffmpeg_macos', 'deno'] - -const findAppBundle = (appOutDir) => { - const entries = fs.readdirSync(appOutDir) - const app = entries.find((entry) => entry.endsWith('.app')) - return app ? path.join(appOutDir, app) : null -} - -const resolveSigningIdentity = () => - process.env.CSC_NAME || process.env.APPLE_SIGNING_IDENTITY || '-' - -const signBinary = (targetPath, entitlementsPath) => { - const identity = resolveSigningIdentity() - const args = ['--force', '--sign', identity, '--entitlements', entitlementsPath] - - if (identity !== '-') { - args.push('--options', 'runtime', '--timestamp') - } - - args.push(targetPath) - execFileSync('codesign', args, { stdio: 'inherit' }) -} - -exports.default = async function afterSign(context) { - if (context.electronPlatformName !== 'darwin') { - return - } - - const appBundle = findAppBundle(context.appOutDir) - if (!appBundle) { - console.warn('afterSign: No .app bundle found, skipping yt-dlp signing.') - return - } - - const resourcesPath = path.join( - appBundle, - 'Contents', - 'Resources', - 'app.asar.unpacked', - 'resources' - ) - - const entitlementsPath = path.resolve(__dirname, 'entitlements.mac.plist') - - for (const binary of BINARIES) { - const targetPath = path.join(resourcesPath, binary) - if (!fs.existsSync(targetPath)) { - console.warn(`afterSign: Missing ${binary}, skipping.`) - continue - } - console.log(`afterSign: Signing ${binary} with entitlements.`) - signBinary(targetPath, entitlementsPath) - } -} diff --git a/build/entitlements.mac.plist b/build/entitlements.mac.plist index 6bc22e9..38c887b 100644 --- a/build/entitlements.mac.plist +++ b/build/entitlements.mac.plist @@ -8,7 +8,5 @@ com.apple.security.cs.allow-dyld-environment-variables - com.apple.security.cs.disable-library-validation - diff --git a/electron-builder.yml b/electron-builder.yml index ee9e655..5427e4c 100644 --- a/electron-builder.yml +++ b/electron-builder.yml @@ -2,7 +2,6 @@ appId: com.vidbee productName: VidBee directories: buildResources: build -afterSign: build/after-sign.cjs protocols: - name: VidBee schemes: