B4A Library Licensing library

This library allows you to use the market services to protect your application.
See the tutorial for more information: http://www.b4x.com/forum/basic4andr...ur-android-application-licensing-library.html
The documentation is available here: Basic4android - Licensing

Installation instructions:
- Unzip the attached file and copy Licensing.jar and Licensing.xml to the internal libraries folder (default): C:\Program Files\Anywhere Software\Basic4android\Libraries

V1.21 - Adds protection from NullPointerException error reported.
V1.20 - Fixes an issue related to Android 5.
 

Attachments

  • Licensing.zip
    34.3 KB · Views: 865
Last edited:

Kevin

Well-Known Member
Licensed User
Longtime User
Am I still protected on devices running API 16+ even if I target a lower version in the app or must you target 16+ in order to be protected on 16+?

I realize it won't be protected on devices running an older API though.
 

Mrjoey

Active Member
Licensed User
Longtime User
i believe that my app was hacked and bypassed my server check for trials,is that correct that the hacker copied the apk and decompiled it and deleted the sub and recompiled it?
 

Erel

B4X founder
Staff member
Licensed User
Longtime User

Mrjoey

Active Member
Licensed User
Longtime User
With the new encryption process it is not possible to copy the APK from a rooted device to a different device.
hey mr erel , i discovered that my app with api+16 has been cracked and is distributed on lots of sites and blogs , ive downloaded it to check it , i installed it and it worked , (im not using the license library), so how apps with api+16 are protected?MY HARD WORK WENT IN VAIN,THIS IS MY FIRST TIME EXPERIENCE WITH ANDROID AND I CAN I TELL IT WAS BAD.
 
Last edited:

Erel

B4X founder
Staff member
Licensed User
Longtime User
This is what we know about this protection:
Please note that starting with JellyBean release of Android OS, all apps, paid as well as free, are encrypted by default, and therefore, do not require any additional protection against unauthorized copying such as Google Licensing Server. If you only develop for devices running JellyBean, you don't need Google Licensing Server. You can learn more about app encryption in the Developer Guide.
 

Informatix

Expert
Licensed User
Longtime User
hey mr erel , i discovered that my app with api+16 has been cracked and is distributed on lots of sites and blogs , ive downloaded it to check it , i installed it and it worked , (im not using the license library), so how apps with api+16 are protected?MY HARD WORK WENT IN VAIN,THIS IS MY FIRST TIME EXPERIENCE WITH ANDROID AND I CAN I TELL IT WAS BAD.
You cannot prevent people from installing your APK on a rooted device. And on a rooted device, everything is possible. It's not specific to Android. Did you notice that on PC, where the best protection schemes are used, it is very easy to find cracked versions? What's specific to Android is that people can decompile your Java code and see it in a legible form, very close to the original if you didn't obfuscate it.
 

Troberg

Well-Known Member
Licensed User
Longtime User
Also, remember that a very small percentage of the users bother with cracked copies, and those who do wouldn't have paid anyway. If they couldn't find it cracked, they'd probably gone with some other product instead, and that's even worse. A freebie user is still a user, and if he is happy and tells people about it, others will buy your program. If he used something else, you would have lost that secondary sale.

Or, as some author said (quoting from memory): "I'm not afraid that people will download and read my books for free. I'm afraid that they won't read them because they don't know about them."

I firmly believe that getting more users is more important than getting a high percentage of paying users.
 

Mrjoey

Active Member
Licensed User
Longtime User
Also, remember that a very small percentage of the users bother with cracked copies, and those who do wouldn't have paid anyway. If they couldn't find it cracked, they'd probably gone with some other product instead, and that's even worse. A freebie user is still a user, and if he is happy and tells people about it, others will buy your program. If he used something else, you would have lost that secondary sale.

Or, as some author said (quoting from memory): "I'm not afraid that people will download and read my books for free. I'm afraid that they won't read them because they don't know about them."

I firmly believe that getting more users is more important than getting a high percentage of paying users.

i agree with your idea since my is getting famous by time and no need to spend money on promotions , that s the only good thing of that behavior , and can u please tell me what is the benefit of downloading your pro app for free?i think nobody want to work for people for free.
 

Mrjoey

Active Member
Licensed User
Longtime User
You cannot prevent people from installing your APK on a rooted device. And on a rooted device, everything is possible. It's not specific to Android. Did you notice that on PC, where the best protection schemes are used, it is very easy to find cracked versions? What's specific to Android is that people can decompile your Java code and see it in a legible form, very close to the original if you didn't obfuscate it.

i tried my app on obfuscate mode and i got some errors like "sub not found" so i published it in normal mode.and im sure till now my code is not modified because i can track my app on google analytics and my hosting script is still working by seeing my database that is still growing.so i believe that no modifying is happening , just copying the app and distribute it on those sites.
 

Troberg

Well-Known Member
Licensed User
Longtime User
can u please tell me what is the benefit of downloading your pro app for free?i think nobody want to work for people for free.

Well, I'd prefer it if they pay, but if they won't, it's much better for me if they pirate my app than if they pirate some other app. Users, pirates or not, build a reputation, which gives more users, and more paying users.

As for working for free, well, that depends, as do business models. If it's my day job, I want to get paid, but if it's hobby work, payment is just a bonus. Also, not all business models depends on money up front on initial sale. Heck, just look at Linux, and all the work that goes into it, most of it unpaid.

Then again, I'm on the open end of the licencing ideology scale. If you are into Swedish politics, you might even recognize my family name. I was the one who convinced (or, if you asked her, nagged) my sister into joining the Swedish Pirate Party, where she became second in the party 2009, leader in 2011, and saw the party through an extremely successful EU parliament election (2 seats out of Sweden's 20), but stepped down recently to pursue other ways to affect change.

http://en.wikipedia.org/wiki/Anna_Troberg

So, I'm very much in the hardline open source world.
 

lemonisdead

Well-Known Member
Licensed User
Longtime User
my database that is still growing
Can't you use the access to your database as a way to stop the access to unwanted users ?

If yes, : change the access data to your database, read more about how to use the obfuscation and use it, add a licensing check routine inside a new version of your app and publish it to Google Play as an upgrade for real clients.
 

Mrjoey

Active Member
Licensed User
Longtime User
Can't you use the access to your database as a way to stop the access to unwanted users ?

If yes, : change the access data to your database, read more about how to use the obfuscation and use it, add a licensing check routine inside a new version of your app and publish it to Google Play as an upgrade for real clients.

i have the same idea in my mind and yes i can stop users who didnt pay ,but before i can update my app , im thinking of doing my own license check but i think i cant really know from google if that user has really paid,i dont know if there is any way to do that.
 

lemonisdead

Well-Known Member
Licensed User
Longtime User
I can stop users who didnt pay
That's a really good point.
but before i can update my ap
Yes and take your time before to release your upgrade. Think to any of the cases that you could be faced to.
i think i cant really know from google if that user has really paid
You can't know but Google will know it for you. In fact, after having taken ALL the necessary decisions to make your app more secure (obfuscation, licensing library), you will publish the new version. First of all, Google will provide the new version to paid customers only. And secondly, when your licencing checking routine will run, it will interact with Google Play. So you will be able to immediately shut down any unpaid app. And third: by changing the access to your database, the old copies won't be able to continue working.

It is not 100% sure but it is more secure for you.

And you even could take the time to register the unpaid users by catching their Google's account and store them into your database
 
Top