@@ -164,14 +164,15 @@ def deactivate(token, product_id, key, machine_code, floating = False):
164164class Helpers :
165165
166166 @staticmethod
167- def GetMachineCode ():
167+ def GetMachineCode (v = 1 ):
168168
169169 """
170- Get a unique identifier for this device.
170+ Get a unique identifier for this device. If you want the machine code to be the same in .NET on Windows, you
171+ can set v=2. More information is available here: https://help.cryptolens.io/faq/index#machine-code-generation
171172 """
172173
173174 if "windows" in platform .platform ().lower ():
174- return HelperMethods .get_SHA256 (HelperMethods .start_process (["cmd.exe" , "/C" , "wmic" ,"csproduct" , "get" , "uuid" ]))
175+ return HelperMethods .get_SHA256 (HelperMethods .start_process (["cmd.exe" , "/C" , "wmic" ,"csproduct" , "get" , "uuid" ], v ))
175176 elif "mac" in platform .platform ().lower () or "darwin" in platform .platform ().lower ():
176177 res = HelperMethods .start_process (["system_profiler" ,"SPHardwareDataType" ])
177178 return HelperMethods .get_SHA256 (res [res .index ("UUID" ):].strip ())
@@ -181,13 +182,14 @@ def GetMachineCode():
181182 return HelperMethods .get_SHA256 (HelperMethods .compute_machine_code ())
182183
183184 @staticmethod
184- def IsOnRightMachine (license_key , is_floating_license = False , allow_overdraft = False ):
185+ def IsOnRightMachine (license_key , is_floating_license = False , allow_overdraft = False , v = 1 ):
185186
186187 """
187188 Check if the device is registered with the license key.
189+ The version parameter is related to the one in GetMachineCode method.
188190 """
189191
190- current_mid = Helpers .GetMachineCode ()
192+ current_mid = Helpers .GetMachineCode (v )
191193
192194 if license_key .activated_machines == None :
193195 return False
0 commit comments