public class keygen {
private static int License_sum(int paramInt) {
int i = 0;
while (paramInt > 0) {
i += (paramInt & 0xF);
paramInt >>= 4;
} /* end of while */
return (i % 10);
} /* end of License_sum */
private static long License_GetMachineId_2(long MachineId) {
int i = (int) (MachineId & 0xFFFFFFFF);
int j = (int) (MachineId >> 32 & 0xFFFFFFFF);
int n = i + 376273029 + 287454020 & 0xFFFFFFFF;
int i1 = j - 52416167 + 1432778632 & 0x7FFFFFFF;
ByteBuffer buf = ByteBuffer.allocateDirect(8);
buf.putInt(i1);
buf.putInt(n);
buf.rewind();
return (buf.getLong());
} /* end of License_GetMachineId_2 */
private static String License_GenerateKey(long MachineId, long time) {
long l = License_GetMachineId_2(MachineId);
int t = (int) time ^ 0x56739ACD;
return String.format("%dZ%d%d", l, t, License_sum(t));
} /* end of License_GenerateKey */
public static void main(String[] args) {
long MachineId = Kx.BH();
long time = System.currentTimeMillis() / 1000L + 86400 * 365 * 3 - 86400 * 13;
String key = License_GenerateKey(MachineId, time);
System.out.println("License key : " + key);
} /* end of main */
}