Skip to content

Commit

Permalink
fix(mac): forbid "Mac Developer" cert
Browse files Browse the repository at this point in the history
  • Loading branch information
develar committed Sep 18, 2016
1 parent ec8e69e commit 32a59f7
Show file tree
Hide file tree
Showing 10 changed files with 16 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
osx_image: xcode7.3
osx_image: xcode8

matrix:
include:
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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).

<a name="6.7.7"></a>
## [6.7.7](/~https://github.com/electron-userland/electron-builder/compare/v6.7.6...v6.7.7) (2016-09-16)

Expand Down
2 changes: 1 addition & 1 deletion src/codeSign.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ async function getValidIdentities(keychain?: string | null): Promise<Array<strin
])
.then(it => {
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))
Expand Down
4 changes: 3 additions & 1 deletion src/macPackager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,12 +105,14 @@ export default class MacPackager extends PlatformPackager<MacOptions> {

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)
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/publish/gitHubPublisher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(<any>null) : <BluebirdPromise<Release>>this.init()
}

Expand Down
3 changes: 3 additions & 0 deletions src/windowsCodeSign.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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") {
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/app-executable-deps/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"build": {
"electronVersion": "1.3.5",
"electronVersion": "1.4.0",
"category": "public.app-category.business"
}
}
2 changes: 1 addition & 1 deletion test/fixtures/test-app-one/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"author": "Foo Bar <foo@example.com>",
"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",
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/test-app/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
2 changes: 1 addition & 1 deletion test/src/helpers/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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"
export const ELECTRON_VERSION = "1.4.0"

0 comments on commit 32a59f7

Please sign in to comment.