Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deep signing equivalent? #240

Closed
axfelix opened this issue Nov 21, 2020 · 5 comments · Fixed by #316
Closed

Deep signing equivalent? #240

axfelix opened this issue Nov 21, 2020 · 5 comments · Fixed by #316

Comments

@axfelix
Copy link

axfelix commented Nov 21, 2020

Hi,

Is there a way to run electron-osx-sign with the equivalent of the --deep flag from Apple's own codesign tool, so that it will recursively walk directories and sign included binaries? I have some Pyinstaller-bundled dependencies of my Electron app that work fine on Windows and Linux and under earlier versions of macOS, but I'm having trouble working out a way of signing them with the available Electron tooling without having to package an app bundle within an app bundle, which won't pass notarization, or expand a list of every .dylib and .so in the bundle...

Thanks!

@axfelix
Copy link
Author

axfelix commented Nov 23, 2020

Would it make sense to simply run it this way, to get every included binary?

electron-osx-sign ProveIt-darwin-x64/ProveIt.app/ $(find ProveIt-darwin-x64/ProveIt.app/Contents/ -type f -perm -u+x)

@axfelix
Copy link
Author

axfelix commented Nov 25, 2020

Note that this doesn't seem to work because escaping spaces or quoting filenames when doing shell expansion this way isn't picked up by electron-osx-sign -- it seems to have some problem parsing paths.

@dvigne
Copy link

dvigne commented Nov 12, 2021

I noticed there was an open PR #231 that hasn't been merged yet, but this was somewhat impacting to my build pipeline...especially since the newest version of Mac requires a hardened runtime now. I got around this by creating a hook that deep signs the finished .app after it's been packaged. You'd just need to change the app name in the path.resolve() function.

const { exec } = require('child_process');

const config = {
   hooks: {
    postPackage: (forgeConfig, options) => {
      if (process.platform == "darwin") {
        let appPath = path.resolve(options.outputPaths[0], 'CHANGEME.app');
        console.log(`Signing App: ${appPath}`);
        exec(`codesign --force --deep --sign - ${appPath}`,
        (err, stdout, stderr) => {
          if (err) {
            console.log(`ERROR: ${err}`);
          }
          if (stdout) {
            console.log(stdout);
          }
          if (stderr) {
            console.log(stderr);
          }
        });
      }
    }
  },
}

@PBK-B
Copy link

PBK-B commented Jan 19, 2024

Hello, is there any progress on this issue? I can't move forward when I encounter this problem at present.

cc @MarshallOfSound

Copy link

🎉 This issue has been resolved in version 1.3.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants
@axfelix @erickzhao @dvigne @PBK-B and others