我有一个 Quasar / Electron Mac 应用程序,它允许用户单击一个片段并将其粘贴到上次查看的应用程序(例如邮件等)中。
当我在没有签名和沙盒的情况下为 mas(Mac App Store)平台构建应用程序时,在quasar.conf.js中使用以下设置
electron: {
packager: {
asar: false,
appBundleId: '[app id]',
platform: 'mas',
version: '1.0.0',
buildVersion: '4'
}
}
...以及以下构建命令:
quasar build -m electron
然后,当我双击它时,生成的应用程序文件运行良好。
但是,如果我在quasar.conf.js中使用以下设置对应用程序进行签名和沙箱化:
electron: {
packager: {
asar: false,
appBundleId: '[app id]',
osxSign: {
'entitlements': 'src-electron/default.entitlements.mas.plist'
},
platform: 'mas',
version: '1.0.0',
buildVersion: '4'
}
}
...使用此default.entitlements.mas.plist文件:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.security.app-sandbox</key>
<true/>
<key>com.apple.security.network.client</key>
<true/>
</dict>
</plist>
...以及相同的构建命令:
quasar build -m electron
然后,当我双击生成的应用程序文件时,它会立即退出并显示以下消息:
编辑:单击报告显示以下消息:
PROCESS: Email Snippets [90262]
Path: /Applications/MAMP/*/Email Snippets.app/Contents/MacOS/Email Snippets
Identifier: com.dannyconnell.emailsnippets
Version: ???
Code Type: X86-64 (Native)
Parent Process: ??? [1]
Responsible: Email Snippets [90262]
User ID: 501
Date/Time: 2018-11-03 21:14:01.171 +0000
OS Version: Mac OS X 10.13.6 (17G65)
Report Version: 12
Anonymous UUID: E00B5535-E6DC-B81E-1DCC-43B629EDC468
Sleep/Wake UUID: B3B79D2B-F30B-47B0-A980-0822EFC30745
Time Awake Since Boot: 90000 seconds
Time Since Wake: 480 seconds
System Integrity Protection: enabled
Crashed Thread: 0
Exception Type: EXC_CRASH (Code Signature Invalid)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note: EXC_CORPSE_NOTIFY
Termination Reason: Namespace CODESIGNING, Code 0x1
kernel messages:
VM Regions Near 0 (cr2):
-->
__TEXT 0000000103992000-0000000103993000 [ 4K] r-x/rwx SM=COW
Thread 0 Crashed:
0 ??? 0x000000011127d19c _dyld_start + 0
Thread 0 crashed with X86 Thread State (64-bit):
rax: 0x0000000000000000 rbx: 0x0000000000000000 rcx: 0x0000000000000000 rdx: 0x0000000000000000
rdi: 0x0000000000000000 rsi: 0x0000000000000000 rbp: 0x0000000000000000 rsp: 0x00007ffeec26db20
r8: 0x0000000000000000 r9: 0x0000000000000000 r10: 0x0000000000000000 r11: 0x0000000000000000
r12: 0x0000000000000000 r13: 0x0000000000000000 r14: 0x0000000000000000 r15: 0x0000000000000000
rip: 0x000000011127d19c rfl: 0x0000000000000200 cr2: 0x0000000000000000
Logical CPU: 0
Error Code: 0x00000000
Trap Number: 0
Binary Images:
0x103992000 - 0x103992ff7 +??? (0) <447A1052-3F46-3E1B-BAC8-64F49EDE036E> (null)
0x11127c000 - 0x1112c6acf +??? (551.4) <8A72DE9C-A136-3506-AA02-4BA2B82DCAF3> (null)
External Modification Summary:
Calls made by other processes targeting this process:
task_for_pid: 0
thread_create: 0
thread_set_state: 0
Calls made by this process:
task_for_pid: 0
thread_create: 0
thread_set_state: 0
Calls made by all processes on this machine:
task_for_pid: 58409
thread_create: 0
thread_set_state: 54
VM Region Summary:
ReadOnly portion of Libraries: Total=432K resident=0K(0%) swapped_out_or_unallocated=432K(100%)
Writable regions: Total=8404K written=0K(0%) resident=0K(0%) swapped_out=0K(0%) unallocated=8404K(100%)
VIRTUAL REGION
REGION TYPE SIZE COUNT (non-coalesced)
=========== ======= =======
STACK GUARD 56.0M 2
Stack 8192K 2
__DATA 228K 4
__LINKEDIT 128K 3
__TEXT 304K 3
shared memory 8K 3
=========== ======= =======
TOTAL 64.7M 11
Model: MacBookPro12,1, BootROM MBP121.0177.B00, 2 processors, Intel Core i5, 2.7 GHz, 8 GB, SMC 2.28f7
Graphics: Intel Iris Graphics 6100, Intel Iris Graphics 6100, Built-In
Memory Module: BANK 0/DIMM0, 4 GB, DDR3, 1867 MHz, 0x80AD, 0x483943434E4E4E424C54414C41522D4E5544
Memory Module: BANK 1/DIMM0, 4 GB, DDR3, 1867 MHz, 0x80AD, 0x483943434E4E4E424C54414C41522D4E5544
AirPort: spairport_wireless_card_type_airport_extreme (0x14E4, 0x133), Broadcom BCM43xx 1.0 (7.77.37.31.1a9)
Bluetooth: Version 6.0.7f10, 3 services, 27 devices, 1 incoming serial ports
Network Service: Wi-Fi, AirPort, en0
Serial ATA Device: APPLE SSD SM0256G, 251 GB
USB Device: USB 3.0 Bus
USB Device: Internal Memory Card Reader
USB Device: Bluetooth USB Host Controller
Thunderbolt Bus: MacBook Pro, Apple Inc., 27.1
如果我然后使用electron-osx-flat打包应用程序:
electron-osx-flat "dist/electron-mat/[app name]-mas-x64/[app name].app" --verbose
..并双击pkg文件进行安装,然后应用程序安装成功。但是当我在应用程序中单击该应用程序时,它会再次立即退出并显示上图中的消息。
编辑:另外,如果我在终端的 .app 文件中运行可执行文件,我只会收到以下消息:
Killed: 9
但是,当我提交此生成的 pkg 文件以供审核时,该应用程序基本上适用于审核者,但复制和粘贴功能不起作用。
我相信这与default.entitlements.mas.plist文件中缺少的权利有关。
但是,在提交到应用商店之前,我希望能够自己测试这些问题。
签名和沙盒化后,如何运行和测试我的应用程序?