【发布时间】:2021-09-08 23:04:14
【问题描述】:
我们有一个相当大的 Java 桌面应用程序(~1.5gb),还有很多库。 到目前为止,我将它转换为适用于 macOS 的 .app 包(没有问题) 我想公证这个应用程序。 使用 --deep 运行 codesign 不起作用,我了解到我应该手动将 codesign 命令应用于单个文件,而不是 --deep。
但我的问题是,我不知道应该将哪些文件应用于 codesign,我阅读的一些博客应该应用所有内容(如 .xml、.png、.properties、.xsd ...)
我写了一个小python脚本,遍历每个文件并应用到codesign,(如果文件是.jar或.zip,它会提取它们适用于codesign所有文件,然后再次将它们打包到.jar,.zip) 但这花了很多时间,我真的很困惑,我应该为每个文件(包括像 slf4j、spring、hibernate 等的库 jars)运行 codesign 命令,还是应该为一些特定的文件类型运行,比如 .jnilib,. dylib 和可执行二进制文件?
编辑:好的,我尝试了 --deep 并发送公证,然后公证过程当然会向我发回错误列表。我手动将代码设计应用于这些可执行文件
例如错误是这样的:
"issues": [
{
"severity": "error",
"code": null,
"path": "myApp.zip/myApp.app/Contents/Java/org/xerial/sqlite-jdbc/3.30.1/sqlite-jdbc-3.30.1.jar/org/sqlite/native/Mac/x86_64/libsqlitejdbc.jnilib",
"message": "The binary is not signed.",
"docUrl": null,
"architecture": "x86_64"
},
{
"severity": "error",
"code": null,
"path": "myApp.zip/myApp.app/Contents/Java/org/xerial/sqlite-jdbc/3.30.1/sqlite-jdbc-3.30.1.jar/org/sqlite/native/Mac/x86_64/libsqlitejdbc.jnilib",
"message": "The signature does not include a secure timestamp.",
"docUrl": null,
"architecture": "x86_64"
},
{
"severity": "error",
"code": null,
"path": "myApp.zip/myApp.app/Contents/Java/lib/libPDFParser.dylib",
"message": "The binary is not signed.",
"docUrl": null,
"architecture": "x86_64"
},
{
"severity": "error",
"code": null,
"path": "myApp.zip/myApp.app/Contents/Java/lib/libPDFParser.dylib",
"message": "The signature does not include a secure timestamp.",
"docUrl": null,
"architecture": "x86_64"
},
{
"severity": "error",
"code": null,
"path": "myApp.zip/myApp.app/Contents/Java/lib/libPdfViewerAPI.dylib",
"message": "The binary is not signed.",
"docUrl": null,
"architecture": "x86_64"
},
{
"severity": "error",
"code": null,
"path": "myApp.zip/myApp.app/Contents/Java/lib/libPdfViewerAPI.dylib",
"message": "The signature does not include a secure timestamp.",
"docUrl": null,
"architecture": "x86_64"
},
...
...
然后对于每个错误,运行代码设计(再次使用 -f 和 --deep 标志),但是当我尝试使用验证时
codesign --verify --verbose=4 "myApp.app"
得到这两个错误:
judocu.app: a sealed resource is missing or invalid
file modified: /myApp.app/Contents/Java/lib/libPDFParser.dylib
file modified: /myApp.app/Contents/Java/lib/libPdfViewerAPI.dylib
我再次尝试使用 codesign 对这两个 dylib 进行签名,但在替换签名后,再次出现相同的错误
codesign -f -s "Developer ID Application: myDevIdAcc (MF9Q4L4SBE)" --entitlements entitlements.plist myApp.app/Contents/Java/lib/libPdfViewerAPI.dylib
有人知道可能是什么问题吗?
【问题讨论】:
-
您的应用中如何拥有 1.5 个演出?
-
图片等资源,大量的库。