本文介绍了如何保护Android应用免于共享诸如ShareIT&更多的?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试开发我的字典应用程序,并且在我的应用程序中,我正在使用数据库作为字典.因此,我试图保护我的应用程序安全或阻止与ShareIT之类的某些应用程序共享我的应用程序!或CSHare等.我看到很多人会使用这些应用程序将所有应用程序与数据一起传输,而我正试图找到一种方法来停止它或以某种方式取消该应用程序.

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.

推荐答案

您不能阻止用户共享APK,而不能构建允许或拒绝用户使用您的应用的逻辑.

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

您可以做以下两件事.

1)验证安装程序

如果安装程序是真实的(您在其上托管了您的应用程序),例如Play Store,则Amazon store允许该用户.

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)通过href ="https://developer.android.com/google/play/licensing/overview.html#LVL" rel ="noreferrer">许可证验证库

2) Implement Google Play Licensing with Licence Verification Library

有了Google Play许可,您的应用程序可以在运行时查询Google Play以获得当前用户的许可状态,然后视情况允许或禁止进一步使用.

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.

这篇关于如何保护Android应用免于共享诸如ShareIT&更多的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

11-02 08:49