Nakkeeran
Nakkeeran

Reputation: 15296

Posibilty of unarchiving static library and get the source?

I have planned to create custom framework in iOS, and provide it other user to use the frame work, But I would like to protect the source from the users.

After few research ,I found out static Library is one of the way achieving it, But I just wanna confirm is there any possibility of unarchiving .a file and get the source.

And please do let me know the best practices to be followed in creating static library.

Upvotes: 2

Views: 1347

Answers (1)

paxdiablo
paxdiablo

Reputation: 882206

Archives tend to contain code rather than source so, no, they won't be able to get your source by just extracting it from the library.

What happens is that you compile your source files (such as xyzzy.c and plugh.c) into objects (xyzzy.o and plugh.o) then those objects are added to an archive library such as twistymaze.a.

At no point does the source code need to be placed in the archive file, simply because your clients don't need the source to use your framework.

All they really need are the objects (individually or in a library) and the header files specifying the API.


That's not to say they can't reverse engineer your object files to get an approximation of the source code but there'll be a lot of information missing (comments, variable names and so forth).

Remember that the idea is not to defeat the elite, they'll beat you no matter what you try, the same way that no bank vault is impenetrable. The idea is to defeat the vast majority of passers-by who may otherwise be tempted. Most of them can be defeated by very basic measures (like compilation).

Upvotes: 7

Related Questions