Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 55 additions & 0 deletions src/main/java/com/cryptlex/lexactivator/LexActivator.java
Original file line number Diff line number Diff line change
Expand Up @@ -1865,6 +1865,34 @@
}
}

/**
* 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. <b>Note: </b>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
*/
public static int SyncLicenseActivation() throws LexActivatorException {

Check warning on line 1879 in src/main/java/com/cryptlex/lexactivator/LexActivator.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Rename this method name to match the regular expression '^[a-z][a-zA-Z0-9]*$'.

See more on https://sonarcloud.io/project/issues?id=cryptlex_lexactivator-java&issues=AZ1iWv_9kZOia24L4IEZ&open=AZ1iWv_9kZOia24L4IEZ&pullRequest=61
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
Expand All @@ -1889,6 +1917,33 @@
}
}

/**
* 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. <b>Note: </b>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
*/
public static int SyncTrialActivation() throws LexActivatorException {

Check warning on line 1932 in src/main/java/com/cryptlex/lexactivator/LexActivator.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Rename this method name to match the regular expression '^[a-z][a-zA-Z0-9]*$'.

See more on https://sonarcloud.io/project/issues?id=cryptlex_lexactivator-java&issues=AZ1iWv_9kZOia24L4IEa&open=AZ1iWv_9kZOia24L4IEa&pullRequest=61
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.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -277,8 +277,12 @@

public static native int IsLicenseValid();

public static native int SyncLicenseActivation();

Check warning on line 280 in src/main/java/com/cryptlex/lexactivator/LexActivatorNative.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Rename this method name to match the regular expression '^[a-z][a-zA-Z0-9]*$'.

See more on https://sonarcloud.io/project/issues?id=cryptlex_lexactivator-java&issues=AZ1iWv8XkZOia24L4IEX&open=AZ1iWv8XkZOia24L4IEX&pullRequest=61

public static native int ActivateTrial();

public static native int SyncTrialActivation();

Check warning on line 284 in src/main/java/com/cryptlex/lexactivator/LexActivatorNative.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Rename this method name to match the regular expression '^[a-z][a-zA-Z0-9]*$'.

See more on https://sonarcloud.io/project/issues?id=cryptlex_lexactivator-java&issues=AZ1iWv8XkZOia24L4IEY&open=AZ1iWv8XkZOia24L4IEY&pullRequest=61

public static native int ActivateTrialOffline(String filePath);

public static native int ActivateTrialOffline(WString filePath);
Expand Down
Loading