* my validation protocol
*
* @param args syntax : -name "full name" -license <serialnumber>
*/
private boolean validate(String... args) {
Validate jni_validateEsell = new Validate();
/**
* first the passed arguments issued from the user are parsed...
*/
for (int i = 0; i < args.length; i++) {
String arg = args[i];
if ("-name".equals(arg)) {
serialName = args[++i] != null ? args[i].replaceAll("\"", "") : "";
} else if ("-license".equals(arg)) {
serial = args[++i] != null ? args[i].replaceAll("\"", "") : "";;
}
}
/**
* ... so that the validation runtime is called with correct parameters.
* It will return a date in the format that we can read. It matches the
* purchased day or the day when the trial use will terminate.
*/
Calendar ret = jni_validateEsell.runValidateSerial(serial, serialName, "", jni_validateEsell.getPublisherKey());
if (ret != null) {
String trial = (ProductKeyValidator.isDemoMode() ? "trial until " : "licensed use. Purchased on ") + ret;
JXAenvUtils.log("provided serial " + jni_validateEsell.standardizeSerial(serial) + " for " + serialName + " is validated for " + trial, JXAenvUtils.LVL.SYS_NOT);
expiringDate.setTime(ret.getTime());
return true;
}
return false;
}