Skip to content
This repository was archived by the owner on May 2, 2022. It is now read-only.

Commit 02516b0

Browse files
authored
Add support for castlabs / [email protected] (#1559)
1 parent d4613db commit 02516b0

File tree

7 files changed

+327
-300
lines changed

7 files changed

+327
-300
lines changed

main-src/libs/app-management/install-app-async/install-app-forked-electron-v2.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ const fetch = process.env.NODE_ENV === 'production' ? require('node-fetch').defa
2727

2828
const execAsync = require('../../exec-async');
2929
const checkPathInUseAsync = require('../check-path-in-use-async');
30-
const getWvvmpElectronVersion = require('../../get-wvvmp-electron-version');
30+
const getCastlabsElectronVersion = require('../../get-castlabs-electron-version');
3131

3232
// id, name, username might only contain numbers
3333
// causing yargsParser to parse them correctly as Number instead of String
@@ -297,7 +297,7 @@ Promise.resolve()
297297

298298
// support widevine cdm on mac or linux x64
299299
if (process.platform === 'darwin' || (process.platform === 'linux' && process.arch === 'x64')) {
300-
packagerOpts.electronVersion = getWvvmpElectronVersion(electronVersion);
300+
packagerOpts.electronVersion = getCastlabsElectronVersion(electronVersion);
301301
packagerOpts.download = {
302302
cacheRoot: electronCachePath,
303303
mirrorOptions: {

main-src/libs/app-management/prepare-electron-async/prepare-electron-forked.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ const path = require('path');
2727
const { downloadArtifact } = require('@electron/get/dist/cjs');
2828

2929
const formatBytes = require('../../format-bytes');
30-
const getWvvmpElectronVersion = require('../../get-wvvmp-electron-version');
30+
const getCastlabsElectronVersion = require('../../get-castlabs-electron-version');
3131

3232
const argv = yargsParser(process.argv.slice(1));
3333
const {
@@ -73,7 +73,7 @@ Promise.resolve()
7373

7474
// support widevine cdm on mac or linux x64
7575
if (process.platform === 'darwin' || (process.platform === 'linux' && process.arch === 'x64')) {
76-
downloadOpts.version = getWvvmpElectronVersion(electronVersion);
76+
downloadOpts.version = getCastlabsElectronVersion(electronVersion);
7777
downloadOpts.mirrorOptions = {
7878
mirror: 'https://github.com/castlabs/electron-releases/releases/download/',
7979
};
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
/* This Source Code Form is subject to the terms of the Mozilla Public
2+
* License, v. 2.0. If a copy of the MPL was not distributed with this
3+
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
4+
5+
// The v16 series of Electron for Content Security, labeled wvcus,
6+
// moves to using the Component Updater Service to handle installation
7+
// of the Widevine CDM, and has incompatible API updates compared to the previous wvvmp releases.
8+
const semver = require('semver');
9+
10+
const getCastlabsElectronVersion = (electronVersion) => {
11+
// '14.0.0-beta.9' to '14.0.0-beta.9+wvcus'
12+
// '14.0.0' to '14.0.0+wvcus'
13+
if (semver.gte(electronVersion, '16.0.0-beta.6')) {
14+
return `${electronVersion}+wvcus`;
15+
}
16+
17+
// '14.0.0-beta.9' to '14.0.0-wvvmp-beta.9'
18+
// '14.0.0' to '14.0.0-wvvmp'
19+
const versionParts = electronVersion.split('-');
20+
versionParts.splice(1, 0, 'wvvmp');
21+
return versionParts.join('-');
22+
};
23+
24+
module.exports = getCastlabsElectronVersion;

main-src/libs/get-wvvmp-electron-version.js

-13
This file was deleted.

package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
"@material-ui/core": "4.12.3",
3939
"@material-ui/icons": "4.11.2",
4040
"@sentry/electron": "2.5.4",
41-
"amplitude-js": "8.9.0",
41+
"amplitude-js": "8.9.1",
4242
"auto-launch": "5.0.5",
4343
"axios": "0.22.0",
4444
"babel-loader": "8.1.0",
@@ -70,7 +70,7 @@
7070
"eslint-plugin-react": "7.26.1",
7171
"eslint-plugin-react-hooks": "1.7.0",
7272
"file-saver": "2.0.5",
73-
"firebase": "9.2.0",
73+
"firebase": "9.3.0",
7474
"follow-redirects": "1.14.5",
7575
"fs-extra": "10.0.0",
7676
"gravatar": "1.8.2",
@@ -81,7 +81,7 @@
8181
"jszip": "3.7.1",
8282
"menubar": "9.1.0",
8383
"node-cache": "5.1.2",
84-
"node-fetch": "2.6.5",
84+
"node-fetch": "2.6.6",
8585
"node-machine-id": "1.1.12",
8686
"notistack": "1.0.10",
8787
"original-fs": "1.1.0",

public/open-source-notices.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -4033,7 +4033,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
40334033

40344034
-----
40354035

4036-
The following software may be included in this product: asn1. A copy of the source code may be downloaded from git://github.com/joyent/node-asn1.git. This software contains the following license and notice below:
4036+
The following software may be included in this product: asn1. A copy of the source code may be downloaded from https://github.com/joyent/node-asn1.git. This software contains the following license and notice below:
40374037

40384038
Copyright (c) 2011 Mark Cavage, All rights reserved.
40394039

0 commit comments

Comments
 (0)