How to implement a license check on a python plugin?
-
@Manuel
it works, I'd just forgotten to return True in my Message method of the Level-Object
is there any documentation to build in a license check?
He checks the user_license on my server if it exists.At the moment I build it in the if name statement and if false I register a Dummy_Class.
or is there another way to do that.Best Regards
edit:
this thread was forked from there -
Hi,
we have an example on github that shows one way of doing it. It uses the function
c4d.ExportLicenses()
.
We also have this c++ manual where we describe functionalities introduced in r21.GetGeneralLicensingInformation and ExportLicenses allow you to retrieve information about the license that the user is currently using. This can help you to identify a user.
There are many ways of checking for licenses. People rely on Serial Numbers or nowadays realtime check with a web-server. This depends on how automatic you want your system to be, how secure, how hard to "hack" etc.
Because of that, we cannot really guide you on the best way to handle this check for your product. We can just show you what information you can retrieve from the user inside Cinema4D to identify him.Cheers,
Manuel -
@manuel
Thank you Manuel for your help.
Yes but sometimes the user uses other data in his purchasing process as he would have for Cinema4D Lincense maybe.
So I need the informations he gave in the purchase-form for the plugin.
so in terms of realtime check with an api of my distributor.....
I need here sensitive data.
So my question.- Is the decoded/protected my_plugin.pypv file crackable? Can somebody read the code or decode it in someways?
and when I work with environment variables is that better?
Otherwise I would update it manually. I have written a small programm which catches the data from the api and creates the license files , which I copy to my server. During that time the user gets a 3-day trial.
I i request the api completely automated , what is when I close my company the api will no longer be available...so maybe better to do the license update manually or let a script do it.
Serialnumbers are not good, everybody can distribute them.
No I check the licenses from the distributer and create license files with the emails from purchase.
Then I create a demofile as well with the macadress and the email.
and then there is also a json.file which also has all buyers and the version for instance Single User license. This license may just have two macadresses, Desktop and Laptop for instance. A little bit tricky.....Multiuser license doesn´t have restriction.
If a user reinstall or buys a new PC he can contact support to free his mac_adress.
If he refund the plugin doesn`t work anymore because there will be no license anymore and the demo has expired. Demo is restricted to the mac_adress.
And if he uses a valid email@address that also doesn´t work because the license is restricted to max 2 mac_adresses except multi_user. Not perfect but an idea...
This plugin needs a lot of work in terms of 3D-modelling. So I want to protect it a bit. - Is the decoded/protected my_plugin.pypv file crackable? Can somebody read the code or decode it in someways?
-
Hi,
keep in mind that no matter what protection you have, is someone want to crack it, he will. It is just a matter of time and if it is worth it. Protecting your work is important of course, but it takes time. You must find the right balance between protection efficiency and time spent on it.
If you encrypt your python file, it will block a lot of people being able to read your code but not all. Hackers will be able to decrypt your file and have access to the source code. From there, it is just a matter of time.Because the balance "protection efficiency/ time spent on it" is different for all user, we cannot guide you finding the best solution. This is code design, and it is out of the scope of our support.
But if other developper want to share their experience here, they are free to.
Cheers,
Manuel -
@manuel
Hi Manuel, I just wanted to let you know that I have decided on your suggestion and have decided on a license system with serial numbers that are automatically created and delivered upon purchase and in combination with a kind of license server that controls the licenses..... thank you for the hints