如何复制保护我的 Java 应用程序?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/3647255/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How do I copy-protect my Java application?
提问by cragiz
I want to sell my Java application using PayPal. When a payment is received, the customer is mailed a one-time download link to my application.
我想使用 PayPal 出售我的 Java 应用程序。收到付款后,客户会收到我的应用程序的一次性下载链接。
My question is, how do I prevent people from sending the .jar file to their friends/uploading it on the internet?
我的问题是,如何防止人们将 .jar 文件发送给他们的朋友/将其上传到互联网上?
Obviously I need some kind of check in the application which only allows it to run on one computer. And that's another problem, I don't want a customer to have limitations on one computer, they should be able to run it at home and work etc.
显然我需要在应用程序中进行某种检查,它只允许它在一台计算机上运行。这是另一个问题,我不希望客户对一台计算机有限制,他们应该能够在家里和工作中运行它等等。
Maybe some kind of cd-key would do the trick? Is there any cd-key resources for Java out there? Or should i build my own algorithm? Here comes yet another problem, reverse engineering..
也许某种 cd-key 可以解决问题?是否有任何用于 Java 的 cd-key 资源?还是我应该建立自己的算法?这里又出现了一个问题,逆向工程..
Please help me solve this :)
请帮我解决这个问题:)
采纳答案by Michael Petrotta
The most common way to handle this is: customer gives you money, you generate a unique unlock key and provide that to the customer. The key should be a valid unlock key, and it should encode identification information about the user. Customer uses that key to install on as many of their computers as they like, or is allowed by the license.
最常见的处理方法是:客户给你钱,你生成一个唯一的解锁密钥并将其提供给客户。密钥应该是有效的解锁密钥,并且应该对用户的身份信息进行编码。客户可以使用该密钥在他们喜欢的任意数量的计算机上进行安装,或者在许可证允许的情况下进行安装。
Don't worry about reverse-engineering. Your product, if it's at all popular, will be pirated - you'll find unlock keys online if you look hard enough. If you like, you can take that as a compliment - someone liked your software enough to steal it. Cold comfort, I know, but the alternative is to get in an arms race with the pirates, and you won't win that. In the end, a few percent of the population will steal software, and you can't do much about that. You canuse the key's identification information, if your scheme is strong enough, to trace who released the key in the first place.
不要担心逆向工程。你的产品,如果它很受欢迎,就会被盗版——如果你仔细看的话,你会在网上找到解锁钥匙。如果您愿意,您可以将其视为一种赞美 - 有人喜欢您的软件足以窃取它。冰冷的安慰,我知道,但另一种选择是与海盗进行军备竞赛,你赢不了。最终,百分之几的人会窃取软件,而您对此无能为力。如果您的方案足够强大,您可以使用密钥的标识信息来追踪是谁首先发布了密钥。
回答by cragiz
You must implement licensing capabilities.
您必须实现许可功能。
Here is one interesting resource as a starter: http://members.chello.at/stefan-schneider/JavaLicenseKit.html
这是作为初学者的一个有趣的资源:http: //members.chello.at/stefan-schneider/JavaLicenseKit.html
回答by Paul Gregtheitroade
Everyone has their own opinion on this subject so expect lots of different advice. Here's my take on it:
每个人对这个问题都有自己的看法,所以期待很多不同的建议。这是我的看法:
- 1. Obfuscate your code (proguard is recommended)
- 2. Offer a FREE version with full capabilities for a trial period
- 3. Use a serial number routine based on the registering users email or other unique info
- 1.混淆你的代码(建议使用proguard)
- 2. 在试用期内提供具有完整功能的免费版本
- 3.使用基于注册用户电子邮件或其他独特信息的序列号例程
Overall you will have to accept a certain amount of piracy, but if your application is worthy people will pay for it. Honest people will be honest and copy protection will not make dishonest people honest.
总体而言,您将不得不接受一定程度的盗版,但如果您的应用程序值得,人们会为此付费。诚实的人会诚实,版权保护不会让不诚实的人变得诚实。
回答by Thorbj?rn Ravn Andersen
In my opinion, if you don't know exactly how you will protect your source code efficiently, then don't start trying to hash something together yourself based on hardware. It will be too easy to break, and most likely just annoy your customers.
在我看来,如果您不确切知道如何有效地保护源代码,那么不要开始尝试根据硬件自己将某些东西散列在一起。它太容易损坏,而且很可能只会惹恼您的客户。
I would sugest you have a look at how Atlassian does this. They happen to sell Java software, and apparently do quite well. http://www.atlassian.com/Try downloading e.g. JIRA and play with an installation. This will give you a good idea of how their licensing scheme works, and what users can reasonably expect from professional software.
我建议你看看 Atlassian 如何做到这一点。他们碰巧销售 Java 软件,而且显然做得很好。 http://www.atlassian.com/尝试下载例如 JIRA 并进行安装。这将使您很好地了解他们的许可方案是如何工作的,以及用户可以从专业软件中合理地期待什么。
回答by Cyril Gupta
Actually there are a number of license management solutions that can help, but the REAL problem is that all of they can be cracked. I've personally tried the most expensive to the cheapest. Finally I rolled my own, and I check the software's pc details (mac id, etc.) against the recorded details in my server every time the software is run. Because my software is tightly tied to the Internet, it is okay, but I am sure it will be cracked one of these days.
实际上有许多许可证管理解决方案可以提供帮助,但真正的问题是它们都可以破解。我个人试过最贵到最便宜的。最后我自己动手,每次运行软件时,我都会根据服务器中记录的详细信息检查软件的 pc 详细信息(mac id 等)。因为我的软件与互联网紧密相连,所以没关系,但我相信这几天会被破解。
What you probably need is to police the Internet regularly, and find where your software is being pirated, contrary to the popular belief you can actually stop them in most cases. Just serve a DMCA to the downloading website (most of them will comply), and you will be able to get your software removed in about 80% of the cases. I've done and experienced it on my software. Some people do not remove, but I've found that in the 1.5 years I've been doing this, my sales have improved.
您可能需要的是定期对 Internet 进行监管,并找出您的软件被盗版的地方,这与在大多数情况下您实际上可以阻止它们的普遍看法相反。只需向下载网站提供 DMCA(大多数都会遵守),您就可以在大约 80% 的情况下删除您的软件。我已经在我的软件上完成并体验了它。有些人不删除,但我发现在我这样做的 1.5 年中,我的销售额有所提高。
I also use a service -- http://spotpiracy.comwhich helps me find these links apart from my own manual research (i have a guy dedicated to this). :)
我还使用了一项服务——http://spotpiracy.com,它可以帮助我找到这些链接,而不是我自己的手动研究(我有一个专门从事此工作的人)。:)
回答by christian
In my old c++ days i get in arms to front the piracy using MAC Address code protection, very nice and really no body stole my software uppone the mac address protection because i always force the OS to re-read the real mac avoiding mac overrides. That was on C++ coding having direct access to local resources.
在我过去的 C++ 时代,我使用 MAC 地址代码保护来对抗盗版,非常好,实际上没有人偷我的软件来保护 mac 地址,因为我总是强迫操作系统重新读取真正的 mac 以避免 mac 覆盖。那是关于可以直接访问本地资源的 C++ 编码。
thats not the case today, nither in java applications in which the code is located in .class files that can always being decoded back to the original source code (yes it is possible, and very easy to find tools to do so).
今天不是这样,在代码位于 .class 文件中的 Java 应用程序中,这些文件总是可以被解码回原始源代码(是的,这是可能的,而且很容易找到这样做的工具)。
i think, as resume, it is impossible to protect java programs agains piracy. i find no way like the old golden c++ days :)
我认为,作为简历,保护java程序免受盗版是不可能的。我发现不像旧的金色 C++ 时代 :)