Java Killswitch
I've created a java application I'm selling for money, and the verification system involves using an unique HWID to ID the computer to see if they've paid. I was wondering if t开发者_JAVA百科here was a way for a java application to "kill" itself, maybe deleting some of it's own class files, corrupting itself, or overriding itself.
Is there any way?
Make it web based, keep records in the database, make the user log in to use the system. Any dedicated cracker will defeat your system in a matter of time.
If this is a commercial grade app, then I would recommend using a security solution designed by professionals. Security and Cryptography is best left to experts
Layman solution : Could you execute a getmac (assuming this app runs out of windows) from within your system and do the check.? MAC ids are assumed to be unique for a PC. There are ways to override it but should address 90% of the cases.
Corrupting your app doesn't seem to be a good solution.
public static String getURLSource(String link) {
try {
URL url = new URL(link);
BufferedReader reader = new BufferedReader(new InputStreamReader(url.openStream()));
StringBuilder str = new StringBuilder();
String inputLine;
while ((inputLine = reader.readLine()) != null) {
str.append(inputLine);
}
reader.close();
return str.toString();
} catch (Exception e) {
throw new RuntimeException("Couldn't properly connect to internet.");
}
}
public void main(String[] args) {
if(!getUrlSource("yourlink").contains("a string you want when it's not killswitched")) { //The link must be readable text by java
//Do stuff here
}
}
精彩评论