How to count the number of signed files

Hi at all, is there a way to count how many files have been marked with the codesign? Thanks in advance

Answered by DTS Engineer in 821560022
We execute the codesign inside a CI pipeline.

So you want to generate this report at build time on a machine you control?

If so, you could do this by parsing the CodeResources file within the signed bundle. See TN3126 Inside Code Signing: Hashes.

WARNING Don’t do this on the user’s device. Quoting TN3126 “The structure of a code signature has changed numerous times in the past and may well change again in the future.” However, doing this on your CI machine should be fine because, if it breaks, only you are affected.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Please supply some more context here:

  • Are you talking about files within your app?

  • If so, what platform are you targeting?

  • And what are you actually planning to do with that info?

  • Specifically, are you trying to do this at build time? Or at runtime on the user’s device?

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Yes I'm referring to the files inside the .app. We need this info for statistics and create if possible also the reports. We execute the codesign inside a CI pipeline. Thanks

We execute the codesign inside a CI pipeline.

So you want to generate this report at build time on a machine you control?

If so, you could do this by parsing the CodeResources file within the signed bundle. See TN3126 Inside Code Signing: Hashes.

WARNING Don’t do this on the user’s device. Quoting TN3126 “The structure of a code signature has changed numerous times in the past and may well change again in the future.” However, doing this on your CI machine should be fine because, if it breaks, only you are affected.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

How to count the number of signed files
 
 
Q