3 Replies Latest reply on May 4, 2008 7:14 PM by Dr. Fred Mbogo

    .air is just a ZIP file?

      So the adt application just zips up your root directory and adds a META-INF folder? I had long been under the assumption that it was a binary file or at least some sort of proprietary format. I must have missed this in the documentation, but I think I needs to be stated somewhere for developers that their source code is wide open when developing in AIR. That's my 2 cents though.
        • 1. .air is just a ZIP file?
          Dr. Fred Mbogo Level 1
          I guess you're referring to the fact that you can extract the .swf file from the .air file and then "decompile" it? The resulting ActionScript code is fairly readable; one could wish for better obfuscation, but there's only so much you can do with a dynamic language like ActionScript. Public functions can't be renamed, for example, because the compiler can't really know who all can call them. Consider:

          function foo():void { ... }
          function bar():void { eval('fo' + 'o' + '()'); }

          You can't expect the compiler to realize that bar() calls foo() in this instance, so foo has to keep its current name.

          This is the same problem faced by Javascript minifiers like JSmin and ShrinkSafe. They do their best, but most of the minification comes from squishing out whitespace and comments, and renaming local variables. Whitespace can be recovered algorithmically, and the ActionScript compiler does obfuscate local variable names when it can, and strips all comments.

          If you have to have "secret sauce", it's probably best to put it on the server side, if possible.

          Where you have code you want to protect that has to be on the client side, there's still copyright law. If someone steals your code and puts it into their AIR app, turnabout should give you an airtight case: decompile the thief's app and find your code in it.
          • 2. Re: .air is just a ZIP file?
            wafflesnatcha Level 1
            Well you're under the assumption that the project was done in flash. What about our plain javascript and html projects?
            • 3. Re: .air is just a ZIP file?
              Dr. Fred Mbogo Level 1
              Actually, I'm a Flex guy...but yes, same deal.

              Not that the difference matters. As I said above, the same obfuscation limitations that apply to ActionScript also affect JavaScript. And as for HTML, well, that's nearly unobfuscatable.

              But ask yourself: is it really such a huge problem? As I said above, copyright law protects you from outright theft. As for people grabbing ideas, that one works both ways. It's been argued that one of the biggest reasons for the success of the Web is View Source. Everyone steals ideas from everyone else, spreading the good ones faster than if everything were hidden.