Coder Social home page Coder Social logo

cryptolens / cryptolens-python Goto Github PK

View Code? Open in Web Editor NEW
182.0 15.0 34.0 135 KB

Cryptolens Client API for Python

Home Page: https://cryptolens.io/support-cycle/

License: MIT License

Python 98.80% Makefile 0.52% Batchfile 0.68%
licensing-as-a-service licensing-library python license-checking offline-licensing

cryptolens-python's People

Contributors

artemlos avatar biancode avatar copterspace avatar dhawal-bajaj avatar svedi avatar synominit avatar whattheserver avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cryptolens-python's Issues

The license does not work: The signature check failed.

Im getting this error "The license does not work: The signature check failed." I dont know why this is my code please help

from licensing.models import *
from licensing.methods import Key, Helpers
import requests
import ssl

# WyI1MjY3NDUiLCJlS3NUQjkxTkk1TWhyS3dnVGdKaDZkM0VpcnRLZmtjRVFxMGlmem5YIl0=

# fixes SSL cerift errors
try:
    _create_unverified_https_context = ssl._create_unverified_context
except AttributeError:
    # Legacy Python that doesn't verify HTTPS certificates by default
    pass
else:
    # Handle target environment that doesn't support HTTPS verification
    ssl._create_default_https_context = _create_unverified_https_context

RSAPubKey = "<RSAKeyValue><Modulus>sGbvxwdlDbqFXOMlVUnAF5ew0t0WpPW7rFpI5jHQOFkht/326dvh7t74RYeMpjy357NljouhpTLA3a6idnn4j6c3jmPWBkjZndGsPL4Bqm+fwE48nKpGPjkj4q/yzT4tHXBTyvaBjA8bVoCTnu+LiC4XEaLZRThGzIn5KQXKCigg6tQRy0GXE13XYFVz/x1mjFbT9/7dS8p85n8BuwlY5JvuBIQkKhuCNFfrUxBWyu87CFnXWjIupCD2VO/GbxaCvzrRjLZjAngLCMtZbYBALksqGPgTUN7ZM24XbPWyLtKPaXF2i4XRR9u6eTj5BfnLbKAU5PIVfjIS+vNYYogteQ==</Modulus><Exponent>AQAB</Exponent></RSAKeyValue>"
auth = "WyI1MjY3NDUiLCJlS3NUQjkxTkk1TWhyS3dnVGdKaDZkM0VpcnRLZmtjRVFxMGlmem5YIl0="

result = Key.activate(token=auth,\
                    rsa_pub_key=RSAPubKey,\
                    product_id=9897, \
                    key="DWWNR-LFKUO-VMRVX-PLYNI",\
                    machine_code=Helpers.GetMachineCode())

if result[0] == None or not Helpers.IsOnRightMachine(result[0]):
    # an error occurred or the key is invalid or it cannot be activated
    # (eg. the limit of activated devices was achieved)
    print("The license does not work: {0}".format(result[1]))
    exit()
else:
    # everything went fine if we are here!
    print("The license is valid!")
    license_key = result[0]
    print("Feature 1: " + str(license_key.f1))
    print("License expires: " + str(license_key.expires))

MachineCode changing after reboot

Hi,
I have a RasperryPi wiith OpenWRT OS, and I notice that at each reboot Helpers.GetMachineCode() changes,
making it impossible to limit licenses to a certain numbers of machines.

Unable to authenticate

I been trying to implement the Payment Form from the help page you provide so I used the article about the method of Generating a Key and I followed all the steps in the help page , however when I try to go the the link provided by the acces token the message displayed is {"result":1,"message":"Unable to authenticate."} . I tried to replace the message token={access token with CreateKey permission} from the link generased with the token created for this payement also but that didn't change anything.

when I run the stripe method with the message that heps to recevieve the key the message after the paiement, the result message is " Thank you for ordering Software Protector! Your key is [key] , [Key]" (I havn't any key and I tried the K from Key in upper and lower case) and at the same time in the product no key been created, however I recevie the payement and the email messages both from stripe and cryptolens.

Would it be possible to help me solve this issue please ?

Trial key creation does not work on test example

Dear friends, I tried to test trial key creation - uncommented the last string of test.py example:

res = Key.create_trial_key("WyIzODQ0IiwiempTRWs4SnBKTTArYUh3WkwyZ0VwQkVyeTlUVkRWK2ZTOS8wcTBmaCJd", 3941, Helpers.GetMachineCode())
if res[0] == None or not Helpers.IsOnRightMachine(res[0]):
    print("An error occured: {0}".format(res[1]))

But I get an aunthentification error:
An error occured: Unable to authenticate.

Should this function work as it is described in readme file?

Second question: when I issue licence to my client - I specify Client name, company, email on cryptolens website, then send the license key to client.
But if application aquires Trial license - only token and Product ID can be specified in Key.create_trial_key. How to specify the Client name+company+email for the Trial Key?

urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate

Hi,
Does this package support Apple's M1/M2 chips?

I have everything working on my Apple Intel and Windows laptops, but I sent my program to a friend that has an M2 Apple laptop and he is getting this error stemming from a package used in cryptolens:

An error occurred: Could not contact the server. Error message: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:997)>

I know this is part of the urllib package, but can someone verify this is an Apple Silicon compatibility issue?

How to save licenses?

cryptolens-python is a very wonderful project, and I have a question about how to save licenses.

In the introduction, the license is recommanded to saved as:

# res is obtained from the code above
if result[0] != None:
    # saving license file to disk
    with open('licensefile.skm', 'w') as f:
        f.write(result[0].save_as_string())

However, the saved licensefile.skm may be deleted by user. If the licensefile.skm is deleted, the computer would be treated as a new one.

How can I save result[0] that can not be changed by user?

Thank you very much in advance.

FileNotFoundError

Hello,

I don't understand why I get the following error. Thanks

Traceback (most recent call last):
File "", line 4, in
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/licensing/methods.py", line 139, in GetMachineCode
return HelperMethods.get_SHA256(HelperMethods.start_process(["dmidecode", "-s", "system-uuid"]).decode('utf-8'))
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/licensing/internal.py", line 57, in start_process
process = Popen(command, stdout=PIPE)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/subprocess.py", line 709, in init
restore_signals, start_new_session)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/subprocess.py", line 1344, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'dmidecode': 'dmidecode'

The license does not work: Unable to authenticate

Hi Team,
I face difficulty in authenticating the key and adding the machine for licensing. Below is the code referenced from your github documentation. I have already generated RSA public key, auth key, product code and key, when used im getting "The license does not work: Unable to authenticate." error. I have also tried manually adding the machine code in the licensing page and tried verifying using another code block mentioned in github documentation, still i get the same error

`

RSAPubKey = rsakey
auth = authkey

result = Key.activate(token=auth,
rsa_pub_key=RSAPubKey,
product_id=idcode,
key=keygen,
machine_code=Helpers.GetMachineCode(v=2))
print(Helpers.GetMachineCode(v=2))

if result[0] == None or not Helpers.IsOnRightMachine(result[0], v=2):
# an error occurred or the key is invalid or it cannot be activated
# (eg. the limit of activated devices was achieved)
print("The license does not work: {0}".format(result[1]))
else:
# everything went fine if we are here!
print("The license is valid!")
license_key = result[0]
print("Feature 1: " + str(license_key.f1))
print("License expires: " + str(license_key.expires))

`

to verify after manually adding the machine code in licensing

`
RSAPubKey = rsatoken

with open('/home/ms/Downloads/ActivationFile20230301.skm', 'r') as f:
license_key = LicenseKey.load_from_string(RSAPubKey, f.read())

if license_key == None or not Helpers.IsOnRightMachine(license_key, v=2):
    print("NOTE: This license file does not belong to this machine.")
else:
    print("Feature 1: " + str(license_key.f1))
    print("License expires: " + str(license_key.expires))

`

Issue with Helpers.GetMachineCode()

Win 10, ran on py 3.9.5 . This is returned when Helpers.GetMachineCode() Is called

File "C:\Users\Name\Desktop\python\Licensing\licensing_v1.py", line 15, in
machine_code=Helpers.GetMachineCode())
File "C:\Users\Name\AppData\Local\Programs\Python\Python39\lib\site-packages\licensing\methods.py", line 678, in GetMachineCode
return HelperMethods.get_SHA256(HelperMethods.start_process(["cmd.exe", "/C", "wmic","csproduct", "get", "uuid"],v))
File "C:\Users\Name\AppData\Local\Programs\Python\Python39\lib\site-packages\licensing\internal.py", line 145, in start_process
output = subprocess.check_output(command,
File "C:\Users\Name\AppData\Local\Programs\Python\Python39\lib\subprocess.py", line 424, in check_output
return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
File "C:\Users\Name\AppData\Local\Programs\Python\Python39\lib\subprocess.py", line 505, in run
with Popen(*popenargs, **kwargs) as process:
File "C:\Users\Name\AppData\Local\Programs\Python\Python39\lib\subprocess.py", line 951, in init
self._execute_child(args, executable, preexec_fn, close_fds,
File "C:\Users\Name\AppData\Local\Programs\Python\Python39\lib\subprocess.py", line 1420, in _execute_child
hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
OSError: [WinError 193] %1 is not a valid Win32 application

KeyVerification example does not work

Documentation: https://github.com/Cryptolens/cryptolens-python#key-verification

Running as-is produces the following response: python ./main-sample.py -> The license does not work: Unable to authenticate.. Possibly, the token is no more valid -> update the documentation

Replacing product key IYVOO-JCWXQ-LCRBI-ZAIQZ as documented in getting started: https://help.cryptolens.io/getting-started/create-license produces the following response: python ./main-sample.py -> The license does not work: Unable to authenticate.. Possibly, the token is no more valid -> update the documentation

Replacing access token with my own: The license does not work: Could not find the product.
An understandable mismatch between access token, the public key and product id.

Replacing public key, access token, product id, and product key with my own produces the following response: python ./main.py -> The license does not work:

Environment:
cat /proc/version
Linux version 4.14.200-116.320.amzn1.x86_64 (mockbuild@koji-pdx-corp-builder-60003) (gcc version 7.2.1 20170915 (Red Hat 7.2.1-2) (GCC)) #1 SMP Tue Oct 13 10:39:58 UTC 2020
python --version
Python 3.6.12

The same code was attempted on Windows 10 with Python 3.8.3rc1: The license does not work:

Values used:
RSAPubKey = "72XGSSTl0vK+EWGHhDE+pZpnYaOGjTGzDF3NtkbOHPakqsSTm7T1o5BcVyZgyyvCh82CfFG+pRVPBUSRdwS5ZCgk9pkA+L8egHF+zZYr6LEfPUj2bHnxRqSS8O52EnfPlES3EuFGXhQCHvQnlyUPXR0f3PSE1qCunuV9PLHct2LcF/UjcIEZgdLb92x7B/nilCbUWq81NxTmSmWbYyJKRM2xy4H6l4e49uGZdZCG8glWkz/MSutcfX8Dl70flVWeV69MrIOJLQ9ICk35jRNlC00aFuWTlPOYSgj0vfyZj9apEptDxxnKysJOWrVGlrwATGz9NRmGNoW1Xyss7L8IOQ==AQAB"

auth = "--removed--"
product_id=8808
product_key="IPJAE-RKPZO-UDRKQ-AVYSF"

Issue with machine code generation in Mac

When i call Helpers.GetMachineCode() in Mac, it returns
Traceback (most recent call last):
File "", line 1, in
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/licensing/methods.py", line 137, in GetMachineCode
res = HelperMethods.start_process(["system_profiler","SPHardwareDataType"]).decode('utf-8')
AttributeError: 'str' object has no attribute 'decode'

Error; Unable to authenticate.

I´m currently trying to fix this error since an hour, but I just can´t find the solution

        # import values
        from VALUES.values import RSAPubKey, auth

        #check if the key is valid
        result = Key.activate(token=auth,\
                        rsa_pub_key=RSAPubKey,\
                        product_id=14810,\
                        key=user_key,\
                        machine_code=Helpers.GetMachineCode())

        if result[0] == None or not Helpers.IsOnRightMachine(result[0]):
                # an error occurred or the key is invalid or it cannot be activated
                # (eg. the limit of activated devices was achieved)
                print(f"{light_RED}-[error] The license does not work: {0}".format(result[1]))
        else:
                # everything went fine if we are here!
                print(f"{light_GREEN}-[info] The license is valid! starting executor in 4 sec.")
                license_key = result[0]
                print(f"{light_GREEN}-[info] License expires: " + str(license_key.expires))

Add GetMessages

Extract the messages from the Messaging API and return the JSON ouput.

NEED HELP

Hello Devs,

I hope you having a wonderful time, Can you please help me with something? I made a Discord bot and trying to add REDEEM feature by which users can redeem license keys and use my bot, but I'm having an issue, It keeps giving wrong responses, I attached the picture
cryptolens
Capture

Problem with Helpers.GetMachineCode(v=2) on Windows

When we run. We get a machine code of None on Windows.

If we run the associated command that is executed in Powershell:

Powershell > Get-CimInstance -Class Win32_ComputerSystemProduct

Get-CimInstance : Invalid Class

So no output is sent to stdout, and "" goes to None in the callers. Do you know the reason for this and a way to solve? This is rather urgent. It is our first client we would like to get running with our software.

Thanks in advance for your answer.

Payment Form not completing?

After entering a payment form on the webpage and going through paypal, the backend doesnt seem to send out the requests nor a confirmation email nor call the AddCustomer method

I've doubled checked the request URL under the payment forms and it seems correct when I input it directly to the browser.

Not sure what the disconnect is. Btw, this is on a sandboy Paypal scenrio.

Demo Code in the documentation is not working

Here is my code

    
from licensing.models import *
from licensing.methods import Key, Helpers
import requests
import ssl

# WyI1MjY3NDUiLCJlS3NUQjkxTkk1TWhyS3dnVGdKaDZkM0VpcnRLZmtjRVFxMGlmem5YIl0=

# fixes SSL cerift errors
try:
    _create_unverified_https_context = ssl._create_unverified_context
except AttributeError:
    # Legacy Python that doesn't verify HTTPS certificates by default
    pass
else:
    # Handle target environment that doesn't support HTTPS verification
    ssl._create_default_https_context = _create_unverified_https_context

RSAPubKey = "<RSAKeyValue><Modulus>sGbvxwdlDbqFXOMlVUnAF5ew0t0WpPW7rFpI5jHQOFkht/326dvh7t74RYeMpjy357NljouhpTLA3a6idnn4j6c3jmPWBkjZndGsPL4Bqm+fwE48nKpGPjkj4q/yzT4tHXBTyvaBjA8bVoCTnu+LiC4XEaLZRThGzIn5KQXKCigg6tQRy0GXE13XYFVz/x1mjFbT9/7dS8p85n8BuwlY5JvuBIQkKhuCNFfrUxBWyu87CFnXWjIupCD2VO/GbxaCvzrRjLZjAngLCMtZbYBALksqGPgTUN7ZM24XbPWyLtKPaXF2i4XRR9u6eTj5BfnLbKAU5PIVfjIS+vNYYogteQ==</Modulus><Exponent>AQAB</Exponent></RSAKeyValue>"
auth = "WyIyNTU1IiwiRjdZZTB4RmtuTVcrQlNqcSszbmFMMHB3aWFJTlBsWW1Mbm9raVFyRyJd=="

result = Key.activate(token=auth,\
                   rsa_pub_key=RSAPubKey,\
                   product_id=16229, \
                   key="IORSI-OBUYU-FATEO-HHXJT",\
                   machine_code= None)

if result[0] == None:
    # an error occurred or the key is invalid or it cannot be activated
    # (eg. the limit of activated devices was achieved)
    print("The license does not work: {0}".format(result[1]))
else:
    # everything went fine if we are here!
    print("The license is valid!")
    license_key = result[0]
    print("Feature 1: " + str(license_key.f1))
    print("License expires: " + str(license_key.expires))

Do let me know where I am making the mistake

TypeError when handling error message if not connected to internet

Windows 10 Pro
Python 3.7.6
licensing v. 0.17

To reproduce

When not connected to the internet:

from licensing.methods import Key
# set TOKEN, KEY, MACHINE_CODE, PRODUCT_ID appropriately
success, response = Key.deactivate(TOKEN, PRODUCT_ID, KEY, MACHINE_CODE)

Expected result

No unhandled exception
success == False, response is an error message (str)

Output

Traceback (most recent call last):
  File "C:\Users\<user>\AppData\Local\Programs\Python\Python37\lib\urllib\request.py", line 1319, in do_open
    encode_chunked=req.has_header('Transfer-encoding'))
  File "C:\Users\<user>\AppData\Local\Programs\Python\Python37\lib\http\client.py", line 1252, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "C:\Users\<user>\AppData\Local\Programs\Python\Python37\lib\http\client.py", line 1298, in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
  File "C:\Users\<user>\AppData\Local\Programs\Python\Python37\lib\http\client.py", line 1247, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "C:\Users\<user>\AppData\Local\Programs\Python\Python37\lib\http\client.py", line 1026, in _send_output
    self.send(msg)
  File "C:\Users\<user>\AppData\Local\Programs\Python\Python37\lib\http\client.py", line 966, in send
    self.connect()
  File "C:\Users\<user>\AppData\Local\Programs\Python\Python37\lib\http\client.py", line 1414, in connect
    super().connect()
  File "C:\Users\<user>\AppData\Local\Programs\Python\Python37\lib\http\client.py", line 938, in connect
    (self.host,self.port), self.timeout, self.source_address)
  File "C:\Users\<user>\AppData\Local\Programs\Python\Python37\lib\socket.py", line 707, in create_connection
    for res in getaddrinfo(host, port, 0, SOCK_STREAM):
  File "C:\Users\<user>\AppData\Local\Programs\Python\Python37\lib\socket.py", line 752, in getaddrinfo
    for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno 11001] getaddrinfo failed

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\<user>\envs\<env>\lib\site-packages\licensing\methods.py", line 163, in deactivate
    "MachineCode":machine_code})
  File "C:\Users\<user>\envs\<env>\lib\site-packages\licensing\internal.py", line 104, in send_request
    .encode("utf-8")).read().decode("utf-8")
  File "C:\Users\<user>\AppData\Local\Programs\Python\Python37\lib\urllib\request.py", line 222, in urlopen
    return opener.open(url, data, timeout)
  File "C:\Users\<user>\AppData\Local\Programs\Python\Python37\lib\urllib\request.py", line 525, in open
    response = self._open(req, data)
  File "C:\Users\<user>\AppData\Local\Programs\Python\Python37\lib\urllib\request.py", line 543, in _open
    '_open', req)
  File "C:\Users\<user>\AppData\Local\Programs\Python\Python37\lib\urllib\request.py", line 503, in _call_chain
    result = func(*args)
  File "C:\Users\<user>\AppData\Local\Programs\Python\Python37\lib\urllib\request.py", line 1362, in https_open
    context=self._context, check_hostname=self._check_hostname)
  File "C:\Users\<user>\AppData\Local\Programs\Python\Python37\lib\urllib\request.py", line 1321, in do_open
    raise URLError(err)
urllib.error.URLError: <urlopen error [Errno 11001] getaddrinfo failed>

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Users\<user>\envs\<env>\lib\site-packages\licensing\methods.py", line 167, in deactivate
    return (None, "Could not contact the server. Error message: " + e.reason)
TypeError: can only concatenate str (not "gaierror") to str

update README.md

Change:
auth = "WyIyNTU1IiwiRjdZZTB4RmtuTVcrQlNqcSszbmFMMHB3aWFJTlBsWW1Mbm9raVFyRyJd=="

TO:
auth = "WyIzNzg5NjY1IiwiaUFsd0VaSnFwSVMycWxmc0gxUVRLdFduc2RNbmx4ZVVPaldMWW43SSJd"

Change:
if result[0] == None or not Helpers.IsOnRightMachine(result[0]):

TO:
if result[0] is None or not Helpers.IsOnRightMachine(result[0]):

add parameters when calling the payement form in the request URL

Hello I have a question,
Is it possible to add parameters when calling the payement form, I'm trying to use the payement per use , where I create a data object when creating a key, then this key helps to authentify the person on my software . When reashing the value 0 the user could recharge the old key without creating a new key, I create a payement form for the first payement : the key is being created and another one for recharging the this key.
however I can't figure out how to add the key and the Id of the data object in the URL form in URL that should be called after succeding the payement .
Is there a way to do this please ?

Can I somehow add this to my program?

Sorry for the stupid question, but how can you add it to your program?
I started programming recently, and I need to check the license key, but I'm not good at it. Can I somehow add this to my program?

Python/OS compatibility

Thanks for this library. I'm using it in a pants project, but when building a pex I get

No pre-built wheel was available for licensing 0.45.
Successfully built the wheel licensing-0.45-py3-none-any.whl from the sdist licensing-0.45.tar.gz but it is not compatible with the requested foreign target complete platform cp311-cp311-manylinux_2_35_x86_64.
You'll need to build a wheel from licensing-0.45.tar.gz on the foreign target platform and make it available to Pex via a `--find-links` repo or a custom `--index`.

I think this due to the classifiers in setup.py:

    'Programming Language :: Python :: 3',      #Specify which pyhton versions that you want to support
    'Programming Language :: Python :: 3.4',
    'Programming Language :: Python :: 3.5',
    'Programming Language :: Python :: 3.6',

What about 3.7 to 3.12, are they also supported? What about the OS specifiers, does it support all OS's?

update the token values

hello, i'd like to know if it is possible to change the tokes value, after the user utilization ( in python) , am trying to develop a softwere where the price of the subcription is based on the number of images that i modify for the user, after identification and extracting the value of the token that the user get from it subsription how could I update it please?

models.py incorrect value format for Response.from_string

As per some work in progress with your library, there seems to be a strange usage on types there

in models.py, Response.from_string

    result = 1

The conditions compare it to a string inside models and with an integer in methods.
That's confusing when using low level functions.

decrement_int_value_to_key function doesn't exists

hello, as I am trying to use cryptolens to decriment a data object int value however in the code you displayed on github i can't seem to fine the function decrement int value to key in the DATA Class, i can oly find the the increment_int_value_to_key

Machine Code None

Hi! I created a test license for 5 PCs and it seems that on one of them when I try to activate the license it appears that the license is invalid and on the website in the Machine Code section it appears as None but on the other two PCs it works.

here is the script in python

RSAPubKey = "ydXaE5whpDDNLPX+wy1ikMHWx4zxGOBECFJCD9x2ye1iQDjcGf+y1ZRaw+5XLUVOkmk0RB04E3Wt1tRpDbTrbxpQx7MwNorjE/0f9rzOmbSElrTt7Nqk1LR+ywa9/SSEDaJAHGxmHw2VSDKdolfr8uzYmsUBEOlt+NUKCmE/lfArtkLORBHsoP+mC8a7RbH3g9CfA8RUQ/hiQbMDpDiJF+rRUfxWJRUhWFLiDCMNc+opbAu56JOMPS/0nI+44vag08IIuYqNX3wYp7QEurJNGCNFl/X4Aqcy/mbVbcCFoO0TzKo7l45EM+KeK5WGF7PLZQpr98SPRFtRvgaeXl5Vlw==AQAB"
auth = "WyI1NjQ2ODU4NyIsIkJJUTFvRDdLKzV5dThJb3RtVVBMS0NEU0NKd0FOakdaVVFURlJNWGwiXQ=="

result = Key.activate(token=auth,
rsa_pub_key=RSAPubKey,
product_id=21267,
key="FRGLJ-ZUKAZ-JNJYT-RNDUW",
machine_code=Helpers.GetMachineCode(v=2))

if result[0] == None or not Helpers.IsOnRightMachine(result[0], v=2):
# an error occurred or the key is invalid or it cannot be activated
# (eg. the limit of activated devices was achieved)
print("The license does not work: {0}".format(result[1]))
msg = CTkMessagebox(title="Error", message="Licență invalidă!", icon="cancel")
msg.wait_window()
else:
# everything went fine if we are here!
print("The license is valid!")

Cannot use cryptolens_python2.py with pyinstaller --onefile and --noconsole

I've already created a temporary fix.
Please take a look and consider implementing a permanent solution.

----FILE cyryptolens_python2.py----
---IMPORTS---

REMOVED

  1. from subprocess import Popen, PIPE

ADDED

  1. from subprocess import check_output, PIPE, STARTF_USESHOWWINDOW

---FUNCTION 'start_process'---

REMOVED

  1. ``
  2. process = Popen(command, stdout=PIPE)
  3. (output, err) = process.communicate()
  4. exit_code = process.wait()
  5. return output.decode("utf-8")

ADDED

  1. if sys.platform == "win32":
  2. class STARTUPINFO:
  3. dwFlags = 0
  4. hStdInput = None
  5. hStdOutput = None
  6. hStdError = None
  7. wShowWindow = 0
  8. ``
  9. startupinfo = STARTUPINFO()
  10. startupinfo.dwFlags |= STARTF_USESHOWWINDOW
  11. else:
  12. startupinfo=None
  13. ``
  14. return check_output(command, startupinfo=startupinfo, stdin=PIPE, stderr=sys.stderr).wait()

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.