Created
September 17, 2020 09:12
-
-
Save iniyan455/55cbffad4ec8aec6f6568dbc901afb93 to your computer and use it in GitHub Desktop.
Temparing code to find in android code
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
And now you just need to call the method isHacked from your onCreate method in your initial Activity to check that your application was renamed or relocated. | |
public boolean isHacked(Context context, String myPackageName, String google, String amazon) | |
{ | |
//Renamed? | |
if (context.getPackageName().compareTo(myPackageName) != 0) { | |
return true; // BOOM! | |
} | |
//Relocated? | |
String installer = context.getPackageManager().getInstallerPackageName(myPackageName); | |
if (installer == null){ | |
return true; // BOOM! | |
} | |
if (installer.compareTo(google) != 0 && installer.compareTo(amazon) != 0){ | |
return true; // BOOM! | |
} | |
return false; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment