Create a trial version of a Java application, with limited functionality [closed]

岁酱吖の 提交于 2019-12-06 09:30:34

问题


I am searching for ideas on how I can implement a trial version of my java application. Most posts are about creating a trial software with time limitation on when it stops working. In my case I am want to create an application that has limited functionality and one can unlock all the features of the app by purchasing the product. I would appreciate the communities thoughts on the points below. A twist to this issue is to make this solution as generic as possible so that it works on Mac and Windows.

My approach to this solution involves checking for the existence of a 'registration' file, when the app starts up. If a valid registration file exists, then the application will be fully functional. This file will be placed in the User's Application Data directory. That way uninstalling the application in Windows will not touch this file. Also, on a mac, in typical cases removing the app folder there should be no problem, unless the user has installed some software like AppCleaner, which will prompt to delete the application directory under the ~/Library/Application Support folder.

So, here is my first question. What is the community's thought on how should I handle a situation where the registration file is deleted for a user that has already bought the application?

I think this is also related to how the registration/purchase is done in the first place. This is my second question. I will not handle any credit card transactions in the software, I'd much rather paypal do all that. So, say after someone purchases software, I gave them a registration key that will unlock the software. My first concern here would be that anybody that has this registration key can unlock the software. How can I restrict this? Ideas?

This topic might require a little discussion, I hope that is ok. Looking forward to hearing your inputs.

edit: I just wanted to get back to this post and update it to mention that I finally after assessing TrueLicense and License3j, i have chosen to work with TrueLicense. I am still in the process of figuring out how to use it, as the documentation is not all that easy. I am trying to study the sample and hopefully I'll have that up and running soon for my app.


回答1:


Recently I have been doing some research on the same subject. I found that it is necessary to implement a licence manager. I found TrueLicence open source library for that and a tutorial with code samples.

...when using True License, or any other Java license manager library, you're going to need to create two components:

  • A software license server, which generates a new software license whenever a customer purchases a copy of your software, and
  • A software license client, which is code you embed into your Java/Swing client application to install and verify the license.



回答2:


You can use a license.properties file who's key/token will be picked up everytime the software launches. The software would have some interceptor code which will read the key/token from the license.properties file and decrypt it and generate a value. So, when a user buys purchases your software, you issue him a new token. Now this token when decrypted will generate some different value than the usual one and accordingly you'll unlock the rest of the features.

There are 100s of encryption alogorithms that you can search over web and use them into your software but the basic idea is this.



来源:https://stackoverflow.com/questions/13100353/create-a-trial-version-of-a-java-application-with-limited-functionality

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!