Post

Replies

Boosts

Views

Activity

Code signing of dylib for use under iOS
We are in the process of developing our text to speech and speech analysis tools over to mobile platforms = cross platform development. The tools are written in C++ and are compiled using CMake with an ios specific toolchain targetting the correct platform sdk. One of the parts of this toolkit is the dynamic loading of language specific dylibs via dlopen. I have seen that this can only be done if the dylib has been signed with the same certificate as the application. Note that we are still using "free" developer certificates generated automatically by XCode. When I run the test application, at the point where the dylib should be loaded via dlopen, the load fails and dlerror returns the following : dlopen(<path to dylib>, 0x0001): code signature invalid (errno=1) sliceOffset=0x00000000, codeBlobOffset=0x0205D0F0, codeBlobSize=0x000453B0 for '<path to dylib>' However, when I check the code signature with : codesign -d --verbose=2 --extract-certificates <path> I get the same certificate output from both the application bundle and the dylib in question. For example : Identifier=libnormaliser_fr Format=Mach-O thin (arm64) CodeDirectory v=20400 size=265332 flags=0x0(none) hashes=8286+2 location=embedded Signature size=4755 Authority=Apple Development: <our apple id> Authority=Apple Worldwide Developer Relations Certification Authority Authority=Apple Root CA Signed Time=4 Jan 2021 at 09:27:14 Info.plist=not bound TeamIdentifier=<our team id> Sealed Resources=none Internal requirements count=1 size=192 Now, when I run the command : codesign --verify --deep --verbose=2 it outputs : ./libxxx.dylib: valid on disk ./libxxx.dylib: satisfies its Designated Requirement I am testing on an iPad with iOS version 14.0.1, by the way. So, something is still missing, but what ? Can anyone help me with this please ?
20
0
11k
Mar ’23
How to draw a line of shapes in swift
I am porting an android music score application over to iOS, using swift and SwiftUI. One of the elements of music notation is a glissando. The form of this line can be seen here. - could not see how to add an image here. When I draw the glissando in the android app, I can create a shape which represents a single "wave" of this line and then use it as a stamp which is repeated by the graphics system along the defined path, in this manner : m_StampPath = new Path(); m_StampPath.moveTo(...); m_StampPath.cubicTo(...); m_StampPath.cubicTo(...); ... m_StampPath.close(); m_WavyLine = new PathDashPathEffect(m_StampPath, fStampOffset, 0.0f, PathDashPathEffect.Style.MORPH); // this is a Paint object pt.setPathEffect(m_WavyLine); pt.setStyle(Paint.Style.STROKE); LinePath = new Path(); LinePath.moveTo(...); LinePath.lineTo(...); canvas.drawPath(LinePath, pt); How can I achieve the same thing within swift, taking into account that the angle of the line is not always the same ?
2
0
1.8k
Jan ’22
CoreML Quickstart example produces errors
I have been asked to start using CoreML and convert our tensorflow ML model. So I wanted to follow the quickstart example documentation to see how to do this. Here are the steps I took : - Installation steps : 1. install Conda package installer - download Miniconda3 v3.9 package : https://repo.anaconda.com/miniconda/Miniconda3-py39_4.10.3-MacOSX-x86_64.pkg - run the package installation - create an environment shell : conda create --name coremltools-env - creates in <user>/opt/miniconda3/envs/coremltools-env - activate the environment : conda activate coremltools-env - install pip for this environment : conda install pip 2. install CoreML tools in the conda environment - pip install coremltools==5.0b5 (note this is a beta version, could not find the previous stable version) 3. install tensorflow within the conda environment - pip install tensorflow 4. install h5py - pip install h5py - run the python script to load (from a distance) the tensorflow model and convert it to CoreML I then run the python scripts as described in the documentation (except the test), and I get this error message : RuntimeWarning: You will not be able to run predict() on this Core ML model. Underlying exception message was: Error compiling model: "Error reading protobuf spec. validator error: Model specification version field missing or corrupt.". _warnings.warn( Note - I have included all the text of the message. Is this a problem with CoreML tools v5.0 beta 5 ? Should I try a previous version of CoreML tools, if so, where can I find the correct version numbers ?
3
0
1.2k
Oct ’21
Compiling C++ source for iOS - missing std::to_string
I am compiling our multiplatform c++ code for inclusion in apps on iOS. When I run the build (through cmake with an appropriate ios toolchain), an error is reported saying it cannot find std::to_string I have iOS sdk 14,2 installed with XCode 12.2 As this is a standard part of C++11 and my compile options indicate that I need this : -std=c++11 -stdlib=libc++, I expected no problems. Is this missing from the apple c++11 implementation ? Is there something I have missed ?
3
0
1.2k
Sep ’21
Code signing of dylib for use under iOS
We are in the process of developing our text to speech and speech analysis tools over to mobile platforms = cross platform development. The tools are written in C++ and are compiled using CMake with an ios specific toolchain targetting the correct platform sdk. One of the parts of this toolkit is the dynamic loading of language specific dylibs via dlopen. I have seen that this can only be done if the dylib has been signed with the same certificate as the application. Note that we are still using "free" developer certificates generated automatically by XCode. When I run the test application, at the point where the dylib should be loaded via dlopen, the load fails and dlerror returns the following : dlopen(&amp;lt;path to dylib&amp;gt;, 0x0001): code signature invalid (errno=1) sliceOffset=0x00000000, codeBlobOffset=0x0205D0F0, codeBlobSize=0x000453B0 for '&amp;lt;path to dylib&amp;gt;' However, when I check the code signature with : codesign -d --verbose=2 --extract-certificates &amp;lt;path&amp;gt; I get the same certificate output from both the application bundle and the dylib in question. For example : Identifier=libnormaliser_fr Format=Mach-O thin (arm64) CodeDirectory v=20400 size=265332 flags=0x0(none) hashes=8286+2 location=embedded Signature size=4755 Authority=Apple Development: &amp;lt;our apple id&amp;gt; Authority=Apple Worldwide Developer Relations Certification Authority Authority=Apple Root CA Signed Time=4 Jan 2021 at 09:27:14 Info.plist=not bound TeamIdentifier=&amp;lt;our team id&amp;gt; Sealed Resources=none Internal requirements count=1 size=192 Now, when I run the command : codesign --verify --deep --verbose=2 it outputs : ./libxxx.dylib: valid on disk ./libxxx.dylib: satisfies its Designated Requirement I am testing on an iPad with iOS version 14.0.1, by the way. So, something is still missing, but what ? Can anyone help me with this please ?
Replies
20
Boosts
0
Views
11k
Activity
Mar ’23
How to draw a line of shapes in swift
I am porting an android music score application over to iOS, using swift and SwiftUI. One of the elements of music notation is a glissando. The form of this line can be seen here. - could not see how to add an image here. When I draw the glissando in the android app, I can create a shape which represents a single "wave" of this line and then use it as a stamp which is repeated by the graphics system along the defined path, in this manner : m_StampPath = new Path(); m_StampPath.moveTo(...); m_StampPath.cubicTo(...); m_StampPath.cubicTo(...); ... m_StampPath.close(); m_WavyLine = new PathDashPathEffect(m_StampPath, fStampOffset, 0.0f, PathDashPathEffect.Style.MORPH); // this is a Paint object pt.setPathEffect(m_WavyLine); pt.setStyle(Paint.Style.STROKE); LinePath = new Path(); LinePath.moveTo(...); LinePath.lineTo(...); canvas.drawPath(LinePath, pt); How can I achieve the same thing within swift, taking into account that the angle of the line is not always the same ?
Replies
2
Boosts
0
Views
1.8k
Activity
Jan ’22
CoreML Quickstart example produces errors
I have been asked to start using CoreML and convert our tensorflow ML model. So I wanted to follow the quickstart example documentation to see how to do this. Here are the steps I took : - Installation steps : 1. install Conda package installer - download Miniconda3 v3.9 package : https://repo.anaconda.com/miniconda/Miniconda3-py39_4.10.3-MacOSX-x86_64.pkg - run the package installation - create an environment shell : conda create --name coremltools-env - creates in <user>/opt/miniconda3/envs/coremltools-env - activate the environment : conda activate coremltools-env - install pip for this environment : conda install pip 2. install CoreML tools in the conda environment - pip install coremltools==5.0b5 (note this is a beta version, could not find the previous stable version) 3. install tensorflow within the conda environment - pip install tensorflow 4. install h5py - pip install h5py - run the python script to load (from a distance) the tensorflow model and convert it to CoreML I then run the python scripts as described in the documentation (except the test), and I get this error message : RuntimeWarning: You will not be able to run predict() on this Core ML model. Underlying exception message was: Error compiling model: "Error reading protobuf spec. validator error: Model specification version field missing or corrupt.". _warnings.warn( Note - I have included all the text of the message. Is this a problem with CoreML tools v5.0 beta 5 ? Should I try a previous version of CoreML tools, if so, where can I find the correct version numbers ?
Replies
3
Boosts
0
Views
1.2k
Activity
Oct ’21
Compiling C++ source for iOS - missing std::to_string
I am compiling our multiplatform c++ code for inclusion in apps on iOS. When I run the build (through cmake with an appropriate ios toolchain), an error is reported saying it cannot find std::to_string I have iOS sdk 14,2 installed with XCode 12.2 As this is a standard part of C++11 and my compile options indicate that I need this : -std=c++11 -stdlib=libc++, I expected no problems. Is this missing from the apple c++11 implementation ? Is there something I have missed ?
Replies
3
Boosts
0
Views
1.2k
Activity
Sep ’21