SystemPropertyDetector

Abstract base class for detecting device tampering by examining Android system properties.

This detector works by checking specific system properties that may indicate the device has been rooted, is running custom firmware, or has other security modifications. Subclasses must provide the specific properties to check through the getProperties method.

Common properties that might indicate tampering include:

  • ro.secure=0 (indicates insecure boot)

  • ro.debuggable=1 (indicates debug build)

  • ro.build.tags=test-keys (indicates unofficial build)

  • Custom properties added by root management tools

Example usage:

class RootPropertyDetector : SystemPropertyDetector() {
override fun getProperties(): Map<String, String> {
return mapOf(
"ro.secure" to "0",
"ro.debuggable" to "1",
"ro.build.tags" to "test-keys"
)
}
}

Inheritors

Constructors

Link copied to clipboard
constructor()

Functions

Link copied to clipboard
open suspend override fun analyze(context: Context): Double

Determines if the device has been tampered with by checking system properties.