From 334e2cc7fc9b1b7143183eae60548c74ae3a3684 Mon Sep 17 00:00:00 2001 From: mir-huzaif Date: Wed, 30 Jul 2025 11:07:36 +0530 Subject: [PATCH 1/5] fix: forcing bundled JNA to be used --- .../cryptlex/android/lexfloatclient/LexFloatClientNative.java | 1 + 1 file changed, 1 insertion(+) 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..993ac78 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"); } From 1759b9eae9eabc5d7145408d457e8eee5be64a70 Mon Sep 17 00:00:00 2001 From: mir-huzaif Date: Wed, 30 Jul 2025 11:10:24 +0530 Subject: [PATCH 2/5] feat: adding GetHostProductMetadata --- .../lexfloatclient/LexFloatClient.java | 19 +++++++++++++++++++ .../lexfloatclient/LexFloatClientNative.java | 2 ++ 2 files changed, 21 insertions(+) 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..5af206b 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,25 @@ public static HostFeatureEntitlement GetHostFeatureEntitlement(String name) thro throw new LexFloatClientException(status); } + /** + * Gets the value of the product metadata field associated with the + * prodcut metadata key + * + * @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 993ac78..14b895c 100644 --- a/lexfloatclient/src/main/java/com/cryptlex/android/lexfloatclient/LexFloatClientNative.java +++ b/lexfloatclient/src/main/java/com/cryptlex/android/lexfloatclient/LexFloatClientNative.java @@ -53,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); From dfbc934098f80f0b1a149de8cfa0d6ac0aa1fd40 Mon Sep 17 00:00:00 2001 From: mir-huzaif Date: Thu, 31 Jul 2025 15:08:18 +0530 Subject: [PATCH 3/5] chore: modified GetHostProductMetadata JavaDoc --- .../com/cryptlex/android/lexfloatclient/LexFloatClient.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) 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 5af206b..9098043 100644 --- a/lexfloatclient/src/main/java/com/cryptlex/android/lexfloatclient/LexFloatClient.java +++ b/lexfloatclient/src/main/java/com/cryptlex/android/lexfloatclient/LexFloatClient.java @@ -366,8 +366,7 @@ public static HostFeatureEntitlement GetHostFeatureEntitlement(String name) thro } /** - * Gets the value of the product metadata field associated with the - * prodcut metadata key + * 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 From 3c7a5f734f098e4dde54b59a8607179940f6adc0 Mon Sep 17 00:00:00 2001 From: mir-huzaif Date: Thu, 31 Jul 2025 15:31:18 +0530 Subject: [PATCH 4/5] chore: updated sample dependencies and dependency resolution management --- examples/sample/app/build.gradle | 1 + examples/sample/build.gradle | 11 +++-------- examples/sample/settings.gradle | 8 ++++++++ 3 files changed, 12 insertions(+), 8 deletions(-) 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" From ecbb2da47a074011a6ec925a5d884cd265e0e175 Mon Sep 17 00:00:00 2001 From: mir-huzaif Date: Thu, 31 Jul 2025 17:11:59 +0530 Subject: [PATCH 5/5] chore: updated dependencies --- build.gradle | 2 +- lexfloatclient/build.gradle | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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/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' }