[英]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.