You would need compile it into the app. Which is not be possible without the source code to Pythonista. You would be able to do it with Pyto which is open source but it would be complicated.
You are right. With the AppStore version of both apps is not possible, I need to compile my own, at least can test it with Pyto.
In my last approach I ended by compiling a test
C library for arm64 and then I signed it with
Pythonista apparently accept the dynamic library but stops importing it as the identity used to signed it is not the same of the identity the owner of the app used (or at least that is what I think, really don’t know which other thing is preventing to load it)
If you are interested in reading the traceback of
Traceback (most recent call last):
File "/private/var/mobile/Containers/Shared/AppGroup/HIDDEN/Pythonista3/Documents/hw.py", line 4, in <module>
test_lib = ctypes.cdll.LoadLibrary("./test-lib_1.so")
File "/var/containers/Bundle/Application/HIDDEN/Pythonista3.app/Frameworks/Py3Kit.framework/pylib/ctypes/__init__.py", line 427, in LoadLibrary
File "/var/containers/Bundle/Application/HIDDEN/Pythonista3.app/Frameworks/Py3Kit.framework/pylib/ctypes/__init__.py", line 349, in __init__
self._handle = _dlopen(self._name, mode)
OSError: dlopen(/private/var/mobile/Containers/Shared/AppGroup/HIDDEN/Pythonista3/Documents/test-lib_1.so, 0x0006): code signature invalid (errno=1) sliceOffset=0x00000000, codeBlobOffset=0x00008050, codeBlobSize=0x00004900 for '/private/var/mobile/Containers/Shared/AppGroup/HIDDEN/Pythonista3/Documents/test-lib_1.so'
How apple encapsulates the apps is very interesting and I still believe that someone super skilled can archive this, anyway, thanks again @ccc for your quick answer