Avoid copies of an app

0

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.

    
asked by Roby 29.09.2017 в 14:57
source

1 answer

0

Preventing the copying of the app is almost impossible, any moderately interested user can decompile and access any file installed on the client. The devices are unsafe environments, you can implement techniques to discourage copies such as:

  • obfuscating the code (there are professional alternatives to proguard)
  • Deploy security with a server
  • Encrypt the database

All these things make it harder to create a copy of the app, but in the long run a determined attacker can avoid all these obstacles.

    
answered by 30.09.2017 в 17:02