Linux /proc, /sys & Android System Properties
While standard Android apps rely exclusively on Java SDK APIs, thorough hardware diagnostics requires inspecting the underlying Linux kernel pseudo-filesystems (/proc and /sys) and system properties (getprop).
Why Kernel Structures Provide Ground Truth
Android's userland framework caches or formats hardware properties through layers of HAL (Hardware Abstraction Layer) services and settings databases. On modified ROMs, refurbished phones, or counterfeit devices, high-level properties can be spoofed in /system/build.prop. However, the Linux kernel manages physical silicon directly: the kernel cannot fake memory pages in the buddy allocator, CPU clock registers in cpufreq, or block device sectors without system instability.
Essential Kernel Diagnostic Nodes
| Path / Interface | Subsystem | What It Reveals | SELinux / Access Constraints |
|---|---|---|---|
| /proc/cpuinfo | CPU / SoC | CPU part numbers (e.g. ARM Cortex-A55, Exynos M4), CPU implementer, architecture revision, hardware platform, and CPU features/instruction sets. | Readable by normal apps |
| /proc/meminfo | RAM / Memory | Exact physical MemTotal, MemFree, page cache, kernel buffers, slab reclaimable, and zRAM swap usage. |
Readable by normal apps |
| /proc/zoneinfo | Memory Integrity | Linux buddy allocator physical page count (present and managed pages) summed across DMA, Normal, and HighMem zones. Essential for verifying real RAM. |
Readable on most kernels |
| /proc/version | Kernel Version | Full Linux kernel banner, kernel release version (e.g. 4.14.113), compiler version (GCC / Clang), build host, and build timestamp. | Readable by normal apps |
| /proc/mounts | Storage Mounts | Active filesystem mount points, filesystem types (ext4, f2fs, yaffs2), read/write status, and mount flags for all storage volumes. | Readable by normal apps |
| /sys/devices/system/cpu/ | CPU Scaling | Per-core scaling frequencies (scaling_cur_freq), hardware frequency bounds (cpuinfo_min_freq, cpuinfo_max_freq), and scaling governors. |
Partially restricted on Android 8+; cur_freq may require root |
| /sys/class/power_supply/battery/ | Battery & Charge | Factory design capacity (charge_full_design), instantaneous current (current_now), raw temperature, and voltage. |
Vendor specific; readable on many OEMs, restricted on some |
| /sys/bus/usb/devices/ | USB Subsystem | Connected USB host controllers, hub topology, peripheral VID/PID descriptors, and bus speeds. | Readable on Android kernels with USB host support |
Android System Properties (getprop / SystemProperties)
Android uses a shared memory property store managed by init. Voodoo queries properties primarily via high-performance Java reflection on internal android.os.SystemProperties.get(), falling back to shell getprop if reflection fails:
Silicon platform identifier (e.g. universal9820, msm7227, sm8450). Essential for identifying the real chipset when commercial marketing strings are omitted.
Physical DRAM capacity passed directly by the bootloader (e.g. 8GB, 0x20000000). A critical cross-check against userspace memory reporting.
Unique system build fingerprint defining brand, product name, device code, Android version, build ID, and build keys (e.g. release-keys vs test-keys).
Android Verified Boot (AVB) state: green (locked bootloader, verified OEM key), yellow (custom key), or orange (unlocked bootloader).
SELinux Sandbox Boundaries in Modern Android
Starting in Android 4.3 (permissive) and Android 5.0 (enforcing), SELinux governs every file read and property access. Third-party applications run in the unprivileged untrusted_app SELinux domain:
- Blocked Properties: Certain internal vendor properties (e.g.
ro.serialno) trigger an SELinuxavc: deniedaudit message and return empty strings in userspace. - Graceful Fallbacks: Voodoo handles SELinux denials cleanly without crashing. Blocked nodes are designated
RESTRICTED_BY_ANDROIDorROOT_REQUIRED. - Root Inspection: When an elevated shell is authorized by the user, Voodoo can query allowlisted privileged nodes outside the
untrusted_appsandbox.