erikberglund / SwiftPrivilegedHelper

Example application using a privileged helper tool with authentication in an unsandboxed application written in Swift
MIT License
180 stars 33 forks source link

Code Sign Update Script broken on Xcode 11 #19

Open OskarGroth opened 4 years ago

OskarGroth commented 4 years ago

Mac Developer certificates are now on the form Apple Development: instead of Mac Developer:, causing the code sign update script to fail.

It can be fixed by updating the macDeveloper function as follows:

if ! [[ ${macDeveloperCN} =~ ^Apple\ Development:\ .*\ \([A-Z0-9]{10}\)$ ]]; then
    printf "%s\n" "Invalid Mac Developer CN: ${macDeveloperCN}"
    exit 1
fi
NghiaTranUIT commented 4 years ago

Thank for the fix 🌮. I was stuck on it for a day 😱

jaroslavas commented 4 years ago

Or you can use this if statement if you need it to work on both of and new names:

if ! [[ ${macDeveloperCN} =~ ^Mac\ Developer:\ .*\ \([A-Z0-9]{10}\)$ ]] && ! [[ ${macDeveloperCN} =~ ^Apple\ Development:\ .*\ \([A-Z0-9]{10}\)$ ]]; then