Created
January 12, 2015 08:03
-
-
Save omegasoft7/d2e3b448e00d12555b9e to your computer and use it in GitHub Desktop.
Check if the app is debuggable
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
/** | |
* Returns true if the application is debuggable. | |
* | |
* @return true if the application is debuggable. | |
*/ | |
static boolean isDebuggable() { | |
PackageManager pm = mApplication.getPackageManager(); | |
try { | |
return ((pm.getApplicationInfo(mApplication.getPackageName(), 0).flags & ApplicationInfo.FLAG_DEBUGGABLE) > 0); | |
} catch (NameNotFoundException e) { | |
return false; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment