0

My goal is following:

I want to use something like

if (!checkLicense())
{
   ... close app and show some informations/links...
}

in some random places in my code... BUT I want to prevent someone from decomiling the apk, replace the checkLicense() Funktion with something like checkLicense(){ return true; } and recompile the apk...

Is something like that possible in java?

Btw, if this approach doesn't make sense, please don't hassle to tell me and explain to me... Or can someone tell me, how this is done by others? Didn't find much helpful informations on that...

prom85
  • 16,896
  • 17
  • 122
  • 242
  • No can do. You can make it harder to break (using obfuscation), but you can never really make it impossible (unless you never give them the code in the first place!). – Joachim Sauer Dec 19 '12 at 13:33
  • You might be interested in http://stackoverflow.com/q/13854425/1065525 – Alexis Pigeon Dec 19 '12 at 13:33
  • Isn't google obfuscating the apks automatically already? I will have at look at proguard though, thanks – prom85 Dec 19 '12 at 13:42

1 Answers1

0

The recommended way to protect your app is to use Google Application Licensing

Sébastien
  • 13,831
  • 10
  • 55
  • 70
  • I will use that in the end, but I want some trial license check method as well – prom85 Dec 19 '12 at 13:38
  • Even with the Google Licensing from the play store and ProGuard obfuscation, there is absolute way to change people from hacking it. At some point of your code there will always be a `if(something){ // do licensed stuff }` . And a skilled hacker will always be able to change `something` to `true`; – Budius Dec 19 '12 at 13:49
  • I know... actually I'm just lokking for some simple steps to make it a bit more complicate... – prom85 Dec 19 '12 at 13:50