How to use public encryption to manage licensing on android applications?

醉酒当歌 提交于 2019-12-05 05:30:33

问题


I don't want to publish my app on Android Market, but i would create a license key from my website based on the MAC address of the user device. It should include also expiration date. Once the user enters the code in the android device it should be recognised. I've read that it can be done by using custom public encryption. In this scenario i should implement:

  1. A function in my application that takes the MAC address of the device and shows a string to the user.
  2. A function on my website that owns the private key and cipher the string at point 1. and adds expiration date
  3. A function in my application that decipher the string at point 2. using the puplic key and validates the license key.

I've read many discussions on stackoverflow and other sites but nothing applicable... or it is not clear how to apply in my scenario :(

Can you provide me e way to solve this problem? is there something that is android native that i'm missing (i hope) ?

Many thanks! Marco


回答1:


I see nothing really difficult to implement your intents:

  1. Your licensing server must have its own private and public key pairs.
  2. Then you have to create private key in your application during 1st run/install. It can be done just randomly
  3. Then you have to interchange between your application and server with public keys
  4. During buying/licensing procedure your application should encrypt MAC address or other (gmail id, IMEI code whatever) send to server - server stores key
  5. In order to check validity of license application sends to server cipher of MAC - server checks it against stored in database

If you don't know how to implement private/public keys stuff - read manuals, there're a lot of implementations of Diffie-Hellman's procedure - it's easy and nothing special there




回答2:


I was looking to implement licensing on apps that are not distributed through Play and came across this:

https://code.google.com/p/droidactivator/

Maybe it will help you too?



来源:https://stackoverflow.com/questions/7722841/how-to-use-public-encryption-to-manage-licensing-on-android-applications

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