How to Fix Dylib with Invalid Signature

How to fix dylib with invalid signature?

NOTE: VideoBuilderLibrary is a custom framework we built.

To test the code sign state,

# Replace the framework to yours
codesign -v
frameworks/VideoBuilderLibrary.framework/Frameworks/libavutil.55.dylib
[no output]

If there is any invalid signature,

codesign -v 
frameworks/VideoBuilderLibrary.framework/Frameworks/libavutil.55.dylib
frameworks/VideoBuilderLibrary.framework/Frameworks/libavutil.55.dylib:
invalid signature (code or signature have been modified)
In architecture: x86_64

To resigned all dylib files in a framewor and fix this, run command below with "YOUR CERTIFICATE NAME" replaced with your cert file name,

cd frameworks/VideoBuilderLibrary.framework/Frameworks
ls | xargs codesign -f -s "YOUR CERTIFICATE NAME"

dyld: Library not loaded: code signature invalid

I fixed this error by using a paid developer account.

The file libswiftCore.dylib doesn’t have the correct code signature

I fixed this issue let me summarize and make it helpful for everyone who facing this issue, Here are some troubleshooting steps.

  • Xcode build setting in my case I changed through some script, if you are using some build system to make Xcode project then add swift embed library always to YES, otherwise you can go to Xcode build setting and set a flag to YES

  • Change your IPA to .zip and then unzip, there should be SwiftSupport folder like this SwiftSupport/iphoneos/all dylib library that required by your project.

  • If Swift Support folder not exists then you have to create swift support folder and append with IPA using some command through a terminal, for my case I did like this. zip -r chose_your_ipa_name.ipa Payload SwiftSupport , Payload folder will contain .app file and SwiftSupport folder contain .dylib like this hierarchy SwiftSupport/iphoneos/*.dylib

  • SwiftSupport folder library should be code sign by apple certificate, not your certificate. To make it work Just copy .dylib from this path "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/"

  • Library under your this framework folder Payload/Framework/.dylib library should be signed by your certificate.

Now very important point that should not be miss

  • Check architecture info of your library under Payload/Framework/*.dylib , using lipo -info path_of_dylib , If it contains framework arm64e , remove this arch somehow this not working, I also don't know the reason (if anyone know please let me know also) After that code signs your lib with same code identity.

  • Make .ipa file using again using terminal like this way. zip -r your_app_name.ipa Payload SwiftSupport, Make sure these directory does not contatins.DS_Store hidden files, if exits remove them before making ipa.

Hope so these troubleshooting steps will work :) If anything I missed Sorry for that :) If you want more discussion kindly let me know via email or comment here. mshauket.developer@gmail.com

ITMS-90238: Invalid Signature when submitting to AppStore with bundled AdoptOpenJDK

It seems there are 2 files libfreetype.dylib.6 and libfreetype.6.dylib with identical content within AdoptOpenJDK. I was using a filter for signing *.dylib files and hence the libfreetype.dylib.6 file was not included within the filter and hence not signed. By updating the filter to also include *.dylib.* the problem was solved.

This problem did not appear with Oracle JDK because on Mac OS X it does not distribute the libfreetype library.



Related Topics



Leave a reply



Submit