Skip to content

Instantly share code, notes, and snippets.

@scottyab
Created September 17, 2014 14:55
Tamper checks
import android.content.Context;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageInfo;
public class InstallerCheck{
private static final String PLAY_STORE_APP_ID = "com.google.android";
public static boolean verifyInstaller(final Context context) {
final String installer = context.getPackageManager()
.getInstallerPackageName(context.getPackageName());
return installer != null
&& installer.startsWith(PLAY_STORE_APP_ID);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment