Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Adding swift framework extracted from IPA

I'm trying to run an IOS app created by another dev that is using a cocoapod from a private repository I have no access to. I managed to extract the .framework bundle from the IPA and add it to the xcode project but it is not being recognized (I get "No such module").

Is it possible to do what I'm trying to achieve?

So far, what I've tried:

  • build it in release as I guess the framework in the IPA is in release
  • add the .framework as embedded binary
  • add the .framework as Linked Framework and Libraries
  • copy the .framework to ~/System/Library/Framework
  • update the Frameworks Search Path including $(SRCROOT), recursive, hardcoded paths, etc.
  • change the .framework location to "Relative to Build Products"

Thanks!

like image 394
Ivo Avatar asked Oct 18 '22 03:10

Ivo


1 Answers

It wasn't that much easy to get the frameworks used in project from ipa file.

Whenver the application runs for first time, also when you archive your application, all the linked .frameworks will get converted to .dylib that is dynamic libraries.

What is static library - a unit of code linked at compile time, which does not change.

What is dynamic library - a unit of code and/or assets linked at runtime that may change.

Framework - A framework is a hierarchical directory that encapsulates a dynamic library, header files, and resources, such as storyboards, image files, and localized strings, into a single package. Apps using frameworks need to embed the framework in the app's bundle.

Dynamic Library

A dynamic lib file is just resides inside the framework folder.

Following is a description from apple documentation

Dynamic libraries outside of a framework bundle, which typically have the file extension .dylib, are not supported on iOS, watchOS, or tvOS, except for the system Swift libraries provided by Xcode.

Ref: Documentation

So you cannot simply copy a .dylib to xcode bundle and just use it. There is some sort of security too.

Another approch

It is possible to decompile the source code from .ipa files. You will get idea from below links.

SO Question regarding decompiling of ipa file

Decompilation Possibility

like image 109
Saranjith Avatar answered Oct 21 '22 07:10

Saranjith