diff --git a/src/main/java/com/cryptlex/lexactivator/LexActivator.java b/src/main/java/com/cryptlex/lexactivator/LexActivator.java index b150a2f..caab6ff 100644 --- a/src/main/java/com/cryptlex/lexactivator/LexActivator.java +++ b/src/main/java/com/cryptlex/lexactivator/LexActivator.java @@ -1378,6 +1378,24 @@ public static int GetServerSyncGracePeriodExpiryDate() throws LexActivatorExcept } } + /** + * Gets the error code that caused the activation data to be cleared. + * + * @return Returns the error code that caused the activation data to be cleared. + * @throws LexActivatorException + */ + public static int GetLastActivationError() throws LexActivatorException { + int status; + IntByReference errorCode = new IntByReference(0); + status = LexActivatorNative.GetLastActivationError(errorCode); + switch (status) { + case LA_OK: + return errorCode.getValue(); + default: + throw new LexActivatorException(status); + } + } + /** * Gets the trial activation metadata. * diff --git a/src/main/java/com/cryptlex/lexactivator/LexActivatorNative.java b/src/main/java/com/cryptlex/lexactivator/LexActivatorNative.java index 6154ada..3a6bb58 100644 --- a/src/main/java/com/cryptlex/lexactivator/LexActivatorNative.java +++ b/src/main/java/com/cryptlex/lexactivator/LexActivatorNative.java @@ -221,6 +221,8 @@ public interface ReleaseUpdateCallbackTypeA extends Callback { public static native int GetServerSyncGracePeriodExpiryDate(IntByReference expiryDate); + public static native int GetLastActivationError(IntByReference errorCode); + public static native int GetTrialActivationMetadata(String key, ByteBuffer value, int length); public static native int GetTrialActivationMetadata(WString key, CharBuffer value, int length);