LagrangeDev / Lagrange.Core

An Implementation of NTQQ Protocol, with Pure C#, Derived from Konata.Core
GNU General Public License v3.0
1.99k stars 241 forks source link

[Bug]: `osx_arm64` killed since ASP: Security policy would not allow process #374

Closed widcardw closed 1 month ago

widcardw commented 4 months ago

请确保您已阅读以上注意事项,并勾选下方的确认框。

Lagrange项目

Core

所使用/依赖的Lagrange项目对应的commit

Not provided

运行环境

MacOS

运行架构

arm64

连接方式

None

重现步骤

  1. 首先需要有一台 M 系列芯片的 Mac,下载 release 页面中的 Lagrange.OneBot_osx-arm64_8.0.zip
  2. 解压后放置在一个没有特殊字符且没有空格的路径下
  3. 运行 chmod +x Lagrange.OneBot
  4. 运行 ./Lagrange.OneBot

期望的结果是什么?

开始运行并生成 appsettings.json 等配置文件,并出现扫码登录的提示等等。

No exist config file, create it now...
Please Edit the appsettings.json to set configs and press any key to continue

info: Microsoft.Hosting.Lifetime[0]
      Application started. Press Ctrl+C to shut down.
info: Microsoft.Hosting.Lifetime[0]
      Hosting environment: Production

实际的结果是什么?

程序直接退出,并且在终端中只显示 killed.

./arm64/Lagrange.OneBot
[1]    57889 killed     ./arm64/Lagrange.OneBot

简单的复现代码/链接(可选)

No response

日志记录(可选)

通过 Console.app 监听日志

/kernel (/System/Library/Extensions/ApplesystemPolicy.kext/Contents/MacOS/AppleSystemPolicy)
Subsystem:-- Category: <Missing Description> Hide
Activity ID: 0 Thread ID: 0x26211f PID:0
Volatile
2024-05-15 19:22:03.777285+0800
ASP: Security policy would not allow process: 57889,/Users/name/Documents/bot/Lagrange/arm64/Lagrange.OneBot

补充说明(可选)

下载 Lagrange.OneBot_osx-x64_8.0.zip 版本可以运行,并且开始生成配置文件,开始扫码登录。虽然说能用就行,但是避免不了还有人会踩到这个坑。

arily commented 3 months ago

+1 @ macOS Sonoma 14.5 (23F79), M1 Max

ghost commented 3 months ago

这个是上游的问题 自己配置一下openssl(因为m1芯片的mac不会允许dotnet调用系统的openssl

Linwenxuan04 commented 1 month ago

自己codesign一下就可以了

widcardw commented 1 month ago
  1. 检查有没有证书,没有的话创建一个[^1][^2]
  2. 证书创建完成后,使用 codesign 命令签名[^3]

[^1]: 在 Mac 上的“钥匙串访问”中创建自签名证书 [^2]: codesign 命令 error [^3]: codesign 使用