SetProductId static method

int SetProductId({
  1. required String productId,
  2. required int flags,
})

Sets the product id of your application to productId which is mentioned on the product page in the Cryptlex dashboard.

Depending upon whether your application requires admin/root permissions to run or not, flags can have one of the following values: LA_SYSTEM, LA_USER, LA_IN_MEMORY.

This function must be called on every start of your program before any other functions are called, with the exception of SetProductFile() or SetProductData() function.

The function throws a LexActivatorException on error.

Implementation

static int SetProductId({required String productId, required int flags}) {
  int status = _lexActivatorNative.SetProductId(
    productId,
    flags,
  );
  if (LexStatusCodes.LA_OK != status) {
    throw LexActivatorException(status);
  }
  return status;
}