CommandDetector
Abstract base class for detecting device tampering by checking for the presence of specific commands.
This detector works by attempting to locate commands that are commonly available on rooted or compromised devices using the system's which command. Subclasses must provide the list of commands to check for through the getCommands method.
Common commands that might indicate tampering include:
su(superuser access)busybox(advanced command-line tools)magisk(systemless root solution)Custom debugging or hacking tools
The scoring system returns a Double value:
1.0indicates at least one suspicious command was found (high confidence of tampering)0.0indicates no suspicious commands were found
Example usage:
class RootCommandDetector : CommandDetector() {
override fun getCommands(): Array<String> {
return arrayOf("su", "busybox", "magisk")
}
}Content copied to clipboard