简体   繁体   English

如何使用代码保护我的Flash / Flex SWF?

[英]How do I protect my Flash/Flex SWF with code?

I've written some fancy Flex app, which doesn't really require any server side integration. 我写了一些花哨的Flex应用程序,它并不需要任何服务器端集成。

Now if someone took that SWF and put it in their server then it will very well run. 现在,如果有人拿走了SWF并将其放入他们的服务器中,那么它将很好地运行。

What code can recognize that the SWF is not under my domain and stop from execution during startup? 哪些代码可以识别SWF不在我的域下并在启动期间停止执行? I don't mind making some server side calls just to do a check. 我不介意做一些服务器端调用只是为了检查。 But how can this be achieved? 但是如何实现呢?

Check out loaderinfo.url , it can do this for you. 查看loaderinfo.url ,它可以为您完成此操作。 Here's an example on how it can be used to determine where the SWF is being loaded from. 下面是一个示例,说明如何使用它来确定SWF的加载位置。

So, you could detect where the swf is loading from, and if it's not from your server, block out the good stuff. 因此,您可以检测swf的加载位置,如果不是来自您的服务器,则阻止好的东西。 :) :)

Good luck 祝好运

Why don't you just watermark your app? 你为什么不给你的应用添加水印? But I think if someone steals your app, he would hack it too, to remove any protection. 但我认为如果有人窃取你的应用程序,他也会破解它,删除任何保护。

As has been mentioned the bottom line is anything you can put in, the baddie can rip right out, so all that you can really do is make the amount of work necessary to do this an obstacle to anyone even trying. 正如已经提到的那样,底线是你可以放入的任何东西,坏人可以直接撕掉,所以你真正能做的就是让这样做所需的工作量成为任何人甚至尝试的障碍。 What has been suggested so far would at least deter the casual thief and maybe that's enough. 到目前为止所建议的至少会阻止随便的小偷,也许这就足够了。

The way I found around it was to actually have quite a tight integration with server-side data, such that even if you removed all of that integration (which would most likely take you days ... it's a big app) you would still have no data at all with which to use it. 我发现它的方式实际上是与服务器端数据进行了非常紧密的集成,这样即使你删除了所有的集成(这很可能会花费你几天......这是一个很大的应用程序)你仍然会有没有任何数据可供使用它。 This obviously depends quite a lot on what your app is doing in the first place, but if you make an architectural decision to move any data over to the server side that will increase your protection. 这显然在很大程度上取决于您的应用程序首先在做什么,但如果您做出架构决策,将任何数据移动到服务器端,这将增加您的保护。

(This should really be a comment rather than an answer, but posting here due to length.) (这应该是一个评论而不是一个答案,但由于篇幅而在这里发帖。)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM