简体   繁体   English

PiracyChecker 无法检查应用程序是否从 Google Play 商店安装

[英]PiracyChecker fails to check whether the app is installed from Google Play Store

I'm using ' com.github.javiersantos:PiracyChecker:1.2.3 ' because my app is not yet integrates AndroidX.我正在使用“ com.github.javiersantos:PiracyChecker:1.2.3 ”,因为我的应用程序尚未集成 AndroidX。

I have numerous reports from user reviews in my app's Google Play page that they have installed the app from the Google Play Store, yet they getting the piracy warning message.我的应用程序的 Google Play 页面中有大量用户评论报告说他们已经从 Google Play 商店安装了该应用程序,但他们收到了盗版警告消息。

Here are some examples:这里有些例子:

在此处输入图像描述

Also got a user report via email:还通过 email 获得了用户报告:

在此处输入图像描述

My app have 4k reviews and only 3 of them are like this, but I don't know the exact user count because there could be users who don't comment about this issue.我的应用有 4k 条评论,其中只有 3 条是这样的,但我不知道确切的用户数量,因为可能有用户不评论这个问题。

What is going on?到底是怎么回事?

I use it like this:我这样使用它:

    public static void showPiracyActivityIfNeeded(final Activity activity) {
    if (!BuildConfig.DEBUG) {
        //Releaseb build, piracy check.
        new PiracyChecker(activity)
                .enableInstallerId(InstallerID.GOOGLE_PLAY)
                .callback(new PiracyCheckerCallback() {
                    @Override
                    public void allow() {
                    }

                    @Override
                    public void dontAllow(@NonNull PiracyCheckerError piracyCheckerError, @Nullable PirateApp pirateApp) {
                        Intent intent = new Intent(activity, PiracyWarningActivity.class);
                        activity.startActivity(intent);
                        activity.finish();
                    }
                })
                .start();
    }
}

Thanks in advance.提前致谢。

It seems that your Google Play Services are unavailable.您的 Google Play 服务似乎不可用。 Try to check it before start your PiracyActivity :在开始您的PiracyActivity之前尝试检查它:

const val PLAY_SERVICES_RESOLUTION_REQUEST = 9000

fun AppCompatActivity.checkPlayServices(): Boolean {
    val apiAvailability = GoogleApiAvailability.getInstance()
    val resultCode = apiAvailability.isGooglePlayServicesAvailable(this)
    if (resultCode != ConnectionResult.SUCCESS) {
        if (apiAvailability.isUserResolvableError(resultCode)) {
            apiAvailability.getErrorDialog(this, resultCode, PLAY_SERVICES_RESOLUTION_REQUEST)
                .show()
        }
        return false
    }
    return true
}

And then:接着:

public static void showPiracyActivityIfNeeded(final Activity activity) {
    if (!BuildConfig.DEBUG && activity.checkPlayServices()) { ...

Also note, there are a lot of devices that has Google Play Services turned off because of various reasons, so check availability of Services every time you need it.另请注意,有很多设备由于各种原因关闭了 Google Play 服务,因此请在每次需要时检查服务的可用性。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如果未安装应用程序,如何检查是否已从我的应用程序安装了应用程序? - how to check whether an app is installed from my app if the app is not installed go to play store? 如何检查是否曾经从Android中的Google Play帐户安装过该应用程序 - How to check whether the app is ever installed from google play account in android 如何知道是否通过Facebook促销或Google Play安装了应用程序? - How to know whether app is installed from Facebook promotion or Google play? 从 Google Play 商店安装应用程序时崩溃 - App is crashing when installed from Google Play store 应用:从官方Google Play商店安装还是从磁盘安装? - App: installed from official Google Play Store or from disk? 无法确定 Android 设备上是否安装了 Google Play 商店 - Cannot determine whether Google play store is installed or not on Android device 如果未安装应用,请启动Google Play商店 - Launch google play store if app is not installed 从 Play 商店更新手动安装的应用 - Update manually installed app from Play Store 由于Google Play服务8.3.0,无法从Play商店安装Android应用 - Android app can not be installed from the play store because of Google Play Services 8.3.0 检测是否从 Play 商店安装了应用程序 - Detect if an app is installed from Play store
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM