B4J Question Licensing for Desktop applications

westereng

Member
Licensed User
Upvote 0

aeric

Expert
Licensed User
Longtime User
3 months trial seems a bit short period. If the trial expired, user can download another version? Will it work if user change the system time backward? If you put a date inside a license file I think it should be obfuscated so it is not easy to crack. You can read hardware unique id to encrypt the license file.

I think a better way to charge user is to provide technical support as subscription.
 
Upvote 0

mcqueccu

Well-Known Member
Licensed User
Longtime User
3 months trial seems a bit short period. If the trial expired, user can download another version? Will it work if user change the system time backward? If you put a date inside a license file I think it should be obfuscated so it is not easy to crack. You can read hardware unique id to encrypt the license file.

I think a better way to charge user is to provide technical support as subscription.


That is what I planned to do, but the app will run offline. And what happens if the user decides to cancel the subscription? The software still remains on his computer.

So I need a way to make the software license expire at least yearly, which will force them to make fresh payment
 
Upvote 0

westereng

Member
Licensed User
Well, LimeLM needs online access at some times to verify licenses.

So I need a way to make the software license expire at least yearly, which will force them to make fresh payment

You mean, stop the application from working when their license expire?
 
Upvote 0

Gandalf

Member
Licensed User
Longtime User
I would do it like this: In the installation package include a file containing encrypted map, maybe used also for some internal config like default settings. In this map there is a TimePassed value counting time from first start. Application counts time from start with internal timer to prevent user cheating by changing system time. In MainForm_CloseRequest application updates file storing TimePassed value or just updates it periodically. On each start application loads file and checks if TimePassed is over certain period - if yes, shows "License expired" message and closes. If the file with map is not found, application should show error message and close, so user can't reset license by just deleting the file. User must not know which file it is otherwise he or she can store the original one and overwrite it later, maybe name the file in a confusing way like "important.dll", "mysql.drv", etc. For license renewal you can use preset unlock codes stored in the same encrypted map as keys with used/unused value, this way one code can be used only once at each installation. If the license period is one year, several hundreds of preset codes should be enough. Different sets of preset unlock codes may be used for each customer to prevent them sharing the codes.
 
Upvote 0

aeric

Expert
Licensed User
Longtime User
Something similar to what Gandalf described, I guess.

For my previous VB6 project, I used MS Access database to store the license and rename it to "license.dat" with password protected.
The user need to register the program with my online web service with the product key I provide to him. It can be a Trial or Full.
When a user try to activate the program, he need to input his username, email and product key together with some hidden hardware ids (such as harddisk serial no or motherboard id) to complete the registration. My web service will return an encrypted key and update the database (license) file with a timestamp. Each product key in my online database can control number of activation.
It is possible to open the file (using Notepad) and see some strings but I already encrypted (hashed) with SHA1 or MD5. So, different machine may have different unique license file.
When the program starts, it need to check for this license file whether it is a trial version or full version. I don't put expiry period but disabled some advanced features for Trial version. You can restrict the user by expiry date if you want but user can reverse the system date time. You may also restrict number of transactions for the Trial version and unlimited for Full version. For B4J, I think we can use SQLCipher (SQLite) for the license file. I never try but maybe in the future.
 
Upvote 0

aeric

Expert
Licensed User
Longtime User
That is what I planned to do, but the app will run offline. And what happens if the user decides to cancel the subscription? The software still remains on his computer.

So I need a way to make the software license expire at least yearly, which will force them to make fresh payment
I think it is difficult to stop offline user to continue using the software. What you can do is they cannot upgrade to newer version with more advanced features. If they need this new features, they will pay for the upgrade.
 
Upvote 0

aeric

Expert
Licensed User
Longtime User
But if you can assume the user is not an IT savvy person and don't know they can reverse the system date then just make the simple date check. Compare the current system date time with an expiry date time using function like DateDiff or similar method. It is not a fool proof method but I use this method for development version for my previous VB6 program. Some programs need to use an actual date time when you need to save the date into database or else the report will be not correct.
 
Upvote 0

Jeanc161

Member
Licensed User
Longtime User
I write something for a licence that you can buy an activation key pay for it and the licence is activated only when the user pay for the application, it is a very complex thing, but i manage some service and use a licence file that is encrypted using a type structure, and a server that store the client licence data that is the same as the local licence file. the only thing, the client need to activate the licence either manually or automaticly by paying for it licence, then the server set a byte in the licence file for that specific client, and when the app open up when the user start the app, a call is made to the server to scheck for activation, and if the activation byte is set then the app is activated and can be run fully.
There is more to this that i can describe here, but so far my system work pretty well, and ive made a web app to check for clients, activate or deactivate licence and if the app is not activated, the app will run in demo mode only accessing certains parts of the program, it also check in the local app for a date period if the app is not activated, and it will stop accessing data, the app is still there but he can do nothing with it. It does not mather if the user deinstall the app, the app remember that it was installed before, and if it is reinstalled again on the same phone or tablet, it will remerber it's id and will not create a new entry in the database.

Anyway, there is a lot of ways to do licencing, but after many many tries and experinces i think i have the best licencing sheme for my apps. and this i use using an object class that i include in all my apps, and i don't have to create a new protection sheme everytime i create a new app.

If you are interrested, i can give you hints on how to implement this technique, and modify it to yours need. But my pattern involve and internet access and a server to receive and manage licences. But so far this have work flawlessly for me and my company, and i can sold demos that are time limited or datelimited and activate the app remotely without changing anything in the app for it to work.

Give me a buzz if you are interreting to know how that works.
 
Upvote 0

tchart

Well-Known Member
Licensed User
Longtime User
I had a play with LimeLM over the weekend. It's actually quite a good product actually. It handles trial automatically and there is a dashboard to see all the activated licenses etc. It has online and offline activation. You can also remotely deactivate licenses.

There are several approaches even with LimeLM as you can build your own activation UI, use their wizard or they have a web API. In most cases you need to use their Java classes.

I am looking at this for a server app so I am looking at the wizard approach. I wrote a small wrapper to cover the parts I needed. It's working but needs a bit of work to tidy up.
 
Upvote 0

westereng

Member
Licensed User
I had a play with LimeLM over the weekend. It's actually quite a good product actually. It handles trial automatically and there is a dashboard to see all the activated licenses etc. It has online and offline activation. You can also remotely deactivate licenses.

There are several approaches even with LimeLM as you can build your own activation UI, use their wizard or they have a web API. In most cases you need to use their Java classes.

I am looking at this for a server app so I am looking at the wizard approach. I wrote a small wrapper to cover the parts I needed. It's working but needs a bit of work to tidy up.

Yes, I used it for several years, never had any problems with it
 
Upvote 0
Top