I'm using 'com.github.javiersantos:PiracyChecker:1.2.3' because my app is not yet integrates 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.
Here are some examples:
Also got a user report via 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.
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. Try to check it before start your 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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With