Status: Implemented and tested

System, Kernel & Build Architecture

The System subsystem connects Android userspace with the underlying Linux kernel: operating system release version, API level, monthly security patch level, Linux kernel banner, runtime virtual machine, SELinux mode, and Verified Boot status.

Android Marketing Release vs. Integer API Level

Android version numbers (e.g. "Android 12", "Android 14") are consumer marketing labels. For developers, hardware diagnostic tools, and OS sandboxing, the authoritative indicator is Build.VERSION.SDK_INT (e.g. API 31 for Android 12, API 34 for Android 14). Minor Android releases often share or bump API levels independently of marketing names.

Dalvik vs. ART Virtual Machine

Devices running Android 2.0 through 4.4 execute bytecode on the legacy Dalvik VM (JIT compilation). Android 5.0 (API 21) introduced the Android Runtime (ART) featuring Ahead-of-Time (AOT) and profile-guided compilation. Voodoo inspects the active runtime and heap limits.

SELinux & Android Verified Boot (AVB)

Security policies are verified via android.os.SELinux.isSELinuxEnforced() and bootloader properties (ro.boot.verifiedbootstate: green = OEM locked, orange = unlocked bootloader).

How Voodoo Inspects the System & Kernel

1. Primary Call & API-Level Fallback Chain

Extracted from SystemCollector.kt. Reads Build.VERSION constants, parses Linux kernel information from /proc/version via regex, and checks system security properties:

// Excerpt from com.tool3.hardwareinfo.categories.system.SystemCollector.kt
val androidRelease = Build.VERSION.RELEASE
val apiLevel = Build.VERSION.SDK_INT

// Security patch level (API 23+)
val securityPatch = if (Build.VERSION.SDK_INT >= 23) {
    ModernSystemHelper.getSecurityPatch()
} else {
    SystemPropertyReader.get("ro.build.version.security_patch", "Not Available")
}

// Linux Kernel Banner from /proc/version
val kernelInfo = KernelVersionParser.parseKernelVersion() // extracts release, builder, date

// SELinux Enforcement (API 18+)
val isEnforced = ModernSystemHelper.isSELinuxEnforced()

// Android Verified Boot state
val avbState = SystemPropertyReader.get("ro.boot.verifiedbootstate", "Not Exposed")

2. Permission & Privilege Gate

  • Build.VERSION.*, /proc/version, and SELinux query APIs require zero permissions.
  • System uptime is read safely via SystemClock.elapsedRealtime() (including deep sleep) and uptimeMillis() (awake time only).

3. Interpretation & Normalization Logic

  • Kernel Regex Parser: KernelVersionParser extracts the semantic kernel release (e.g. 4.14.113), compiler toolchain (e.g. clang version 10.0.7), build host, and build timestamp from the raw banner.
  • Uptime Formatting: Millisecond counters are formatted into human-readable days, hours, minutes, and seconds.
  • Deep Sleep Calculation: The difference between elapsedRealtime() and uptimeMillis() calculates total deep sleep duration.

4. Availability-State Triggers

  • Security patch level on Android < 6.0 triggers AvailabilityState.UNSUPPORTED (Google introduced monthly patches with Marshmallow).
  • SELinux checks on Android 2.0–4.2 trigger AvailabilityState.UNSUPPORTED.
  • Verified Boot property absent on legacy bootloaders is marked AvailabilityState.UNAVAILABLE.

Subsystem Field Inventory

Field ID Display Name Type Primary Source / API Min API
system.android_release Android Version STRING Build.VERSION.RELEASE / ro.build.version.release API 1
system.api_level API Level (SDK_INT) INTEGER Build.VERSION.SDK_INT API 4
system.security_patch Security Patch Level STRING Build.VERSION.SECURITY_PATCH (API 23+) API 23
system.kernel_release Kernel Release STRING /proc/version parser API 1
system.vm_runtime VM Runtime STRING java.vm.name / java.vm.version API 1
system.selinux_status SELinux Status STRING android.os.SELinux.isSELinuxEnforced() API 18
system.verified_boot Android Verified Boot (AVB) STRING ro.boot.verifiedbootstate API 23
system.uptime_realtime System Uptime (Total) STRING SystemClock.elapsedRealtime() API 1