Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Obfuscating Swift code before submission to Apple App Store

Tags:

I'm having a hard time finding any info on this. Android themselves mention code obfuscation as something to do before submitting to their store. But I see nothing about this from Apple or from any "third party" before-submission checklists. The only similar question I could find was one 5 years ago about Objective-C, and I only can find 1 github library about iOS obfuscation. Is it a common practice to obfuscate Swift code when submitting to the Apple App Store? Especially to hide any private API URLs or API keys? Is there a Pro-Guard equivalent for Apple?

like image 722
Kardinal Avatar asked Oct 01 '16 01:10

Kardinal


People also ask

What is code obfuscation in IOS?

Code obfuscation has become a standard method for app developers to prevent hackers from easily decompiling and reverse engineering app code. The method scrambles the app's code to make it hard to read and interpret.

Is Swift obfuscated?

SwiftShield does not obfuscate things like file names and hardcoded strings -- only the types themselves. No Objective-C classes that call Swift methods (but Swift classes calling Objective-C code are fine). Your project should be 100% written in View Code.

How does code obfuscation work?

Obfuscation in computer code uses complex roundabout phrases and redundant logic to make the code difficult for the reader to understand. The goal is to distract the reader with the complicated syntax of what they are reading and make it difficult for them to determine the true content of the message.


1 Answers

Java gets converted into bytecode, which can be decompiled.

Swift is a compiled language, and the Clang compiler is highly optimized. In release mode it strips out symbols and does a lot of optimization that does a great deal of obfuscation all by itself. There are decompilers for compiled languages, but the results are really awful and hard to read.

Edit:

There are tools like iXGuard that have the ability to further obfuscate your Swift code, making it even harder for hackers to reverse-engineer it.

like image 149
Duncan C Avatar answered Sep 17 '22 13:09

Duncan C