I had already asked a similar question, I was told to use Google licenses to prevent users from sharing my application via Bluetooth or other means. But it did not work for me, in the end I chose to get the android ID and compare it with SharedPreferences, the idea would be that when the application passes through Bluetooth it is verified that it is not the same data so it would be shown as an illegal copy, this is how I did:
String ID = Secure.getString(getBaseContext().getContentResolver(), Secure.ANDROID_ID);
myPreferences = PreferenceManager.getDefaultSharedPreferences(SplashActivity.this);
SharedPreferences.Editor myEditor = myPreferences.edit();
//Aqui comprobamos si es copia
String name = myPreferences.getString("NOMBRE", "unknown");
if (name.equals("")) {
myEditor.putString("NOMBRE", ID);
myEditor.commit();
Toast.makeText(getApplicationContext(), "No es copia", Toast.LENGTH_SHORT).show();
} else if (!name.equals(ID)) {
Toast.makeText(getApplicationContext(), "Es copia", Toast.LENGTH_SHORT).show();
}
I probably have an erroneous idea of how to do it, but in the end what I want is to prevent a paid user from sharing the app. In advance, thank you.