Hello!
We have code that extracts macOS Installer package (.pkg, .mpkg) signature information using APIs defined in <xar/xar.h>
The code opens the package using ‘xar_open’ API like this.
func open(file: String) throws(XarError) {
xarfile = xar_open(file, READ)
if xarfile == nil {
throw .fileOpenError
}
}
This code produces a clang warning in our CI build system when built for macOS 12 and up.
'xar_open' was deprecated in macOS 12.0: xar is a deprecated file format and should not be used.
Question #1:
- What is the appropriate / more preferred way to extract signature information from an Installer package given that xar related APIs are deprecated?
We use xar APIs to validate the package signature prior to installation to prevent packagers not signed by our team ID from being installed.
Question #2:
- “xar is a deprecated file format and should not be used.”. Does this phrase refer to the file format that should be avoided or the API that extract signature information?
We distribute our product using Developer ID method that using pkg/mpkg formats which I believe internally follow the same structure as xar files. I hope this message does not mean we should rethink the distribution method for our products.
Thank you.
Filed FB FB17148233 as well.