Xcode: hide / protect resource files in final iOS application?

I plan to develop an application for iOS and want to use HTML5, CSS and Javascript. The final application should be implemented as a native application using Xcode and UIWebView.

Is it possible to hide or protect my html files in the final application? I have to put the files in a folder called “File Support” in Xcode. Thus, everyone can view simple files after purchasing the application, extracting the .ipa file, right?

+5
source share
3 answers

There are many ways to protect your data, depending on how good your protection is. For very minimal protection against random hackers, you can use the obfuscation string algorithm to obfuscate and de-obfuscate HTML content as NSStrings. Here is an example of this . I have not used this specific code, but I also do not recommend obfuscation as a method if the data is really not very sensitive.

The best solution is to encrypt the HTML content, although this works more and may include some export control issues , depending on where you distribute your application.

You have many options for encryption.

1) , - NSUserDefaults. registerDefaults:, , , , , . PDKeychainBindings . HTML :

NSString* webPageContent = 
    [[PDKeychainBindings sharedKeychainBindings] valueForKey: @"index.html"];

2) , AES-. , HTML , . , NSString, UIWebView loadHTMLString: baseURL:.

3) , API CommonCrypto . , , HTML .

+9

, script, , UIWebView :

- (void)loadData:(NSData *)data MIMEType:(NSString *)MIMEType textEncodingName:(NSString *)encodingName baseURL:(NSURL *)baseURL
+1

HTML .. , UIWebView

- (void)loadHTMLString:(NSString *)string baseURL:(NSURL *)baseURL

HTML . , , . - , ( -).

, ipa. < 1%, , .

( ): UIWebView -, . .

-4

All Articles