Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to secure an Android app against sharing apps like ShareIT & more?

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.

like image 486
Mohammad Eskandari Avatar asked Sep 01 '16 19:09

Mohammad Eskandari


1 Answers

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.

like image 66
Gopal Avatar answered Oct 13 '22 18:10

Gopal