Apple's SMJobBlessUtil.py doesn't work on binaries compiled for ARM/M1

Originator:AlexanderMomchilov
Number:rdar://FB9726189 Date Originated:27 October, 2021
Status:Open Resolved:
Product:Sample Code Product Version:
Classification:Application Crash Reproducible:
 
The script relies on the formatted output of `otool -s __TEXT __info_plist the_binary`, which is different between x86 and ARM code.

I also documented this issue (and a fix) on this StackOverflow question and answer: https://stackoverflow.com/q/69746635/3141234


### Please list the steps you took to reproduce the issue:

1. Build an app that uses SMJobBless to bless and install a privileged helper tool
2. Build it on an ARM Mac, to produce a native ARM binary
3. Run `SMJobBless.py check TheApp.app`

### What did you expect to happen?

It should check whether or not the code signing settings are correct for the app & helper

### What actually happened?

This error was printed:

/Users/Alex/MyApp.app/Contents/Library/LaunchServices/ca.momchilov.MyApp.helper: tool __TEXT / __info_plist section dump malformed (2)

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!