如何验证 DMG 文件?

huangapple go评论61阅读模式
英文:

How can I validate a DMG file?

问题

我有一个通过jpackage生成DMG文件的应用程序。
一旦用户下载DMG文件,他们告诉我它是损坏的,应该删除。

现在,我对这种格式不熟悉,也没有任何苹果Mac可以尝试。以防jpackage确实正在构建无效的软件包,我想在提供此下载之前进行检查。

在Github的MacOS运行程序上有没有验证DMG的方法?

英文:

I have an application that builds into a DMG file (via jpackage).
As soon as users download the DMG they tell me it is corrupt and should be deleted.

Now I am unfamiliar with that format and I have no access to any Apple Mac to try myself. Just in case jpackage is really building an invalid package I would like to check that before offering such a download.

Is there any way to validate a DMG on Github's MacOS runner?

答案1

得分: 0

我找到了这个网页https://macwrench.miraheze.org/wiki/Hdiutil,提到了hdiutil支持一些对于验证DMG文件很有用的命令:

hdiutil verify -verbose
hdiutil imageinfo -verbose
hdiutil hfsanalyze -verbose
hdiutil checksum -type SHA256 -verbose
hdiutil info -verbose
hdiutil pmap -verbose

第一个命令已经给了我以下输出:

hdiutil: verify: checksum of "" is VALID
verified CRC32 $9D7EB279

因此,我可以信任我生成的文件,应该寻找下载或用户方面的问题。

英文:

I found this web page https://macwrench.miraheze.org/wiki/Hdiutil which mentions that hdiutil supports a number of commands that are useful for validating a DMG file:

hdiutil verify -verbose <dmg>
hdiutil imageinfo -verbose <dmg>
hdiutil hfsanalyze -verbose <dmg>
hdiutil checksum -type SHA256 -verbose <dmg>
hdiutil info -verbose
hdiutil pmap -verbose <dmg>

The first one already gave me output that ended like this:

hdiutil: verify: checksum of "<dmg>" is VALID
verified   CRC32 $9D7EB279

So with this I can trust my generated file and should look for issues on the download or user side.

huangapple
  • 本文由 发表于 2023年6月26日 02:29:56
  • 转载请务必保留本文链接:https://go.coder-hub.com/76551878.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定