Created
September 17, 2014 14:55
-
-
Save scottyab/c7f73bcc164890d84131 to your computer and use it in GitHub Desktop.
Tamper checks
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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