From 2ac8b5e16083a022a080ca44373b2a93e9935af1 Mon Sep 17 00:00:00 2001 From: Huzaif Mushtaq Mir Date: Wed, 14 Jan 2026 15:01:20 +0530 Subject: [PATCH 1/4] chore: update LICENSE --- LICENSE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE b/LICENSE index 8dc514c..de73e0e 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2023 Cryptlex +Copyright (c) 2026 Cryptlex Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal From faa2b110da2261097ba9b42a73956f00e10e60d6 Mon Sep 17 00:00:00 2001 From: Huzaif Mushtaq Mir Date: Wed, 14 Jan 2026 15:02:08 +0530 Subject: [PATCH 2/4] chore: bump la version --- build.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.rs b/build.rs index 69b454d..e2d1428 100644 --- a/build.rs +++ b/build.rs @@ -20,7 +20,7 @@ fn download_and_setup_libs() -> Result<(), Box> { fs::create_dir_all(&libs_dir)?; } - let version = "v3.35.1"; + let version = "v3.38.0"; let base_url = "https://dl.cryptlex.com/downloads"; // Determine which library to download based on target From b0a06af625886d2218a7179d80314dffaf76581f Mon Sep 17 00:00:00 2001 From: Huzaif Mushtaq Mir Date: Wed, 14 Jan 2026 15:02:59 +0530 Subject: [PATCH 3/4] feat: add migrate_to_system_wide_activation --- src/extern_functions.rs | 1 + src/lib.rs | 25 +++++++++++++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/src/extern_functions.rs b/src/extern_functions.rs index bcec7d3..08c2efb 100644 --- a/src/extern_functions.rs +++ b/src/extern_functions.rs @@ -119,5 +119,6 @@ extern "C" { pub fn IncrementActivationMeterAttributeUses(name: cstrtype!(), increment: c_uint) -> c_int; pub fn DecrementActivationMeterAttributeUses(name: cstrtype!(), decrement: c_uint) -> c_int; pub fn ResetActivationMeterAttributeUses(name: cstrtype!()) -> c_int; + pub fn MigrateToSystemWideActivation(oldPermissionFlag: c_uint) -> c_int; pub fn Reset() -> c_int; } \ No newline at end of file diff --git a/src/lib.rs b/src/lib.rs index 3ddabc8..63195de 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -2306,6 +2306,30 @@ pub fn reset_activation_meter_attribute_uses(name: String) -> Result<(), LexActi } } +/// Migrates existing license data to system-wide storage. +/// +/// Call this function after set_product_data(). +/// +/// If you intend to use a custom data directory after migration, set it first using set_data_directory(). +/// +/// # Arguments +/// +/// * `old_permission_flag` - permission flag used previously +/// +/// # Returns +/// +/// Returns `Ok(LexActivatorStatus)` with the status code `LexActivatorStatus::LA_OK` if migration succeeds , If an error occurs, an `Err` containing the `LexActivatorError`is returned. + +pub fn migrate_to_system_wide_activation(old_permission_flag: PermissionFlags) -> Result { + let c_old_permission_flag: c_uint = old_permission_flag as c_uint; + let status = unsafe { MigrateToSystemWideActivation(c_old_permission_flag) }; + if status == 0 { + Ok(LexActivatorStatus::LA_OK) + } else { + return Err(LexActivatorError::from(status)); + } +} + /// Resets the activation and trial data stored in the machine. /// /// This function is meant for developer testing only. @@ -2322,5 +2346,6 @@ pub fn reset() -> Result<(), LexActivatorError> { Ok(()) } else { return Err(LexActivatorError::from(status)); + } } From b0ab193ba396fed9bc359d4acfc7aa6278da3d54 Mon Sep 17 00:00:00 2001 From: Huzaif Mushtaq Mir Date: Wed, 14 Jan 2026 15:33:56 +0530 Subject: [PATCH 4/4] chore: doc corrections --- src/lib.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 63195de..5db1988 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -2318,7 +2318,7 @@ pub fn reset_activation_meter_attribute_uses(name: String) -> Result<(), LexActi /// /// # Returns /// -/// Returns `Ok(LexActivatorStatus)` with the status code `LexActivatorStatus::LA_OK` if migration succeeds , If an error occurs, an `Err` containing the `LexActivatorError`is returned. +/// Returns `Ok(LexActivatorStatus)` with the status code `LexActivatorStatus::LA_OK` if migration succeeds, If an error occurs, an `Err` containing the `LexActivatorError`is returned. pub fn migrate_to_system_wide_activation(old_permission_flag: PermissionFlags) -> Result { let c_old_permission_flag: c_uint = old_permission_flag as c_uint; @@ -2346,6 +2346,5 @@ pub fn reset() -> Result<(), LexActivatorError> { Ok(()) } else { return Err(LexActivatorError::from(status)); - } }