-
-
Save dariush-fathie/5dad6d37cc616d9ed07fa846cd04ec9e to your computer and use it in GitHub Desktop.
Tamper checks
This file contains hidden or 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