How do I change how I sign Java application after updating to OSX 10.9.5

Just updated from OSX 10.9.4 to 10.9.5, looks like I have to change how I sign Java application after updating because Im now getting this output after signing with

export CODESIGN_ALLOCATE="/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/codesign_allocate"
/usr/bin/codesign --sign "Developer ID Application: P Taylor" --force --deep --verbose /Applications/SongKong.app

Im getting:

/Applications/SongKong.app: the main executable or Info.plist must be a regular file (no symlinks, etc.)
In subcomponent: /Applications/SongKong.app/Contents/PlugIns/jdk1.8.0_20.jdk

and verification with

/usr/bin/codesign --verify --deep  --verbose /Applications/SongKong.app

gives me

/Applications/SongKong.app: code object is not signed at all
In architecture: x86_64

What do I have to change to fix this ?

Answer

The problem is that from 19.9.5 onwards codesign doesn’t let you sign folders containing symbolic links, I think previously it ignored the problem.

In my particular case I made a copy of the libjli.dylib and replaced the symblic link with this copy. This worked and Ive not encountered any problems due to making this change.

rm /Applications/MyApp.app/Contents/PlugIns/jdk1.8.0_25.jdk/Contents/MacOS/libjli.dylib
cp /Applications/MyApp.app/Contents/PlugIns/jdk1.8.0_25.jdk/Contents/Home/jre/lib/jli/libjli.dylib /Applications/SongKong.app/Contents/PlugIns/jdk1.8.0_25.jdk/Contents/MacOS
export CODESIGN_ALLOCATE="/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/codesign_allocate"

/usr/bin/codesign --sign "Developer ID Application: My Name" --force --deep --verbose /Applications/MyApp.app
/usr/bin/codesign --verify --deep  --verbose /Applications/MyApp.app

Leave a Reply

Your email address will not be published. Required fields are marked *