iPhone/iPad App Code Obfuscation – Is it Possible? Worth it? [closed]

There doesn’t seem to a code obfuscator for Objective-C. But let’s assume for a moment that one does exist.

Apple will probably not reject an obfuscated app as long as it doesn’t crash. The main question is: what is the point of obfuscation ? Normally, you want to obfuscate code to protect your knowledge, for example if your program uses a copy protection you want to make it harder for a potential cracker or if you’re using some advanced algorithm you don’t want the business competitors to be able to decompile it.

The copy protection is already been taken care of on iOS. Although through jailbreaking a normal app can be copied and run, I’d say the actual number of users who do this is fairly low (at least a lot lower than on “regular” computers like PC and Mac). Do you expect piracy such a big problem that you need to obfuscate ?

If you do have important knowledge to protect then obfuscation might be worthwhile. Obfuscation has its downsides: you can’t debug your obfuscated app any more. Crash reports will be useless.

You might also want to read the article Obfuscating Cocoa.

Back to the fact there doesn’t seem to be an obfuscator: What you can do is this trick: say you have a header like this:

@interface MyClass : NSObject {
}

- (void)myMethod;

You could do a cheap obfuscation like this:

#ifndef DEBUG
#define MyClass aqwe
#define myMethod oikl
#endif

@interface MyClass : NSObject {
}

- (void)myMethod;

This way you can still use meaningful symbols in your source, but the compiler would turn it into “garbage” when not compiling for debugging.

Leave a Comment