aronskaya / smjobbless

A showcase for launching Privileged Helper via SMJobBless() and communicating with it using XPC.
MIT License
90 stars 5 forks source link

Code-signing Variable: EXPANDED_CODE_SIGN_IDENTITY_NAME #5

Open stephancasas opened 2 months ago

stephancasas commented 2 months ago

Thank you for this repository. It saved me a significant amount of time and prevented what I imagine would have been a pretty awful headache.

I thought I might share that you can auto-fill the code-signing identity required in SMAuthorizedClients and SMPrivilegedExecutables by using the Xcode-provided environment variable $(EXPANDED_CODE_SIGN_IDENTITY_NAME):

identifier "com.example.helperapp" and anchor apple generic and certificate leaf[subject.CN] = "$(EXPANDED_CODE_SIGN_IDENTITY_NAME)"

It saves the trouble of having to lookup the value in Keychain Access or adjust if the repo is public/shared.

Cheers, and thanks again!