diff --git a/build/darwin/sign.ts b/build/darwin/sign.ts index e1adf88c8bd76..dc411d5e1fe8d 100644 --- a/build/darwin/sign.ts +++ b/build/darwin/sign.ts @@ -78,6 +78,9 @@ async function main(buildDir?: string): Promise { const appRoot = path.join(buildDir, `VSCode-darwin-${arch}`); const appName = product.nameLong + '.app'; const infoPlistPath = path.resolve(appRoot, appName, 'Contents', 'Info.plist'); + const embeddedInfoPlistPath = product.embedded + ? path.resolve(appRoot, appName, 'Contents', 'Applications', `${product.embedded.nameShort}.app`, 'Contents', 'Info.plist') + : undefined; const appOpts: SignOptions = { app: path.join(appRoot, appName), @@ -124,6 +127,51 @@ async function main(buildDir?: string): Promise { 'An application in Visual Studio Code wants to use Audio Capture.', `${infoPlistPath}` ]); + await spawn('plutil', [ + '-insert', + 'NSLocalNetworkUsageDescription', + '-string', + 'The app uses your local network for DNS resolution and to connect to locally running services.', + `${infoPlistPath}` + ]); + + if (embeddedInfoPlistPath && fs.existsSync(embeddedInfoPlistPath)) { + await spawn('plutil', [ + '-insert', + 'NSAppleEventsUsageDescription', + '-string', + `An application in ${product.embedded.nameShort} wants to use AppleScript.`, + `${embeddedInfoPlistPath}` + ]); + await spawn('plutil', [ + '-replace', + 'NSMicrophoneUsageDescription', + '-string', + `An application in ${product.embedded.nameShort} wants to use the Microphone.`, + `${embeddedInfoPlistPath}` + ]); + await spawn('plutil', [ + '-replace', + 'NSCameraUsageDescription', + '-string', + `An application in ${product.embedded.nameShort} wants to use the Camera.`, + `${embeddedInfoPlistPath}` + ]); + await spawn('plutil', [ + '-replace', + 'NSAudioCaptureUsageDescription', + '-string', + `An application in ${product.embedded.nameShort} wants to use Audio Capture.`, + `${embeddedInfoPlistPath}` + ]); + await spawn('plutil', [ + '-insert', + 'NSLocalNetworkUsageDescription', + '-string', + `The app uses your local network for DNS resolution and to connect to locally running services.`, + `${embeddedInfoPlistPath}` + ]); + } } await retrySignOnKeychainError(() => sign(appOpts));