RootGuard is a robust security utility designed to harden Android applications by enforcing strict runtime environment checks. It acts as a gatekeeper, ensuring your app only runs in a trusted, secure state.
- Author: Roshani Khalane
- Created: 24th January, 2025
- Purpose: Security Management & Device Integrity
This library ensures your application is protected against common exploits by validating the environment before the app fully initializes.
- Virtual Device Prevention: Blocks the application from running on emulators (AVDs, Genymotion).
- Anti-Debugging: Disallows execution if debugging is active to prevent reverse engineering.
- Root Detection: Prevents installation or execution on rooted or jailbroken devices.
- Code Tampering Protection: Safeguards the application against unauthorized modifications.
- Dynamic Instrumentation Defense: Protection against runtime manipulation tools like Frida or Xposed.
To use the security check in your MainActivity:
securityVariable = SecurityManager.SecurityManager(this);
if (!securityVariable.getIsSecure()) {
// Show the security message and exit the app
Toast.makeText(context, result.getMessage(), Toast.LENGTH_LONG).show();
finish();
}