How to correctly sign a C++ dylib to be loaded via dlopen in iOS

0

We are integrating our language tools into mobile platforms.

As such, there are language specific libraries which are loaded upon user request - english, french, spanish or greek at present.

These libraries are too big to be linked statically.

At present, we are able to load these libraries via dlopen and dlsym calls in linux.

I have seen that we can use these calls starting with iOS v8.

As Apple Developer Support has said "... there’s no blanket prohibition against using dlopen and friends."

After having compiled our libraries (using CMake and a relevant iOS toolchain), they have been signed with the same certificate and identifier as the application, using

codesign --deep --force --sign "78037F819B5AA1522177B06DA8E7C5343DDBC0CF" --identifier=fr.teamname.libtext_fr ./libtext_fr.dylib

However, when the application (running on an iPad with iOS v14) tries to load the file, an error is raised and we get the following reason :

code signature invalid (errno=1) sliceOffset=0x00000000, codeBlobOffset=0x0205D0F0, codeBlobSize=0x000453E0

Note that we are using a free Apple Id at present and have not as yet joined the developer program.

I have done a lot of searching, but as yet have not found what is missing.

What is the right direction to take now ?

ios
code-signing
dylib
asked on Stack Overflow Jan 6, 2021 by Simon

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0