1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-10-04 05:08:06 +02:00

hardened runtime for mas builds

This commit is contained in:
Kyle Spearrin 2019-10-08 13:58:05 -04:00
parent 17ce891aab
commit 3ce77adcb4

View File

@ -185,28 +185,21 @@ function distSafariApp(cb, subBuildPath) {
const builtAppexPath = buildPath + 'build/Release/safari.appex'; const builtAppexPath = buildPath + 'build/Release/safari.appex';
const builtAppexFrameworkPath = buildPath + 'build/Release/safari.appex/Contents/Frameworks/'; const builtAppexFrameworkPath = buildPath + 'build/Release/safari.appex/Contents/Frameworks/';
const entitlementsPath = paths.safari + 'safari/safari.entitlements'; const entitlementsPath = paths.safari + 'safari/safari.entitlements';
var args = [ let devId = 'Developer ID Application: 8bit Solutions LLC';
if (subBuildPath !== 'dmg') {
devId = subBuildPath === 'mas' ? '3rd Party Mac Developer Application: 8bit Solutions LLC' :
'C12A12E8595453C8B57028790FADB6AD426165AE';
}
var signArgs = [
'--verbose', '--verbose',
'--force', '--force',
'-o', '-o',
'runtime', 'runtime',
'--sign', '--sign',
'Developer ID Application: 8bit Solutions LLC', devId,
'--entitlements', '--entitlements',
entitlementsPath entitlementsPath
]; ];
if (subBuildPath !== 'dmg') {
args = [
'--verbose',
'--force',
'--sign',
subBuildPath === 'mas' ? '3rd Party Mac Developer Application: 8bit Solutions LLC' :
'C12A12E8595453C8B57028790FADB6AD426165AE',
'--entitlements',
entitlementsPath
];
}
return del([buildPath + '**/*']) return del([buildPath + '**/*'])
.then(() => safariCopyAssets(paths.safari + '**/*', buildPath)) .then(() => safariCopyAssets(paths.safari + '**/*', buildPath))
.then(() => safariCopyBuild(paths.build + '**/*', buildPath + 'safari/app')) .then(() => safariCopyBuild(paths.build + '**/*', buildPath + 'safari/app'))
@ -224,13 +217,13 @@ function distSafariApp(cb, subBuildPath) {
.map((p) => builtAppexFrameworkPath + p); .map((p) => builtAppexFrameworkPath + p);
const libPromises = []; const libPromises = [];
libs.forEach((i) => { libs.forEach((i) => {
const proc = child.spawn('codesign', args.concat([i])); const proc = child.spawn('codesign', signArgs.concat([i]));
stdOutProc(proc); stdOutProc(proc);
libPromises.push(new Promise((resolve) => proc.on('close', resolve))); libPromises.push(new Promise((resolve) => proc.on('close', resolve)));
}); });
return Promise.all(libPromises); return Promise.all(libPromises);
}).then(() => { }).then(() => {
const proc = child.spawn('codesign', args.concat([builtAppexPath])); const proc = child.spawn('codesign', signArgs.concat([builtAppexPath]));
stdOutProc(proc); stdOutProc(proc);
return new Promise((resolve) => proc.on('close', resolve)); return new Promise((resolve) => proc.on('close', resolve));
}).then(() => { }).then(() => {