我有一个签名和公证的应用程序,我想使用robotjs来模拟按键点击。我在本地构建robotjs没有问题,但当我通过CI运行它时,在那里我对应用程序进行签名和公证,应用程序在启动时抛出以下错误:
electron/js2c/asar.js:140 Uncaught Error: dlopen(/var/folders/jh/c4kr0qwj0jz2g6qr9y62v3f80000gn/T/.com.electron.w3champions-launcher.JGzZcr, 1): no suitable image found. Did find:
/var/folders/jh/c4kr0qwj0jz2g6qr9y62v3f80000gn/T/.com.electron.w3champions-launcher.JGzZcr: code signature in (/var/folders/jh/c4kr0qwj0jz2g6qr9y62v3f80000gn/T/.com.electron.w3champions-launcher.JGzZcr) not valid for use in process using Library Validation: mapped file has no cdhash, completely unsigned? Code has to be at least ad-hoc signed.
/var/folders/jh/c4kr0qwj0jz2g6qr9y62v3f80000gn/T/.com.electron.w3champions-launcher.JGzZcr: stat() failed with errno=17
at process.func [as dlopen] (electron/js2c/asar.js:140)
at Object.Module._extensions..node (internal/modules/cjs/loader.js:1034)
at Object.func [as .node] (electron/js2c/asar.js:149)
at Module.load (internal/modules/cjs/loader.js:815)
at Module._load (internal/modules/cjs/loader.js:727)
at Function.Module._load (electron/js2c/asar.js:769)
at Module.require (internal/modules/cjs/loader.js:852)
at require (internal/modules/cjs/helpers.js:74)
at Object.<anonymous> (/Applications/w3champions-launcher.app/Contents/Resources/app.asar/node_modules/robotjs/index.js:1)
at Object.<anonymous> (/Applications/w3champions-launcher.app/Contents/Resources/app.asar/node_modules/robotjs/index.js:38)我有一种感觉,我没有签署构建的robotjs的东西,因此当加载它时,OSX会不高兴。如果我删除公证步骤,我会得到相同的错误。这些是我的构建命令:
"build": "npm run rebuild && vue-cli-service electron:build",
"rebuild": "npm rebuild --runtime=electron --target=9.1.2 --disturl=https://atom.io/download/atom-shell --abi=80",我在这里发现了一些东西:https://github.com/electron-userland/electron-builder/issues/4040#issuecomment-543252275,但我缺乏电子知识来实现这一点。他还使用了react和2 package.json解决方案,这是我没有的。我必须为robotjs添加一个签名步骤吗?如果是,我该怎么做?在Windows上,一切运行正常,签名和构建都没有问题。
发布于 2020-08-08 04:05:26
好吧,不知何故,我偶然发现了一篇类似的文章,并修复了它。在我的谷歌冒险之旅中,我改变了以下几件事,也许其中之一可能会对某些人有所帮助:
在vue.config.js中,我添加了builderOptions.mac.entitlementsInherit = "build/entitlements.mac.inherit.plist"。之前我只有builderOptions.mac.entitlements
我将这两个实体添加到我的实体列表中:
<key>com.apple.security.cs.disable-library-validation</key>
<true/>
<key>com.apple.security.cs.disable-executable-page-protection</key>
<true/>在package.json中,我将构建更改为
"build": "npm run rebuild && vue-cli-service electron:build",
"rebuild": "npm rebuild --runtime=electron --target=9.1.2 -- disturl=https://atom.io/download/atom-shell --abi=80"这一变化只是为了让abi成为正确的那款。您可以通过electron --abi获取所需的abi
https://stackoverflow.com/questions/63307240
复制相似问题