RootDetector – Detect Rooted Devices in Android with Ease

An open-source Kotlin library to detect root access on Android devices

Root Detector Kotlin Android Example
Introduction

Root Detector is a Kotlin-based library that detects whether an Android device has been rooted or not. The library checks for various root indicators such as the presence of root-related binary files, system properties, and superuser.apk file, etc.

Features

Easy Integration – Plug and play; requires minimal setup.

Customizable Log Levels – Supports VERBOSE, DEBUG, INFO, WARNING, ERROR.

Tag-Based Logging – Assign custom tags for better filtering in Logcat.

Debug Mode Detection – Logs only in development mode, preventing unnecessary logs in production.

Lightweight & Fast – Optimized for performance, ensuring minimal overhead.

How to use

To use the Root Detector library, simply call the isDeviceRooted() method provided by the RootDetector object. The method returns a boolean value indicating whether the device is rooted or not. Here is an example of how to use the library:

            if (RootDetector.isDeviceRooted()) {
    // Device is rooted
} else {
    // Device is not rooted
}
        
Detection Techniques

The Root Detector library uses the following techniques to detect root access on an Android device:

  • Checking for the presence of root-related binary files such as su, busybox, and magisk in common system directories.
  • Checking for the presence of the Superuser.apk file in the system directory.
  • Checking for the existence of potentially dangerous system properties.
  • Using the which command to locate the su binary file in the system’s path.
  • Detecting whether the device is using test keys or not.
Crafted In
Repository

https://github.com/thesarangal/RootDetector

Let’s Improve Together

Your reactions guide development. Please share your thoughts on new features or recommendations. Unitedly we can improve to help all.