How to preserve alias property while signing app?

code-signing, codesign, java, osx-mavericks, xcode

Solution

My problem get resolved by updating Java from jdk7u21 to latest jdk7u45 because Oracle's Java version 7u25 and below have been disabled by Apple on OS X. Updating to the latest release will allow Java to be run on Mac OS X.

Additionally, I have to made these changes to make app valid to sign -

- In MyApp.app/Contents/Info.plist for CFBundleExecutable to MyApp, CFBundleIconFile to MyApp.icns.

- Need to copy /Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/MacOS/libjli.dylib to MyApp.app/Contents/PlugIns/jdk1.7.0_45.jdk/Contents/MacOS for libjli.dylib alias.

- We also need to copy /Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Info.plist from system installed jdk to our MyApp.app/Contents/PlugIns/jdk1.7.0_45.jdk/Contents/

Note: Step-2 and 3 are required because on deploying JavaFx app, the deployment process only copying `/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home` by default into MyApp.app/Contents/PlugIns, it was skipping MacOS/ folder and Info.plist.

Without doing these above changes for signing app with -

codesign --deep -s "my name" MayApp.app

I was getting erron on signing - MyApp.app: bundle format unrecognized, invalid, or unsuitable - We are facing this issue so we need to identify about what are making app bundle format unrecognized, invalid, or unsuitable.

Thanks

Problem

I have created on JavaFX application app at Mavericks and signing with Xcode 5.0.2 using - ``` codesign --deep -s "my name" MayApp.app codesign -v MayApp.app && echo MayApp.app is Signed Successfully! ``` WITHOUT SIGN MYAPP LAUNCHING FINE!! Without using --deep, I am not able to sign app at Mavericks. -- More Try -- Now at Mavericks, we can no longer sign a bundle if any nested bundle in that package is unsigned. I did sign the framework of my app by following the instruction written at - http://furbo.org/2013/10/17/code-signing-and-mavericks/ ``` codesign --verbose --force --sign "my name" MyApp.app/Contents/PlugIns/jdk1.7.0_21.jdk ``` Signing framework commands alone or after signing framework, does not make any changes in signing app. ------ THE MAIN ISSUE ------ On running above commands (whether only sign app or along with framework signing), MyApp.app get signed successfully but that app not launching at Mac because of signing command not preserving ALIAS property for the file libjli.dylib that exist at - `MyApp.app/Contents/PlugIns/jdk1.7.0_21.jdk/Contents/MacOS`. Signing app code converting libjli.dylib alias into a Dynamic Library. Then I thought of copying libjli.dylib via following command - ``` <target name="Copylib" depends="SigningApp"> <delete file="MyApp.app/Contents/PlugIns/jdk1.7.0_21.jdk/Contents/MacOS/libjli.dylib"/> <exec executable="cp"> <arg line="-R /Library/Java/JavaVirtualMachines/jdk1.7.0_21.jdk/Contents/MacOS/ MyApp.app/Contents/PlugIns/jdk1.7.0_21.jdk/Contents/MacOS"/> </exec> </target> ``` This preserving alias but now on verifying sign app to says - ``` admins-iMac:osx admin$ codesign -v -v MyApp.app MyApp.app: code object is not signed at all In subcomponent: MyApp.app/Contents/PlugIns/jdk1.7.0_21.jdk In architecture: x86_64 ``` Same happen if I am copying that alias manually at MyApp.app. Please suggest any way to sign app with preserving the properties of the all files exist in my framework at - Contents/PlugIns/jdk1.7.0_21.jdk? Thanks

Original source