Unsolved Deploy Qt4 Framework on Mac does not sign
-
I made the following to the libraries and frameworks except plugins
install_name_tool -id @executable_path/../Frameworks/libcrypto.1.0.0.dylib MyApp.app/Contents/Frameworks/libcrypto.1.0.0.dylib
when i give make codesign it still fails
-
@SherifOmran said:
codesign] Error 1
Stupid question, but can you actually codesign something else ?
-
@sandy.martel23
Very good, it is not studpid question, I tried to sign the library manually and it turned that i then signed each file in the plugin manually and then when i give
make codesign (it works)codesign --sign '3rd Party Mac Developer Application: Sherif Omran (R3JGXHN3B3)' --keychain ~/Library/Keychains/login.keychain ./libcrypto.1.0.0.dylib
Thank you..
Next step, i need to create the package .. Could you please help me with the command?
when i give
make package -> it has error -
But after i codesigned it, the app does not start
Process: TypingTutor [10399]
Path: /Users/USER/Desktop/*/TypingTutor.app/Contents/MacOS/TypingTutor
Identifier: com.PCfone.ArabicTypingTutor
Version: 1.0.0 (5.1)
Code Type: X86-64 (Native)
Parent Process: ??? [1]
Responsible: TypingTutor [10399]
User ID: 501Date/Time: 2016-02-05 20:39:38.405 +0100
OS Version: Mac OS X 10.11.3 (15D21)
Report Version: 11
Anonymous UUID: 70210516-2C20-592D-A84C-DD5E4F2AE6C1Sleep/Wake UUID: D83EB830-6064-42B2-B9B1-2693E5916DDF
Time Awake Since Boot: 25000 seconds
Time Since Wake: 1600 secondsSystem Integrity Protection: enabled
Crashed Thread: 0
Exception Type: EXC_BAD_ACCESS (Code Signature Invalid)
Exception Codes: 0x0000000000000032, 0x00000001004f5000
Exception Note: EXC_CORPSE_NOTIFYkernel messages:
-1 sec CODE SIGNING: cs_invalid_page(0x1004f5000): p=10399[TypingTutor] final status 0x3000200, denying page sending SIGKILL
-1 sec CODE SIGNING: process 10399[TypingTutor]: rejecting invalid page at address 0x1004f5000 from offset 0x0 in file "/Users/USER/Desktop/*/TypingTutor.app/Contents/Frameworks/QtSql.framework/Versions/4/QtSql" (cs_mtime:1454627177.0 == mtime:1454627177.0) (signed:1 validated:1 tainted:1 wpmapped:0 slid:0) -
Report: This is a general report for somebody who may search later
main problem was validation process of appstore. I took 2 approaches
1- using make codesign (QT)
2- using xcodein the first approach: The problem was make codesign fails, because it turned that i needed to codesign each file on its own. Then i reached a correct make codesign but make product fails to package the app.
In the second approach: The problem was framework embedding inside the application. App is written with Qt 4.8.7_2 and apple requests a new structure for the framework, in which there is a folder called A inside Versions folder, which does not exist and thus it failed. Note that, there is a folder called 4 inside which there is the framework, if we change this folder name from 4 to A as apple want, the app will crash.
Solution : Placed the frameworks inside a special folder and from xcode requested to embed the frameworks from this folder. From Terminal, i restructured the framework directory and made internal symbolic links inside the folder (Versions/A -> 4 and Versions/Current->4). In another works, created 2 symbolic links, one called A and the other called Current and both point to A.
Now Xcode, could validate and codesign, the output file uploaded to Appstore failed with Invalid build. Appstore send me an email stating what is failed. I will check, work on and let you know.After correcting all error listed in the automatic email from Appstore that i could understand. There is only 1 error still and i would appreciate your help.
Final error -
Invalid Signature - The main app bundle TypingTutor at path TypingTutor.app has following signing error(s): --prepared:/Volumes/data01/app_data/dstr/mz_3951107737348925641dir/mz_287010058513639019dir/com.PCfone.ArabicTypingTutor.pkg/Payload/TypingTutor.app/Contents/Frameworks/libcrypto.1.0.0.dylib --validated:/Volumes/data01/app_data/dstr/mz_3951107737348925641dir/mz_287010058513639019dir/com.PCfone.ArabicTypingTutor.pkg/Payload/TypingTutor.app/Contents/Frameworks/libcrypto.1.0.0.dylib --prepared:/Volumes/data01/app_data/dstr/mz_3951107737348925641dir/mz_287010058513639019dir/com.PCfone.ArabicTypingTutor.pkg/Payload/TypingTutor.app/Contents/Frameworks/libssl.1.0.0.dylib --validated:/Volumes/data01/app_data/dstr/mz_3951107737348925641dir/mz_287010058513639019dir/com.PCfone.ArabicTypingTutor.pkg/Payload/TypingTutor.app/Contents/Frameworks/libssl.1.0.0.dylib --prepared:/Volumes/data01/app_data/dstr/mz_3951107737348925641dir/mz_287010058513639019dir/com.PCfone.ArabicTypingTutor.pkg/Payload/TypingTutor.app/Contents/Frameworks/QtCore.framework/Versions/Current/. /Volumes/data01/app_data/dstr/mz_3951107737348925641dir/mz_287010058513639019dir/com.PCfone.ArabicTypingTutor.pkg/Payload/TypingTutor.app: unsealed contents present in the root directory of an embedded framework In subcomponent: /Volumes/data01/app_data/dstr/mz_3951107737348925641dir/mz_287010058513639019dir/com.PCfone.ArabicTypingTutor.pkg/Payload/TypingTutor.app/Contents/Frameworks/QtCore.framework . Refer to the Code Signing and Application Sandboxing Guide at http://developer.apple.com/library/mac/#documentation/Security/Conceptual/CodeSigningGuide/AboutCS/AboutCS.html and Technical Note 2206 at https://developer.apple.com/library/mac/technotes/tn2206/_index.html for more information.
-
Did you check the content of the Info.plist files ?
-
The info plist seems correct ..
I doubt another thing, i use to create an Archive-> then open it manually and add the plugin folder and another dylib files to the framework and then validate with xcode and send to appstore ..I am trying to find a way to include the files within the xcode validation.
-
current problem is : unsealed content in QtCore.framework (root)
-
Do you have more details coming with that ? e.g. current vs expected ?
-
After long search, i found that this mistakes comes from redundance loop of a symbolic link
Inside the QtCore.framework/.../Resources, i found i made a symbolic link to the resources folder by mistake ..
Solution: I removed this symbolic link and resigned the files ..For info how to code sign an already signed file is as follows:-
codesign --force --sign '3rd Party Mac Developer Application: Sherif Omran (R3JGXHN3B3)' --keychain ~/Library/Keychains/login.keychain ./AppFile.app
I ll let you know of the output of the upload as soon as i get the email report
-
I still get the unsealed content error
Sherif:Applications sherifomran$ codesign --verify --deep --verbose=2 TypingTutor.app/
--prepared:/Users/sherifomran/Library/Developer/Xcode/Archives/2016-02-07/TypingTutor 07-02-16 00.45.xcarchive/Products/Applications/TypingTutor.app/Contents/Frameworks/libcrypto.1.0.0.dylib
--validated:/Users/sherifomran/Library/Developer/Xcode/Archives/2016-02-07/TypingTutor 07-02-16 00.45.xcarchive/Products/Applications/TypingTutor.app/Contents/Frameworks/libcrypto.1.0.0.dylib
--prepared:/Users/sherifomran/Library/Developer/Xcode/Archives/2016-02-07/TypingTutor 07-02-16 00.45.xcarchive/Products/Applications/TypingTutor.app/Contents/Frameworks/libssl.1.0.0.dylib
--validated:/Users/sherifomran/Library/Developer/Xcode/Archives/2016-02-07/TypingTutor 07-02-16 00.45.xcarchive/Products/Applications/TypingTutor.app/Contents/Frameworks/libssl.1.0.0.dylib
--prepared:/Users/sherifomran/Library/Developer/Xcode/Archives/2016-02-07/TypingTutor 07-02-16 00.45.xcarchive/Products/Applications/TypingTutor.app/Contents/Frameworks/QtCore.framework/Versions/Current/.
TypingTutor.app/: unsealed contents present in the root directory of an embedded framework
In subcomponent: /Users/sherifomran/Library/Developer/Xcode/Archives/2016-02-07/TypingTutor 07-02-16 00.45.xcarchive/Products/Applications/TypingTutor.app/Contents/Frameworks/QtCore.framework -
I found the following information, but i don't understand it :
codesign says I have 'unsealed content' somewhere.
Do not put files or directories into the top directory of an app or framework bundle
All content must be inside Contents or Versions respectively as described earlier.
What do they mean?My Framework structure is as follows:
QtGui.framework/
QtGui -> Versions/Current/QtGui
Resources -> Versions/Current/Resources/
Versions -
update 1:
I downloaded Qt5.5 and used the macdeployqt from version 5.5.1. It created the framework in a restructured way. However, it is missing the A folder inside the Versions. I created a symbolic link for it pointing to folder 4. I ve xcode project for recompiling and packaging. Xcode tries to sign the A folder.
codesign --force --sign 016A9E58DED20AC63F1157926166C4082C925F47 --preserve-metadata=identifier,entitlements --timestamp=none /MyApp.app/Contents/Frameworks/QtNetwork.framework/Versions/Aresult----
bundle format unrecognized, invalid, or unsuitable
Command /usr/bin/codesign failed with exit code 1.When i codesign the folder with
codesign --sign '3rd Party Mac Developer Application: XXXX XXXX (R3JGXHN3B3)' --keychain ~/Library/Keychains/login.keychain ./Versions/A
It works and xcode does not produce the same error but then when i submit, AppStore complains at unsigned framework at the root.Question: Why doesnot this work? how to debug it?
codesign --force --sign 016A9E58DED20AC63F1157926166C4082C925F47 --preserve-metadata=identifier,entitlements --timestamp=none /MyApp.app/Contents/Frameworks/QtNetwork.framework/Versions/A -
What framework at the root ?
-
- Previous problem was solved and i can now sign the app. The following link, helped me to solve it.
[link Signing problem due to WWDR certificate](link https://www.reddit.com/r/iOSProgramming/comments/45siza/this_certificate_has_an_invalid_issuer/)
Current Issue is the following:
The framework folder has version folder and inside the version folder there is folder called 4. This 4 must be changed into A for apple to accept it. If we change it to A, the app will crash. This is even not integrated in macdeloyqt 5.5. - Previous problem was solved and i can now sign the app. The following link, helped me to solve it.
-
In that case change the folder to A and call install_name_tool to fix the paths your application dependencies.
-
Now i could create an archive that is correctly signed with Xcode and if i open the archive and see the content and run the app, it runs. Notice that i ve put both frameworks 4 and A. When i export to generate a package to submit for appstore and submit it. It gets rejects. If i install the application locally, using otool, i see that the app links to frameworks that exist in /usr/..../ folders. But i managed to get the frameworks copied to the package but it still does not run. I get kill 9.
-- Report --
To clarify, the app fails to launch as it is linking to frameworks that are missing.
The frameworks that are missing are:
'/usr/local/opt/openssl/lib/libcrypto.1.0.0.dylib'
'/usr/local/opt/openssl/lib/libssl.1.0.0.dylib'
'/usr/local/opt/qt/lib/QtCore.framework'
'/usr/local/opt/qt/lib/QtGui.framework'
'/usr/local/opt/qt/lib/QtNetwork.framework'
'/usr/local/opt/qt/lib/QtSql.framework'Best Mac OS X development practices suggest using (in order)
@executable_path/
@loader_path/
@rpath/For more information about linking frameworks, please see the following documents:
- Run-Path Dependent Libraries section of Dynamic Library Programming Topics