此程序可激活高级版和专业版功能,需要注意的是每次重新打开FinalShell以后都要重新激活,好消息的是上次的激活码还会在输入里,所以实际上只需要每次去点击激活按钮即可,不需要每次重新跑程序。
public class FinalShell {
public static void main(String[] args) throws Exception {
System.out.print("请输入FinalShell的离线机器码:");
Scanner reader = new Scanner(System.in);
String machineCode = reader.nextLine();
generateKey(machineCode);
}
public static void generateKey(String hardwareId) throws Exception {
String proKey = transform(61305 + hardwareId + 8552);
String pfKey = transform(2356 + hardwareId + 13593);
System.out.println("请将此行复制到离线激活中-高级版:" + proKey);
System.out.println("请将此行复制到离线激活中-专业版:" + pfKey);
}
public static String transform(String str) throws Exception {
return hashMD5(str).substring(8, 24);
}
public static String hashMD5(String str) throws Exception {
MessageDigest digest = MessageDigest.getInstance("MD5");
byte[] hashed = digest.digest(str.getBytes());
StringBuilder sb = new StringBuilder();
for (byte b : hashed) {
int len = b & 0xFF;
if (len < 16) {
sb.append("0");
}
sb.append(Integer.toHexString(len));
}
return sb.toString();
}
}