问题描述:

I am starting with my first application development. So far I have worked only with Html, css, js, jquery etc..

I want to create an app like the desktop gmail notifier which pings the server at regular interval, look for any messages and notifies the user. I read that Adobe Air and flex are the tools that can be used for this. I have developed the basic prototype in adobe air by studying the tutorials in net.

But the problem is that, my client doesn't want the source code to be made available to users. With air, you can see the complete source code after installation/unzipping the .air app.

Is there any way I can protect the source code? Or should I use flex and convert it to a swf? Is the source codes are protected in flex? I am not familiar with the flash action scripting. Please advice.

网友答案:

I think you are confused as to what Flex is. It is an SDK that is a level below the AIR and Flash SDKs. Flex is a secondary structural language that is meant to be used in conjunction with AS3, while AIR is compile-type.

It doesn't matter how you compile this, the source code will be attainable if someone really wants to get it. If you compile as an AIR app, you can unzip and get the SWF file. If you compile as a SWF, you already have that SWF. The SWF can then be decompiled using various tools.

There is no real way to hide front end code from prying eyes. Flash is definitely harder to read than HTML or CSS or Javascript, but definitely not impossible to view regardless of how you compile. Your best bet is definitely to offload as much as possible to a server and possibly obfuscate your code.

I would definitely try to explain to your client that it is simply not possible to truly hide source code from individuals who would like to access it. If someone really wants to steal the code, they can and will.

网友答案:

Code cannot be hided in any front end technologies, Flash (SWF, Flex or AIR) or HTML (JavaScript). Do all the business logic at server and authentic properly for securing your data.

And AIR and Flash Player are both runtimes which play applications written in Adobe Flash or Apache Flex.

网友答案:

You can use a client-server implementation to hide the logic from the user and flex would just render a UI based on the business logic from the server side code(php,java or .NET) that interacts with the gmail servers

网友答案:

If you want proper notifications, go with AIR - access to some system-level features like toast notifications. With Flex, you'll be limited to webpage content.
About code protection - you can develop app in ActionScript and then protect compiled SWF with obfuscator for some fair defense, although there's probably no good free obfuscators. I paid some bucks for secureSWF license and consider it a good investment. Of course, determined hacker would crack app anyway (in theory,) but I would'nt worry about this too much for a simple pinger app.

相关阅读:
Top