Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: setcachemode function #29

Merged
merged 1 commit into from
May 23, 2024
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
2 changes: 1 addition & 1 deletion download-libs.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash
set -e
VERSION="v3.26.1";
VERSION="v3.28.0";
curl -O -L https://dl.cryptlex.com/downloads/${VERSION}/LexActivator-Android.zip
unzip LexActivator-Android.zip -d ./android
cp ./android/libs/clang/arm64-v8a/libLexActivator.so lexactivator/src/main/jniLibs/arm64-v8a
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,27 @@ public static void SetDebugMode(int enable) throws LexActivatorException {
}
}

/**
* Enables or disables in-memory caching for LexActivator.
*
* This function is designed to control caching behavior to suit specific application requirements.
* Caching is enabled by default to enhance performance.
*
* Disabling caching is recommended in environments where multiple processes access the same license on a
* single machine and require real-time updates to the license state.
*
* @param enable true or false to enable or disable in-memory caching.
* @throws LexActivatorException
*/

public static void SetCacheMode(boolean enable) throws LexActivatorException {
int status;
status = LexActivatorNative.SetCacheMode(enable ? 1 : 0);
if (LA_OK != status) {
throw new LexActivatorException(status);
}
}

/**
* In case you don't want to use the LexActivator's advanced
* device fingerprinting algorithm, this function can be used to set a custom
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ public interface ReleaseUpdateCallbackType extends Callback {

public static native int SetDebugMode(int enable);

public static native int SetCacheMode(int enable);

public static native int SetCustomDeviceFingerprint(String fingerprint);

public static native int SetLicenseKey(String licenseKey);
Expand Down
Loading