To stop your app from being distributed and repackaged in cracked form, see the below for a signature check. Then at least the only people who can make your app work are those who have got LuckyPatcher installed. Once LuckyPatcher creates a modified APK, the signature is changed.
You need to find out what your signature is when you have run a release version. In the example below it’s -343553346 .
String sigChk = MySigCheck.MySigCheck(context);
if (sigChk.equalsIgnoreCase("Y")){
handle signature pass
}
Create a class
public class MySigCheck {
public static String MySigCheck(Context context) {
String sigChk = "B";
Signature[] signature = new Signature[0];
try {
signature = context.getPackageManager().getPackageInfo(context.getPackageName(), PackageManager.GET_SIGNATURES).signatures;
Log.d("yourapp", Integer.toString(signature[0].hashCode())); << Prints your signature. Remove once you know this and have changed it below.
} catch (PackageManager.NameNotFoundException e) {
e.printStackTrace();
}
if (signature[0].hashCode() == -343553346){
sigChk = "Y";
}
return sigChk;
}
}