Reputation: 1706
I want to make a demo version for my app which works only 15 minutes. what is the best way to do that?
for example I can:
Thread
in my app which waits 15 minutes and then blocks access to the app, but if the user re-installs the app, again
can work 15 minutes.what is the best reliable solution?
Upvotes: 0
Views: 252
Reputation: 14472
As you can see from the comments, it's currently impossible to secure an app without using something the user does not have access to - i.e. a server. But I thought I'd post an approach I use to protect stuff in my apps which is really difficult to get around.
It's difficult only because it's obscure and the first rule of security is that obscurity aint security. However, it will defeat 95% of freetards and will at least reduce abuse. Also. you should understand that the weakest point in your code is the bit that does the checking. You need to make this really obscure too and examine you code using something baksmali to check that it really is obscure.
This approach is very hard to crack for encrypted assets but quite easy to crack if you do something like if(myData.isGood())
.
The approach.
Extend the ImageView
class.
Add an instance of your extended ImageView
to your main layout.
Set it's source to a resource in your app, e.g. the app icon.
Override the onDraw()
method of the extended ImageView and in
there, get an array of bytes from some arbitrary location in the
ImageView bitmap. Effectively, a random set of bytes.
Draw a transparent ink to the Canvas
so the ImageView is not seen.
Encrypt/decrypt your data/string/asset using these bytes as the private key.
Upvotes: 1