PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

Protecting app resources

Hi,

I just read recently that some people are taking apps on the AppStore and changing the png graphics etc to rebrand and then putting their modified version back on the AppStore to sell. This probably could not get too out of hand, given the requirements to establish you are a legitimate business etc as part of selling apps, but I really don't see how you could tell if someone had done that to your app with the sheer quantity of apps in the store, so I decided to put a bit of protection in anyhow.

Basically it was just a simple package format that had a bit of header info for each file containing the name of the file and the size in bytes, and the file data all packed into a single file. I built a command line app to add files to a package etc so it could be run as a build step and found that it didn't impact build performance at all, well at least not noticeably. It's just as easy to load a png from data as it is filesystem using Apple's UIImage (just use initWithData instead of initWithContentsOfFile). In addition, I put some basic encryption (although I call it encoding) just to obfuscate the clear text names and e.g. the "PNG" bytes at the start of each png image. Due to US law encryption seems to be a big deal for apps in the AppStore. I think the US gov needs to ensure they can break your encryption and get access to your images in case of a national emergency.

Doing it this way was also good because it allowed the graphics to be organized outside of the code folder and didn't need to add all of the images into the project continually. Could just save another png into the folder and next time I built it would auto be included into the pkg.

One thing I found writing the command line tool is that default unix/linux shell behavior is to expand *.png as an argument - it goes and finds all files then adds them to the argument list, replacing the *.png you supplied. This was a really annoying "feature" and the workaround is to put quotes around it like:

Code:

./Packager test.pkg -a "*.png"


Be interested to know if the rebranding has happened to anyone though.
I've not heard of that, but I've not been very active in the iPhone scene over the last few months. I implemented something similar, which is to encrypt all files (lua scripts, images, data files, etc) using a symmetrical algorithm with a fixed key. That does not protect the PNGs that are the application icon or the default splash screen, but I don't know that those could be protected as they are loaded by the OS itself.

My hunch is these people doing the rebranding are looking for the low-hanging fruit - apps that can be quickly and easily modified. There really isn't much money to be made like this. Anything making decent money would have to be popular, and popular apps are seen by so many eyes that it would be recognized as a knock off. In that case Apple would pull the app and the fraudsters would not receive payment. There is a long delay between listing an app and actually receiving payment from Apple, so that hurts the chances of the app making any actual money before it can be recognized as a rebrand.

In our case we really wanted to protect the data files in some way because all the game-specific behavior is coded in Lua, so we would literally be distributing a lot of source code plaintext if I didn't have some sort of encryption.

Dan
Dan, I wasn't keen adding any sort of decent strength encryption because from what I could tell you would need to go registering with some US gov department to get approval/license basically to export encryption. I don't understand it, and don't live in US so not encountered it before. When submitting your app, if you say it uses encryption does it allow certain types through up to a certain key length, encryption type etc?

You can't protect with the app icon or Default.png (well as far as I know). In fact, you can't even have a Default.jpg (it works in the Simulator but not on real devices). I was only referring to the app graphics and other config resource files, including about screen stuff etc.

With rebranding I was a bit concerned with my game because I specifically designed it to be pretty flexible and have it quite configurable - in fact I plan on releasing a second game using pretty much the same code, but with different graphics and configuration.
I use blowfish, and I simply use a key length less than 128 bits.

I really don't see rebranded apps within the app store as a true problem, or as a loss of revenue for the legitimate game (Is a user really going to find and compare the original and rebranded versions, and do a head-to-head comparison before they buy? In that case they would know something fishy is going on.). Users with jailbroken phones running cracked applications is a vastly larger issue. However, my mindset with that is the same as it has always been with Pocket PC - these people wouldn't have bought my app anyway, so I'm not going to lose sleep over it.

Dan