3

I have to show other people a project I'm working on but I want to protect a framework in the project from being readable. I just packed all the code in the framework and added it to the project.

The problem is that when the framework calls some delegate methods and I set a breakpoint to those Xcode shows the full .m / .mm files where those calls come from. How can I prevent that? I want to protect my code.

Artjom B.
  • 61,146
  • 24
  • 125
  • 222
Max
  • 2,699
  • 2
  • 27
  • 50

2 Answers2

4

You are only seeing the code because it's available on your machine and Spotlight can find it. If you distribute the compiled framework binary, the source will not show up in the debugger, though the names of methods will. Stripping the binary ("Strip Linked Product") will remove some names of functions, but not methods, since these have to be available at runtime in order for message dispatch to work. This will make it harder to make use of crash logs, so I don't generally recommend it unless you really need to save space.

Keep in mind that there is only so much you can (or should) do to protect against reverse engineering. All languages are subject to reverse engineering, but ObjC is particularly susceptible by its nature. See Decompiling Objective-C libraries for more discussion on that.

Community
  • 1
  • 1
Rob Napier
  • 286,113
  • 34
  • 456
  • 610
  • Thanks a lot! I was a bit shocked that it was readable but good to know that spotlight found it. I know that it's quite easy to reverse engineer but at least it's not readable now ;) – Max Oct 24 '12 at 09:21
1

Compile your framework into a binary. This will "protect" the source code from being readable, with only the header files (you choose) to be exposed.

WrightsCS
  • 50,551
  • 22
  • 134
  • 186