Getting app containing framework containing OpenCV into TestFlight - ios

I find myself in a situation which may be unique. Please be patient, because this is going to be complex.
I am charged with creating for iOS 1) an SDK, which has taken the form of a framework , 2) a demo application, and 3) a reference application.
The SDK uses OpenCV, and so the OpenCV framework is automatically embedded inside it.
The project for the demo application at compile time automatically builds the SDK and includes a copy within itself. The demo application also links directly to the copy of OpenCV within the SDK.
The reference application is an example application meant to show people how to use the SDK framework.
So far all of this somehow works. <TAKE A BREATH>
The latest version of the demo application, however, has a problem. I need to get a copy of it into TestFlight. Despite it working fine on actual iPhones AND Xcode archiving it with no problems, nothing I have done has gotten it all the way through the App Store/TestFlight submission process. The furthest I've managed is to coerce it is that it got through validation, but when I tried submitting the app, after uploading Xcode complained:
ERROR ITMS-90034: "Missing or invalid signature. The bundle
'org.opencv' at bundle path
'Payload/FakeName.app/Frameworks/FakeNameIOSSDK.framework/opencv2.framework'
is not signed using an Apple submission certificate."
I have indeed verified that OpenCV (at least version 2.4.9 downloaded from the Website OpenCV.org) is not signed. I made an attempt to sign OpenCV with codesign, but I couldn't make that work.
The question is: What do I need to change to make the App Store happy enough that I can get my app into TestFlight? Is there some way to hide the lack of code-signing of OpenCV? Is there a way to get OpenCV properly code-signed such that the App Store is happy with it? (I have a strange vision of compiling the source of OpenCV directly into my SDK, but the size and complexity of OpenCV is such that I'd rather not try such a thing except as a measure of last resort.)
Alternatively, I find myself wondering about whether it is workable to not embed OpenCV in my SDK, but embed it within the app instead. This is what I did with the last release of the demo app in TestFlight. However, when I created the reference app, the system failed to work, leading to the current oddity of a framework within a framework.
Thanks in advance for any help anyone can provide.

Related

dart/flutter: How to ship iOS apps using flutter frontend vs. C/C++ backend to App Store?

Goal
I'm building an iOS app using flutter for frontend, and C/C++ as backend. They must interoperate through FFI, which is a language binding scheme through C dynamic libraries. I intend to submit it to iOS App Store.
Problems
The Dart FFI sample on accessing C-struct works on macOS through dynamic liking and binding. Now dynamic linking is technically possible on iOS according to Xcode 9 - No option to create dylib project iOS, however, it's unclear to me how to ship the app to AppStore, because dynamic linking is not allowed according to Apple Guidelines Section 2.5.2.
2.5.2 Apps should be self-contained in their bundles, and may not read or write data outside the designated container area, nor may they
download, install, or execute code which introduces or changes
features or functionality of the app, including other apps.
Educational apps designed to teach, develop, or allow students to test
executable code may, in limited circumstances, download code provided
that such code is not used for other purposes. Such apps must make the
source code provided by the Application completely viewable and
editable by the user.
Quite a few SO questions confirm this problem, such as:
can I use dynamic library(shared object) in my iphone app?
Will Appstore reviewers allow us to use dynamic library in iOS8?
Then official flutter documentation says
Dynamically linked libraries are automatically loaded by the dynamic
linker when the app starts. Their constituent symbols can be resolved
using DynamicLibrary.process. You can also get a handle to the library
with DynamicLibrary.open to restrict the scope of symbol resolution,
but it’s unclear how Apple’s review process handles this.
Questions
As of the date when I post this (2020), does this say that I could never ship an app using this architecture to App Store?
Is it possible that I static link my C/C++ code into a single binary of a flutter app? Take Unity as an example, their iOS plugin system recompiles the plugin into native app. If flutter has a similar mechanism, how?
The answers saying you can't use dynamic libraries on iOS date to before iOS 8, when support for user-provided dynamic libraries was added.
Nothing in 2.5.2 days you can't use dynamic libraires as long as they are shipped as part of your app. So:
As of the date when I post this (2020), does this say that I could never ship an app using this architecture to App Store?
No it doesn't, as long as "this architecture" refers to using a dynamic library that you link to at build time and bundle into your application.
Adding inputs from Reddit's FlutterDev channel
#escamoteur
As I understand it you are not allowed to load any library from
outside your installation folder. Especially not downloading something
at a later point of time. Could you make this a Stackoverflow question
and tag it with Flutter?
#airflow_matt
Since iOS 8 there can be shared libraries in the bundle, when properly
codesigned I don't see why dlopen wouldn't work. Or you can link the
library with main executable itself (just like flutter does) and
dlopen self (DynamicLibrary.process()). I think it's worth a shot.

iOS/Swift: Making the source code of an app visible?

Is it possible/do you know any possibility to visualize the source code of an app? Because I'm working on something and I have got an app that does exactly what I want mine to do, just in a completely different way. Basically, every app on the AppStore has to be written in Xcode, right? So how do I visualize the code?
Thanks in advance!
The developer needs to share the code with you if you want to get the full code.
You can't extract the code from the .ipa itself (which is essentially the app)
Moreover, not every iOS app is written in Xcode - you have other SDK to write Swift and Objective-C with and more apps that you can write cross platform app with that eventually produced the .ipa file.

How to decrease iOS app size xcode 7.3

i have developed an iOS app and i'm using many 3rd party libraries suck as Google, Facebook, VLC ect, when i generate IPA i'm getting 92,5MB and when i upload it to appStore i get 200MB.
Is there a way to decrease it to arround 60MB ?
Make sure you have all optimisation switched on in Build Settings.
And yes, sometimes its easier to check library code on GitHub (if it open sourced) and implement necessary logic manually, that include whole library in the project. Swift projects quite bulky, need to keep all runtime libraries inside the app

Is it possible to create a IOS app that can download plugins and extension later?

we have a ios app that provides the platform for many similar games. When you install this app. This app already contains binaries of x number of games.
Now we are having size issue. So just wanted to know is it possible to create a ios app that can get installed and after that as per user selection can download the games binaries separately and then run. Like a app that can download games as plugins or extensions.
I work on game side part so i dont know anything about ios apps. but so far my understanding is -> when you create the ios executable then while compiling you should have all the code present (app + all the games it will run).
It is not possible to download a native executable and run it -- that is not a capability provided by app extensions.
One loophole you might consider: it is perfectly permissible to download and run javascript, or anything else that runs in a UIWebView or WKWebView, which are both sandboxed from your iOS App's process, and have access to OpenGLES 2.0 in the form of WebGL. There are also apps which have been accepted in the App Store which can run code in interpreted languages like Python.

Will Appstore reviewers allow us to use dynamic library in iOS8?

I read many articles about dynamic library usage including this page "Can you build dynamic library...".
As apple document said, "Frameworks for iOS. iOS developers can now create dynamic frameworks. Frameworks are a collection of code and resources to encapsulate functionality that is valuable across multiple projects. Frameworks work perfectly with extensions, sharing logic that can be used by both the main application and the bundled extensions.", see full page from here.
Taking the security issue as consideration, I got the reject reason of dynamic library before iOS8, see details from "DarkDust's answer". But, how does it "just work" in iOS8? #appstore_reviewers?
Anyway, currently I'm writing a sample demo app and try to upload it to Appstore for review, the main feature is downloading a framework from internet to client and dlopen it. Hope that really "just works"!
Besides, the deployment target is iOS7.0, not sure it could works well in it.
I didn't get a so clear understand on differences between "dynamic library" and "framework", I think they are the same and in this thread I mean "Cocoa-touch framework" which could create in Xcode 6.
Some background: I'm trying to build an iOS app which does't contain extension feature, my cocoa-touch framework is for easy expand without uploading a new version as it comes from internet....
UPDATE
I published a demo project GMDemo here, will try to upload to Appstore.
UPDATE2
I failed to dlopen my dynamic framework with invalid code signing error after many tries in iOS device. Sorry, no good news here. (Almost forgot to update this question, sorry! BTW)
App Store Review Guidelines explicitly prohibit that in 2.4.5 Apps that download code in any way or form will be rejected https://developer.apple.com/app-store/review/guidelines/
UPDATE3 just use the same code signing!!!
I have test it in ad-hoc environment!
when my dynamic library use the code signing with the same code signing,It works,
otherwise,crush!!

Resources