2016-10-19 36 views
0

我以前收到此错误与一个嵌入式的JRE我codesigned(沙盒)应用程序后导致崩溃进口dylib的文件(以下this tutorial):包装应用

Library not loaded: /usr/X11/lib/libfreetype.6.dylib 
Referenced from: /Game.app/Contents/PlugIns/jdk1.7.0.jdk/Contents/Home/jre/lib/libfontmanager.dylib 

我做了什么来解决,这是导入这些dylibs到同一目录libfontmanager:

libfreetype.6.dylib 
libpng16.16.dylib 
libbz2.1.0.dylib 
libSystem.B.dylib 
libz.1.dylib 

然后libfontmanager/libfreetype.6.dylib

运行这些命令210

我再协同设计每一个dylib /罐+应用

codesign -v --deep --verbose=4 -f -s "3rd Party Mac Developer Application: Company" --verbose --entitlements Game.entitlements Game.app 
find Game.app/Contents/ -type f \(-name "*.jar" -or -name "*.dylib" \) -exec codesign --verbose=4 --deep -f -s "3rd Party Mac Developer Application: Company" --entitlements Game.entitlements {} \; 

该应用程序甚至被codesigned后完美运行!

唯一的问题是,包装和安装

productbuild --component Game.app /Applications -s "3rd Party Mac Developer Installer: Company" Game.pkg 
sudo installer -store -pkg Game.pkg -target/

后的应用程序,让我这个错误,在打开它

lsd[346]: LaunchServices: Could not store lsd-identifiers file at /private/var/db/lsd/com.apple.lsdschemes.plist 
kernel[0]: CODE SIGNING: cs_invalid_page(0x118113000): p=658[JavaAppLauncher] final status 0x3000200, denying page sending SIGKILL 
kernel[0]: CODE SIGNING: process 658[JavaAppLauncher]: rejecting invalid page at address 0x118113000 from offset 0x15000 in file "/Applications/Game.app/Contents/PlugIns/jdk1.7.0.jdk/Contents/Home/jre/lib/libz.1.dylib" (cs_mtime:1476852998.0 == mtime:1476852998.0) (signed:1 validated:1 tainted:1 wpmapped:0 slid:0) 
com.apple.xpc.launchd[1]: (com.company.gameOSX.80672[658]) Binary is improperly signed. 

是什么造成的?


编辑:我发现了一些可能回答我的问题。我在提取的应用程序上运行这些命令,它工作得很好。

sudo codesign -f -s - "/Applications/Game.app/Contents/PlugIns/jdk1.7.0.jdk/Contents/Home/jre/lib/libbz2.1.0.dylib" 
sudo codesign -f -s - "/Applications/Game.app/Contents/PlugIns/jdk1.7.0.jdk/Contents/Home/jre/lib/libSystem.B.dylib" 
sudo codesign -f -s - "/Applications/Game.app/Contents/PlugIns/jdk1.7.0.jdk/Contents/Home/jre/lib/libz.1.dylib" 

是什么造成这些dylibs不被codesigned包装后正常,如何解决这一问题?

回答

0

我想通了。出于某种原因,使用我的签名ID对其进行密码签名时,导致崩溃的dylib文件不起作用。一切工作正常,直到包装和提取这是奇怪的。

我最终删除了导致崩溃的三个dylib文件,即使在解压缩后我的应用程序也能正常工作!