From 28abf87c239bc7bf06f8eff84d05c628c589f506 Mon Sep 17 00:00:00 2001 From: gnattu Date: Sat, 19 Dec 2020 02:01:31 +0000 Subject: [PATCH] fix: incorrect signing on non-binary --- patches/app-builder-lib+22.10.3.patch | 29 +++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 patches/app-builder-lib+22.10.3.patch diff --git a/patches/app-builder-lib+22.10.3.patch b/patches/app-builder-lib+22.10.3.patch new file mode 100644 index 000000000..904f3a09d --- /dev/null +++ b/patches/app-builder-lib+22.10.3.patch @@ -0,0 +1,29 @@ +diff --git a/node_modules/app-builder-lib/electron-osx-sign/util.js b/node_modules/app-builder-lib/electron-osx-sign/util.js +index 107d8aa..4a6a354 100644 +--- a/node_modules/app-builder-lib/electron-osx-sign/util.js ++++ b/node_modules/app-builder-lib/electron-osx-sign/util.js +@@ -202,12 +202,23 @@ module.exports.walkAsync = async function (dirPath) { + const stat = await fs.lstat(filePath) + if (stat.isFile()) { + switch (path.extname(filePath)) { ++ case '': // Binary ++ if (path.basename(filePath)[0] !== '.') { ++ return getFilePathIfBinaryAsync(filePath) ++ } // Else reject hidden file ++ break ++ case '.dylib': // Dynamic library ++ case '.node': // Native node addon ++ return filePath + case '.cstemp': // Temporary file generated from past codesign + debuglog('Removing... ' + filePath) + await fs.unlink(filePath) + return + default: +- return getFilePathIfBinaryAsync(filePath) ++ if (path.extname(filePath).indexOf(' ') >= 0) { ++ // Still consider the file as binary if extension seems invalid ++ return getFilePathIfBinaryAsync(filePath) ++ } + } + } else if (stat.isDirectory() && !stat.isSymbolicLink()) { + const result = await _walkAsync(filePath)