Reputation: 3545
I just make an iOs application with my own DRM (The application is for Cydia). I am wondering how I can secure my application from decompilation. I decompiled my app, just to check what the "interested" user can see. I was able to see every string, sensitive strings. Then I decompiled FindMyiPhone and I saw that every string was replaced with "some string from a protected section"
Does anyone know protect a string?
Upvotes: 1
Views: 664
Reputation: 2792
First things first; if someone really wants to crack an app, he/she will find a way to do it. Also Cydia and Jailbreak won't help you much for protecting your app.
You should encrypt the string separately and use this encrypted string in your code. Naturally, the string should be decrypted on the runtime before being used. This is very easy to crack and these are the things you can do to make it harder;
In addition to the first step, you can use preprocessor directives (especially #define
) to make the compiled code more riddling. For example;
#define importantString temp
@property (nonatomic, strong) NSString * importantString;
NS_INLINE
for the decryption function to make the code more complicated when decompiled.Still, these are all well-known methods and will only protect the code from curious eyes. For further information, you can look at this tutorial or read Apple documentation or this book.
Upvotes: 1