diff --git a/build.gradle b/build.gradle index e246823..89ca042 100644 --- a/build.gradle +++ b/build.gradle @@ -4,7 +4,7 @@ buildscript { google() } dependencies { - classpath "com.android.tools.build:gradle:8.0.1" + classpath "com.android.tools.build:gradle:8.11.1" } } diff --git a/examples/sample/app/build.gradle b/examples/sample/app/build.gradle index 28530a7..ea8c558 100644 --- a/examples/sample/app/build.gradle +++ b/examples/sample/app/build.gradle @@ -3,6 +3,7 @@ plugins { } android { + namespace "com.cryptlex.sample" compileSdkVersion 30 buildToolsVersion "30.0.3" diff --git a/examples/sample/build.gradle b/examples/sample/build.gradle index ec19a1f..a3f040b 100644 --- a/examples/sample/build.gradle +++ b/examples/sample/build.gradle @@ -1,23 +1,18 @@ // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { repositories { + mavenLocal() google() - jcenter() + mavenCentral() } dependencies { - classpath "com.android.tools.build:gradle:4.1.3" + classpath "com.android.tools.build:gradle:8.11.1" // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files } } -allprojects { - repositories { - google() - jcenter() - } -} task clean(type: Delete) { delete rootProject.buildDir diff --git a/examples/sample/settings.gradle b/examples/sample/settings.gradle index 2edb795..ab681b5 100644 --- a/examples/sample/settings.gradle +++ b/examples/sample/settings.gradle @@ -1,2 +1,10 @@ +dependencyResolutionManagement { + repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) + repositories { + mavenLocal() + google() + mavenCentral() + } +} include ':app' rootProject.name = "sample" diff --git a/lexfloatclient/build.gradle b/lexfloatclient/build.gradle index 25494e5..e3d317d 100644 --- a/lexfloatclient/build.gradle +++ b/lexfloatclient/build.gradle @@ -34,7 +34,7 @@ android { } dependencies { - implementation 'net.java.dev.jna:jna:5.8.0' + implementation 'net.java.dev.jna:jna:5.13.0@aar' implementation 'com.fasterxml.jackson.core:jackson-databind:2.14.2' } diff --git a/lexfloatclient/src/main/java/com/cryptlex/android/lexfloatclient/LexFloatClient.java b/lexfloatclient/src/main/java/com/cryptlex/android/lexfloatclient/LexFloatClient.java index f1fdc4d..9098043 100644 --- a/lexfloatclient/src/main/java/com/cryptlex/android/lexfloatclient/LexFloatClient.java +++ b/lexfloatclient/src/main/java/com/cryptlex/android/lexfloatclient/LexFloatClient.java @@ -365,6 +365,24 @@ public static HostFeatureEntitlement GetHostFeatureEntitlement(String name) thro throw new LexFloatClientException(status); } + /** + * Gets the value of the product metadata. + * + * @param key key of the metadata field whose value you want to get + * @return Returns the metadata key value + * @throws LexFloatClientException + * @throws UnsupportedEncodingException + */ + public static String GetHostProductMetadata(String key) throws LexFloatClientException, UnsupportedEncodingException { + int status; + ByteBuffer buffer = ByteBuffer.allocate(4096); + status = LexFloatClientNative.GetHostProductMetadata(key, buffer, 4096); + if (LF_OK == status) { + return new String(buffer.array(), "UTF-8"); + } + throw new LexFloatClientException(status); + } + /** * Get the value of the license metadata field associated with the * LexFloatServer license key diff --git a/lexfloatclient/src/main/java/com/cryptlex/android/lexfloatclient/LexFloatClientNative.java b/lexfloatclient/src/main/java/com/cryptlex/android/lexfloatclient/LexFloatClientNative.java index 2ffd41b..14b895c 100644 --- a/lexfloatclient/src/main/java/com/cryptlex/android/lexfloatclient/LexFloatClientNative.java +++ b/lexfloatclient/src/main/java/com/cryptlex/android/lexfloatclient/LexFloatClientNative.java @@ -15,6 +15,7 @@ public class LexFloatClientNative implements Library { static { + System.setProperty("jna.nosys", "true"); Native.register(LexFloatClientNative.class,"LexFloatClient"); } @@ -52,6 +53,8 @@ public interface CallbackType extends Callback { public static native int GetHostFeatureEntitlementInternal(String featureName, ByteBuffer featureEntitlementJson, int length); + public static native int GetHostProductMetadata(String key, ByteBuffer value, int length); + public static native int GetHostLicenseMetadata(String key, ByteBuffer value, int length); public static native int GetHostLicenseMeterAttribute(String name, LongByReference allowedUses, LongByReference totalUses, LongByReference grossUses);