Notarized app successfully but got error when start app

Hi, I just have my app notarized by Apple notarize services. The result is no errors.

Have the Request UUID: e2e784a9-8c47-41e6-9f28-355f8b107e60

But when I create a .dmg file from that .app file, extracted to Applications then run, got errors: (screenshots)


(node:13033) UnhandledPromiseRejectionWarning: Error: dlopen(/var/folders/x4/r6d1_9810tb47p_zkypn6fqr0000gn/T/.com.electron.
bbrowser2.nYmi7D, 1): no suitable image found. Did find: /var/folders/x4/r6d1_9810tb47p_zkypn6fqr0000gn/T/.com.electron.bbrowse
r2.nYmi7D: code signature in (/var/folders/x4/r6d1_9810tb47p_zkypn6fqr0000gn/T/.com.electron.bbrowser2.nYmi7D) 
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/x4/r6d1_9810tb47p_zkypn6fqr0000gn/T/.com.electron.bbrowser2.nYmi7D: stat() failed with errno=17 
at process.module.(anonymous function) [as dlopen] (ELECTRON_ASAR.js:160:31) 
at Object.Module._extensions..node (internal/modules/cjs/loader.js:722:18) 
at Object.module.(anonymous function) [as .node] (ELECTRON_ASAR.js:169:18)
 at Module.load (internal/modules/cjs/loader.js:602:32)
 at tryModuleLoad (internal/modules/cjs/loader.js:541:12) 
at Function.Module._load (internal/modules/cjs/loader.js:533:3) 
at Module.require (internal/modules/cjs/loader.js:640:17) 
at require (internal/modules/cjs/helpers.js:20:18) 
at Object.<anonymous> (/Users/bioturing/.BioTBData/App/app.asar/assets/js/app/plugin/utils.js:1:396) 
at Object.<anonymous> (/Users/bioturing/.BioTBData/App/app.asar/assets/js/app/plugin/utils.js:2:3) 
at Module._compile (internal/modules/cjs/loader.js:693:30) 
at Object.Module._extensions..js (internal/modules/cjs/loader.js:704:10) 
at Module.load (internal/modules/cjs/loader.js:602:32) 
at tryModuleLoad (internal/modules/cjs/loader.js:541:12) 
at Function.Module._load (internal/modules/cjs/loader.js:533:3) 
at Module.require (internal/modules/cjs/loader.js:640:17) 
at require (internal/modules/cjs/helpers.js:20:18) 
at Object.<anonymous> (/Users/bioturing/.BioTBData/App/app.asar/assets/js/app/plugin/common.js:1:189) 
at Object.<anonymous> (/Users/bioturing/.BioTBData/App/app.asar/assets/js/app/plugin/common.js:2:3) 
at Module._compile (internal/modules/cjs/loader.js:693:30) 
at Object.Module._extensions..js (internal/modules/cjs/loader.js:704:10) 
at Module.load (internal/modules/cjs/loader.js:602:32)
 at tryModuleLoad (internal/modules/cjs/loader.js:541:12) 
at Function.Module._load (internal/modules/cjs/loader.js:533:3)
 at Module.require (internal/modules/cjs/loader.js:640:17)
 at require (internal/modules/cjs/helpers.js:20:18) 

.......

Althought I have carefully checked the codesign result, everything seems ok.


codesign -d -vvv "/Applications/BBrowser2.app"
Executable=/Applications/BBrowser2.app/Contents/MacOS/BBrowser2
Identifier=com.electron.bbrowser2
Format=app bundle with Mach-O thin (x86_64)
CodeDirectory v=20500 size=386 flags=0x10000(runtime) hashes=3+5 location=embedded
Hash type=sha256 size=32
CandidateCDHash sha1=6caf8b813f830ee88d632842a78077703c2586db
CandidateCDHashFull sha1=6caf8b813f830ee88d632842a78077703c2586db
CandidateCDHash sha256=bfb9343d016d0ff540852852d5488b12db2bc82d
CandidateCDHashFull sha256=bfb9343d016d0ff540852852d5488b12db2bc82d638133ea64314aa925bc36a3
Hash choices=sha1,sha256
CMSDigest=3b21b6d50037fe5327fa9666afb863d5a4c05c6d716b3f608f04c56a096a0d28
CMSDigestType=2
CDHash=bfb9343d016d0ff540852852d5488b12db2bc82d
Signature size=9048
Authority=Developer ID Application: Son Pham (SJGU8F2P3M)
Authority=Developer ID Certification Authority
Authority=Apple Root CA
Timestamp=Nov 14, 2019 at 11:12:00 AM
Info.plist entries=22
TeamIdentifier=SJGU8F2P3M
Runtime Version=10.12.0
Sealed Resources version=2 rules=13 files=9784
Internal requirements count=1 size=184
BioTurings-Mac-mini:app bioturing$ /Applications/BBrowser2.app/Contents/MacOS/BBrowser2



Any help is welcome, thanks in advance.

Replies

Electron apps do funky things. I suggest you contact Electron support.

What john daniel said and…

In this specific case the app has created an unsigned library in the temporary directory and is trying to run that. That sort of thing is not allowed by the hardened runtime.

A while back I helped a developer of an Electron-based app investigate this issue and they discovered that a small change to how they package their app prevented Electron from going down this path. However, I’m not sufficiently experienced with Electron to advise you on how to do that. You’ll have to escalate this via their support channels.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"
(s. 722490250)