如何在签署应用程序时保留别名属性? [英] How to preserve alias property while signing app?

查看:139
本文介绍了如何在签署应用程序时保留别名属性?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在Mavericks的JavaFX应用程序应用程序上创建并使用-

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!

无需签名即可启动MYAPP!

WITHOUT SIGN MYAPP LAUNCHING FINE!!

没有使用-deep ,我无法在Mavericks上签名应用。

Without using --deep, I am not able to sign app at Mavericks.

-更多尝试-

现在在Mavericks,如果该包中的任何嵌套包都未签名,我们将无法再对该包进行签名。我确实按照以下代码中的说明对应用程序的框架进行了签名- http ://furbo.org/2013/10/17/code-signing-and-mavericks/

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.

------主要问题------

在运行以上命令(无论仅对应用程序签名还是与框架签名一起运行)时,MyApp.app获得成功签名,但是应用未在Mac上启动,因为签名命令未保留文件 libjli.dylib 的ALIAS属性- MyApp.app/Contents/PlugIns/jdk1.7.0 _21.jdk / Contents / MacOS 。对将 libjli.dylib 别名转换为动态库的应用程序代码进行签名。

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.

然后我想到了通过以下命令复制libjli.dylib的方法-

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

如果我在MyApp.app上手动复制该别名,也会发生同样的情况。

Same happen if I am copying that alias manually at MyApp.app.

请建议使用任何方法签名应用程序,以保留我所有文件的属性框架- Contents / PlugIns / jdk1.7.0_21.jdk

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?

谢谢

推荐答案

通过从jdk7u21更新Java解决了我的问题升级到最新的jdk7u45,因为Apple已在OS X上禁用了Oracle的Java 7u25及更低版本。更新到最新版本将允许Java在Mac OS X上运行。

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 -


  1. MyApp.app/Contents/Info.plist中 CFBundleExecutable 到MyApp, CFBundleIconFile 到MyApp.icns。

  2. 需要复制 / Library / Java /JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/MacOS/libjli.dylib MyApp.app/Contents/PlugIns/jdk1.7.0_45.jdk/Contents/MacOS 以获得 libjli.dylib 别名。

  3. 我们还需要复制 /Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Info.plist MyApp.app/Contents/PlugIns/jdk1.7.0_45.jd k / Contents /

  1. In MyApp.app/Contents/Info.plist for CFBundleExecutable to MyApp, CFBundleIconFile to MyApp.icns.
  2. 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.
  3. 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/

注意:步骤2和3是必需的,因为在部署时JavaFx应用程序,部署过程默认仅将 /Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home 复制到 MyApp.app/Contents/插件,它跳过了MacOS /文件夹和Info.plist。

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.

在不进行上述更改的情况下--p>

Without doing these above changes for signing app with -

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

我在签名时遇到了错误- MyApp.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.

谢谢

这篇关于如何在签署应用程序时保留别名属性?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆