Once the AIR file is downloaded, a user can copy it to another computer. However, you could potentially add an extra layer of protection by remotely checking IP address against the IP the user downloaded the app from. Just a thought.
You'll need to create a protected air application with a computer specific activation process. AirLicense is the easiest way to do that.
This paper should be helpful:
The method I use will allow you encrpyt most of your source code using a key that is unique to every computer.
The initial download of my software is a simple air app that does not contain the actual program. It is more like a shell that first retreaves a list of the clients mac addresses and the user entered activation code that is created at time of purchase. This is sent to server and logged. The activation code is saved to a file client side. At the server the mac address and activation key are used to create the encryption key. The bulk of the program code is then encrypted using that key, then divided into parts and sent back to the client.
The client puts the parts back together and saves the encrypted file.
Next I use this code to load the program
var loader = air.HTMLLoader.createRootWindow(true, options, true, windowBounds);
This method makes it very difficult to copy to another computer although since I wrote it i know there are some weeknesses in the security but to make it harder i obv. the shell code. It at least keeps most from pirating.
However there are issues with this that I have found.
First i was using networkInfo to get the list of mac address but this failed in a test windows XP computer. When the wireless was off it did not return the MAC. I was not able to recreate this in VISTA or 7. Not sure if it could happen. Was not tested on a mac computer. To fix this (at least for windows). I wrote a simple bat file that gets the MAC list, then converted it to an exe which is included. This does force you to create native installers. call the exe with this
var nativeProcessStartupInfo = new air.NativeProcessStartupInfo();
var file = air.File.applicationDirectory.resolvePath("findmac.exe");
nativeProcessStartupInfo.executable = file;
process = new air.NativeProcess();
put the list together in the onOutputData event using array.push
and continue on the onExit event
using the findmac.exe will return the same info every time (that i know of)
beware thought that using the native install will break the standard application update process so you will have to write your own. my updates are processed the same way as above.
This is contents of the .bat file to get the mac list
FOR /F "Tokens=1-2 Delims=:" %%a in ('ipconfig /all^| FIND "Physical Address"') do @echo %%b
using this method makes it simple to implement at try before you by method. at runtime if no activation code get try me version from server instead of full version.
one last note.
I found that one time the findmac.exe returned the exact same list only in a different order, so keep that in mind.
Excellent information. Could you explain in more detail your method? Or give a detailed description or sample code?