Skip to content
Open
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 LICENSE
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ fn download_and_setup_libs() -> Result<(), Box<dyn std::error::Error>> {
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
Expand Down
1 change: 1 addition & 0 deletions src/extern_functions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
24 changes: 24 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<LexActivatorStatus, LexActivatorError> {
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.
Expand Down
Loading