skip to Main Content

I have developed a simple app for Mac which uses a browser window to display some content. Now the assets (images etc.) are visible to anyone who receives the app and discloses the content in finder using ‘show package content’.
Is there a way to prevent this? Can I hide it or encapsulate it somehow using code or some XCode function?

2

Answers


  1. A trivial way would be to change the extension on your files so the system doesn’t recognize them as images. You’d then have to load the images as data and convert them to images in code, which would be a bit of a pain.

    A more rigorous solution would be to encrypt the images in your app bundle, then write a utility function that loads and decrypts images.

    Login or Signup to reply.
  2. Here’s another option.

    You can zip all the assets. Use whatever is easiest e.g. pkzip or gzip or even just tar it all. Then you hide a lot of info and, if you want to go the extra step, it is easy to encrypt the zipped file and there are lots of libraries around to include in your project and use to unzip it with.

    It should be easy to read assets directly from the zipped file, but if you need them individually you could e.g. put a single file / resource inside a zip or you could unzip it. You could even unzip to temporary space and remove it all when the app quits if you have really sensitive stuff that is too big to fit in memory.

    ** EDIT **

    Java works this way right. A jar file is just a renamed zip and it often contains all of the resources the app needs, and it seems to be working there. So if that is a guide performance should not be too bad.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search