7

I'm trying to develop my dictionary app, and in my app I'm using database for my dictionary. So I'm trying to secure my app or prevent to share my app with some applications like ShareIT! or CSHare and more. I saw a lot people will transfer all app with data with these apps, and I'm trying to find a way to stop it or somehow cancel this app.

My app is premium and I know that there might be some way to ask user for some personal data to login or something like these. But I also saw what people are doing with these sharing apps.

I'm not saying to give me some code or exact example (if it's possible would be better) to prevent this shares! small informations and guide will also help me a lot to develop and secure my app better.

So please help me and gimme your suggestions.

SurvivalMachine
  • 7,946
  • 15
  • 57
  • 87
Mohammad Eskandari
  • 221
  • 1
  • 5
  • 14
  • If you are not providing access to your db via `ContentProvider` you don't have to worry as other apps won't have access to your db file unless the user device is rooted. You can also use `SQLCipher` to encrypt your db files, this way even if the file is shared they won't have read/write access to it. – Pztar Sep 01 '16 at 20:16

1 Answers1

11

You can not stop users from sharing APK rather than you can build logic which will allow or deny users from using your app.

You can do following 2 things.

1) Verifying the installer

if the installer is authentic(on which you have hosted your app) like Play Store, Amazon store then allow the user.

public static boolean verifyInstaller(final Context context) {

   final String installer = context.getPackageManager()
          .getInstallerPackageName(context.getPackageName());

   return installer != null && 
           installer.startsWith(PLAY\_STORE\_APP\_ID);

}

2) Implement Google Play Licensing with Licence Verification Library

With Google Play Licensing, your application can query Google Play at run time to obtain the licensing status for the current user, then allow or disallow further use as appropriate.

Gopal
  • 1,734
  • 1
  • 14
  • 34