From 32a59f797b5a3ea3231f62740b98ddc252c733bc Mon Sep 17 00:00:00 2001 From: develar Date: Sun, 18 Sep 2016 18:21:15 +0200 Subject: [PATCH] fix(mac): forbid "Mac Developer" cert #757 --- .travis.yml | 2 +- CHANGELOG.md | 3 +++ src/codeSign.ts | 2 +- src/macPackager.ts | 4 +++- src/publish/gitHubPublisher.ts | 2 +- src/windowsCodeSign.ts | 3 +++ test/fixtures/app-executable-deps/package.json | 2 +- test/fixtures/test-app-one/package.json | 2 +- test/fixtures/test-app/package.json | 2 +- test/src/helpers/config.ts | 2 +- 10 files changed, 16 insertions(+), 8 deletions(-) diff --git a/.travis.yml b/.travis.yml index 668ebaabca1..0c0c4639d9a 100755 --- a/.travis.yml +++ b/.travis.yml @@ -1,4 +1,4 @@ -osx_image: xcode7.3 +osx_image: xcode8 matrix: include: diff --git a/CHANGELOG.md b/CHANGELOG.md index 017ea0d4b5f..437c76ecc59 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +**Here changelog only for previous major releases.** +To see changes for current major release, please use [GiHub releases](/~https://github.com/electron-userland/electron-builder/releases). + ## [6.7.7](/~https://github.com/electron-userland/electron-builder/compare/v6.7.6...v6.7.7) (2016-09-16) diff --git a/src/codeSign.ts b/src/codeSign.ts index c804ce3aa7a..a7834c3fa1b 100644 --- a/src/codeSign.ts +++ b/src/codeSign.ts @@ -130,7 +130,7 @@ async function getValidIdentities(keychain?: string | null): Promise { const array = it[0].concat(it[1]) - .filter(it => !it.includes("(Missing required extension)") && !it.includes("valid identities found") && !it.includes("iPhone ") && !it.includes("com.apple.idms.appleid.prd.")) + .filter(it => !it.includes("(Missing required extension)") && !it.includes("valid identities found") && !it.includes("iPhone ") && !it.includes("com.apple.idms.appleid.prd.") && !it.includes("Mac Developer:")) // remove 1) .map(it => it.substring(it.indexOf(")") + 1).trim()) return Array.from(new Set(array)) diff --git a/src/macPackager.ts b/src/macPackager.ts index fa3a020557b..8f8557569d7 100644 --- a/src/macPackager.ts +++ b/src/macPackager.ts @@ -105,12 +105,14 @@ export default class MacPackager extends PlatformPackager { let name = await findIdentity(masOptions == null ? "Developer ID Application" : "3rd Party Mac Developer Application", masOptions == null ? this.platformSpecificBuildOptions.identity : masQualifier, keychainName) if (name == null) { - const message = "App is not signed: CSC_LINK is not specified, and no valid identity in the keychain, see /~https://github.com/electron-userland/electron-builder/wiki/Code-Signing" + let message = "App is not signed: CSC_LINK is not specified, and no valid identity in the keychain, see /~https://github.com/electron-userland/electron-builder/wiki/Code-Signing" if (masOptions == null) { + message += `\nMust be "Developer ID Application:" or custom non-Apple code signing certificate` warn(message) return } else { + message += `\nMust be "3rd Party Mac Developer Application:" and "3rd Party Mac Developer Installer:"` throw new Error(message) } } diff --git a/src/publish/gitHubPublisher.ts b/src/publish/gitHubPublisher.ts index cd83a23bab8..1d506b9ab89 100644 --- a/src/publish/gitHubPublisher.ts +++ b/src/publish/gitHubPublisher.ts @@ -51,7 +51,7 @@ export class GitHubPublisher implements Publisher { throw new Error(`Version must not starts with "v": ${version}`) } - this.tag = config != null && config.vPrefixedTagName ? `v${version}` : version + this.tag = config == null || config.vPrefixedTagName ? `v${version}` : version this._releasePromise = this.token === "__test__" ? BluebirdPromise.resolve(null) : >this.init() } diff --git a/src/windowsCodeSign.ts b/src/windowsCodeSign.ts index d78e304c9bb..90310ee6287 100644 --- a/src/windowsCodeSign.ts +++ b/src/windowsCodeSign.ts @@ -80,6 +80,9 @@ async function spawnSign(options: SignOptions, inputPath: string, outputPath: st if (certExtension === ".p12" || certExtension === ".pfx") { args.push(isWin ? "/f" : "-pkcs12", certificateFile) } + else { + throw new Error(`Please specify pkcs12 (.p12/.pfx) file, ${certificateFile} is not correct`) + } } if (!isWin || hash !== "sha1") { diff --git a/test/fixtures/app-executable-deps/package.json b/test/fixtures/app-executable-deps/package.json index bbe4cf6bbc7..bbf0e40862a 100644 --- a/test/fixtures/app-executable-deps/package.json +++ b/test/fixtures/app-executable-deps/package.json @@ -1,6 +1,6 @@ { "build": { - "electronVersion": "1.3.5", + "electronVersion": "1.4.0", "category": "public.app-category.business" } } diff --git a/test/fixtures/test-app-one/package.json b/test/fixtures/test-app-one/package.json index a836f156630..d0612291ce4 100755 --- a/test/fixtures/test-app-one/package.json +++ b/test/fixtures/test-app-one/package.json @@ -8,7 +8,7 @@ "author": "Foo Bar ", "license": "MIT", "build": { - "electronVersion": "1.3.5", + "electronVersion": "1.4.0", "appId": "org.electron-builder.testApp", "iconUrl": "https://raw.githubusercontent.com/szwacz/electron-boilerplate/master/resources/windows/icon.ico", "compression": "store", diff --git a/test/fixtures/test-app/package.json b/test/fixtures/test-app/package.json index b7a76110455..38bd8dd9c8b 100755 --- a/test/fixtures/test-app/package.json +++ b/test/fixtures/test-app/package.json @@ -1,7 +1,7 @@ { "private": true, "build": { - "electronVersion": "1.3.5", + "electronVersion": "1.4.0", "appId": "org.electron-builder.testApp", "category": "your.app.category.type", "iconUrl": "https://raw.githubusercontent.com/szwacz/electron-boilerplate/master/resources/windows/icon.ico", diff --git a/test/src/helpers/config.ts b/test/src/helpers/config.ts index 7cb44c3af1a..da526422e2b 100644 --- a/test/src/helpers/config.ts +++ b/test/src/helpers/config.ts @@ -2,4 +2,4 @@ import * as path from "path" import { tmpdir } from "os" export const TEST_DIR = path.join(tmpdir(), `electron-builder-test-${process.pid.toString(16)}`) -export const ELECTRON_VERSION = "1.3.5" \ No newline at end of file +export const ELECTRON_VERSION = "1.4.0" \ No newline at end of file