From 2831ee749a4cdb63a088a45833c4eec2b4e8e6b3 Mon Sep 17 00:00:00 2001 From: Huzaif Mushtaq Mir Date: Mon, 6 Apr 2026 15:55:29 +0530 Subject: [PATCH 1/3] chore: add synchronous syncs --- .../cryptlex/lexactivator/LexActivator.java | 52 +++++++++++++++++++ .../lexactivator/LexActivatorNative.java | 4 ++ 2 files changed, 56 insertions(+) diff --git a/src/main/java/com/cryptlex/lexactivator/LexActivator.java b/src/main/java/com/cryptlex/lexactivator/LexActivator.java index f2eff46..91aa245 100644 --- a/src/main/java/com/cryptlex/lexactivator/LexActivator.java +++ b/src/main/java/com/cryptlex/lexactivator/LexActivator.java @@ -1865,6 +1865,33 @@ public static int IsLicenseValid() throws LexActivatorException { } } + /** + * Syncs the activation data with the Cryptlex server. This function should be + * called only if the license is already activated. This is a blocking call that + * performs a one-time synchronization to refresh the local license data. Note: + * For periodic validation, use IsLicenseGenuine() instead, which schedules + * background sync at a defined interval. + * + * @return LA_OK, LA_EXPIRED, LA_SUSPENDED, LA_FAIL + * @throws LexActivatorException + */ + public static int SyncLicenseActivation() throws LexActivatorException { + int status; + status = LexActivatorNative.SyncLicenseActivation(); + switch (status) { + case LA_OK: + return LA_OK; + case LA_EXPIRED: + return LA_EXPIRED; + case LA_SUSPENDED: + return LA_SUSPENDED; + case LA_FAIL: + return LA_FAIL; + default: + throw new LexActivatorException(status); + } + } + /** * Starts the verified trial in your application by contacting the Cryptlex * servers. This function should be executed when your application starts first @@ -1889,6 +1916,31 @@ public static int ActivateTrial() throws LexActivatorException { } } + /** + * Syncs the trial activation data with the Cryptlex server. This function should + * be called only if the trial is already activated. This is a blocking call that + * performs a one-time synchronization to refresh the local trial data. Note: + * Unlike IsTrialGenuine(), which validates the trial activation locally only, this + * function forces an immediate server check. + * + * @return LA_OK, LA_TRIAL_EXPIRED, LA_FAIL + * @throws LexActivatorException + */ + public static int SyncTrialActivation() throws LexActivatorException { + int status; + status = LexActivatorNative.SyncTrialActivation(); + switch (status) { + case LA_OK: + return LA_OK; + case LA_TRIAL_EXPIRED: + return LA_TRIAL_EXPIRED; + case LA_FAIL: + return LA_FAIL; + default: + throw new LexActivatorException(status); + } + } + /** * Activates the trial using the offline activation response file. * diff --git a/src/main/java/com/cryptlex/lexactivator/LexActivatorNative.java b/src/main/java/com/cryptlex/lexactivator/LexActivatorNative.java index 5c0abf0..4e219ab 100644 --- a/src/main/java/com/cryptlex/lexactivator/LexActivatorNative.java +++ b/src/main/java/com/cryptlex/lexactivator/LexActivatorNative.java @@ -277,8 +277,12 @@ public interface ReleaseUpdateCallbackTypeA extends Callback { public static native int IsLicenseValid(); + public static native int SyncLicenseActivation(); + public static native int ActivateTrial(); + public static native int SyncTrialActivation(); + public static native int ActivateTrialOffline(String filePath); public static native int ActivateTrialOffline(WString filePath); From b3eefaa55596cb72614d4ac05ca304f3a5b50c5e Mon Sep 17 00:00:00 2001 From: Huzaif Mushtaq Mir Date: Tue, 7 Apr 2026 14:05:27 +0530 Subject: [PATCH 2/3] chore: update doc comments --- .../cryptlex/lexactivator/LexActivator.java | 23 +++++++++++-------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/src/main/java/com/cryptlex/lexactivator/LexActivator.java b/src/main/java/com/cryptlex/lexactivator/LexActivator.java index 91aa245..147de87 100644 --- a/src/main/java/com/cryptlex/lexactivator/LexActivator.java +++ b/src/main/java/com/cryptlex/lexactivator/LexActivator.java @@ -1866,11 +1866,12 @@ public static int IsLicenseValid() throws LexActivatorException { } /** - * Syncs the activation data with the Cryptlex server. This function should be - * called only if the license is already activated. This is a blocking call that - * performs a one-time synchronization to refresh the local license data. Note: - * For periodic validation, use IsLicenseGenuine() instead, which schedules - * background sync at a defined interval. + * Synchronizes the activation data with the Cryptlex servers. The license must already + * be activated when this function is called. This is a blocking call that performs a + * one-time synchronization to refresh the local license data. In most cases, rely on + * IsLicenseGenuine(), which automatically handles periodic background synchronization + * based on the configured interval. Note: Do not use this function in regular + * application flow. Use it only when an immediate synchronization is required. * * @return LA_OK, LA_EXPIRED, LA_SUSPENDED, LA_FAIL * @throws LexActivatorException @@ -1917,11 +1918,13 @@ public static int ActivateTrial() throws LexActivatorException { } /** - * Syncs the trial activation data with the Cryptlex server. This function should - * be called only if the trial is already activated. This is a blocking call that - * performs a one-time synchronization to refresh the local trial data. Note: - * Unlike IsTrialGenuine(), which validates the trial activation locally only, this - * function forces an immediate server check. + * Synchronizes the trial activation data with the Cryptlex servers . The trial must + * already be activated when this function is called. This is a blocking call that + * performs a one-time synchronization to refresh the local trial data. Unlike + * IsTrialGenuine(), which validates the trial activation locally, this function + * performs an immediate synchronization with the servers. Note: Use this + * function to immediately reflect server-side changes on the user's machine, such as + * trial extensions. * * @return LA_OK, LA_TRIAL_EXPIRED, LA_FAIL * @throws LexActivatorException From b7203fa2cbe87b37e8a2288dda4ee4a6a6eb1612 Mon Sep 17 00:00:00 2001 From: Huzaif Mushtaq Mir Date: Tue, 7 Apr 2026 15:09:29 +0530 Subject: [PATCH 3/3] chore: correction in docs --- src/main/java/com/cryptlex/lexactivator/LexActivator.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/cryptlex/lexactivator/LexActivator.java b/src/main/java/com/cryptlex/lexactivator/LexActivator.java index 147de87..aa63f66 100644 --- a/src/main/java/com/cryptlex/lexactivator/LexActivator.java +++ b/src/main/java/com/cryptlex/lexactivator/LexActivator.java @@ -1918,7 +1918,7 @@ public static int ActivateTrial() throws LexActivatorException { } /** - * Synchronizes the trial activation data with the Cryptlex servers . The trial must + * Synchronizes the trial activation data with the Cryptlex servers. The trial must * already be activated when this function is called. This is a blocking call that * performs a one-time synchronization to refresh the local trial data. Unlike * IsTrialGenuine(), which validates the trial activation locally, this function