Enforcing/Checking Time Limit for demo program?

NFOBoy

Active Member
Licensed User
Longtime User
Ok,

have thought of a couple of ways to effectively enforce a time limit for demo application.

1. Have app check a server upon runtime... sets some flag on the server, have application do whatever behavior upon reaching limit.
a) requires server (i don't have that)
b) requires php/server side programming (just getting up to speed on Android!)
c) requires network permission for application to access server
2. Have app set a file upon installation/runtime , check file upon runtime, when limit reached.. do whatever behavior upon reaching limit.
a) requires small file set upon runtime
b) very easy to defeat by either uninstall/reinstall, or finding file and deleting it.


Ok, as for:
1. either I need a pretty cookie cutter approach and suggestions for a cheap server... anyone? :)

OR

2. Any way that I can utilize same protection as some programs on the market do? Which is, place a file somewhere within the system files, utilizing the "Modify Global System Settings" (several live wallpaper apps do that) so that upon unistalling, the "marker file" is still on the phone. Only way to defeat is to decompile/recompile file (not likely) or find the "marker file" and delete. (which is actually quite hard, as I tried to figure out how a couple of apps were doing it, and could not trace it down!)

Method number 2 is actually quite elegant, and effective for most users. I am just not sure about how to
a. get the permission needed within B4A
b. exactly how to "hide" the file more effectively within System Files... but have a few ideas...

So, is this workable?


(Now working on understanding all the posts about encrypting databases and securing keys using byteconverter... just to make THAT more difficult)

Ross
 
Last edited:

sorex

Expert
Licensed User
Longtime User
I would go for option 1. Free hosting with php & mysql is no issue these days anyway.

The only thing you need to keep in mind is what to do when they have no coverage or disabled wifi/3G on purpose to open the app.

Then you need to mix 1 & 2, 2 to store the date in a local file.

but then you come to another issue :)

what if they also set their date back a few days?

maybe you can "grab" the real time from the carrier to compare with but like you said
if they mess around in that local file that hold the timestamp/date they can still avoid it.

I don't know if there is a full proof method for this kind of thing unless you force them to use internet/3G to be able to open the app (you can always tell that it's needed to update app data)
 
Upvote 0

NFOBoy

Active Member
Licensed User
Longtime User
Erel,

roger Reflector. :)

So, before I go down the rathole too far... this is what I've found:

(to store/retrieve the datetime.now for when application first installs/runs)

I see-> android.provider.Settings.System

static boolean : putLong(ContentResolver cr, String name, long value)
Convenience function for updating a single settings value as a long integer.

and

static long : getLong(ContentResolver cr, String name)
Convenience function for retrieving a single system settings value as a long.

So I need to use reflector to target those for getting/grabbing... I believe that means I also need to reflect on:

android.content.ContentResolver , using the

Public Constructors : ContentResolver(Context context) and use the
getApplicationContext() method to get a context for use in getting the ContentResolver... that I then need to pass for putting in/retrieving out the date in sytem settings using the above methods..

does that sound about right?


Sorex, thanks for the tip, I am looking at PHP/Servers right now thanks to your suggestion. Any good tips on where I can look for example code on how to setup what we are discussing here? (App tells server phone IMEI or AndroidID, server checks to see if that exists in the database, if not... add it.. if so... return somevalue based upon the date that it first checked in)

(could also use that as an incentive to get people to leave reviews... leave review (good or bad) and I'll unlock the demo version in the free program, and then update the server)

Could use that in conjunction with the system settings mod... or not, basically I want to let the casual user have a good go at trying some things out, and then let them politely know it's time to upgrade/leave a review to continue :) I know I can't beat someone who want to hardcore it to getting around it, but then, they'll also just defeat the Play Store License check too :)

(Erel, by the way... have been dying to tryout 2.0 + to try classes, but after bad experience while doing the upgrade to 1.92, I have just stayed there to finish my app... now almost a 1000 hours in, and the light is at the end of the tunnel... when released, I'll do the upgrade.

Ross
 
Upvote 0

sorex

Expert
Licensed User
Longtime User
App tells server phone IMEI or AndroidID

not sure if that will work 100%, when I compile to my Momo11 tablet B4A/ADB gives me back serial 0123456789ABCDEF so I think they all have that one :) So you have another issue there unless you go username & password.
 
Upvote 0
Top