Created
June 19, 2020 18:41
-
-
Save zrkb/772eca8180928d117a18be183ee12c87 to your computer and use it in GitHub Desktop.
Check if Android App was installed from Google Play
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
| val installer = context.packageManager.getInstallerPackageName(context.packageName) | |
| val validInstallers = ArrayList(Arrays.asList("com.android.vending", "com.google.android.feedback")) | |
| var check: Boolean = (installer != null && validInstallers.contains(installer) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment