Protect my java application from being copied
How do I stop someone from copying and duplicating the application开发者_如何学C i am making in java ? I am using mysql as back-end for my application and the platform is Linux. Is there a way to provide this security ?
EDIT :
Is there a way like in windows where some applications even if we copy the folder and past it into other system it wont work. I don't know how they are doing it. Is there any similar thing that I can do here ?
Alright, here is an alternate answer to my comment.
- Don't sell software, sell support.
- Implement a simple licensing system tied to an email address.
- Only provide support for users with registered email addresses.
For tips on creating that, see Software Licensing System at the OTN. The solutions shown there are crackable, but not by the casual end user.
There is really nothing you can do to stop piracy, as a user must be able to run code on their computer. Some companies have used hardware tokens, but this is expensive for a small developer.
A small step would be to only deliver the class files, and possibly run them through an obfuscator.
Here in an example obfuscater.
http://proguard.sourceforge.net/
Here is a good page on securing java code.
http://www.cs.arizona.edu/~collberg/Research/Students/DouglasLow/obfuscation.html
Is your project open source? If so, then you'll want to use the appropriate licensing. If not, read up on EULAs and consult a lawyer.
There is no way we can prevent users to copy the way you have mentioned.
This is the biggest challenge that all the medium sized product based companies are facing and they are spending quite a lot of time on preventing this.
I aggree with @Milhous & @Andrew Thompson replies
There are several commercial Java licensing systems that do exactly what you need (but you should dig into the details as not all of them are actually multiplatform Java, but have just wrapped a C library).
The standard technique for preventing simple replication of an application on other machines is node-locking, where the application checks at runtime that certain system parameters match the encrypted values on its license. The MAC address is commonly used, but this is not a good choice as it can be set by admins on many systems. I'd recommend using a combination of parameters, such as login name, host name, installation directory and so forth.
The licensing process can be manual for low-volume sales, or automated for higher volume licensing. In the automated approach the license is automatically locked to its host during product activation, transparently to the user. As well as being simple and familiar for the user, modern [product activation][2] systems can both meet your goal of preventing copying, and allowing users to relocate their license to another machine if they wish (whether or not their systems have an Internet connection.
I'm in the middle of trying this myself, but maybe you can configure your program to get the mac address of the computer (that you want it to run on) on first-run. Then have it save it to the registry. Then, in your main method have it get your mac address and match it against that of the registry. (The registry tends to put forward slashes where there are spaces but removing the slashes should get you a match).
精彩评论