# SlopRoot SlopRoot is a free and open source root tool for legacy Android devices. It provides an open alternative to proprietary and bundled one-click root tools. SlopRoot enables root-install attempts on Android 2.2 through 4.4 (API 8 through 19), when the device's kernel and ROM permit the exploit. It can check for an existing root installation on Android 5.0 through 6.0; it does not try to gain root there. Android 7.0 and newer is refused. ## Warning Root access can void device warranties and can damage operating system software. Use a disposable test device. Do not run this software on a device that stores sensitive data. SlopRoot requires no network permissions. It contains no analytics, no advertising libraries, and no telemetry services. ## System components The project contains two Android applications and a native binary suite: 1. SlopRoot (`app/`): The root elevation and installer application. 2. SuManager (`sumanager/`): The open source privilege manager application. 3. Native su (`app/native/su/`): The root binary for the supported CPU architectures. The ARMv5 and ARMv6 builds link to the device's Bionic libc; the other builds are static. ## How it works 1. SlopRoot unpacks the native exploit and the open source `su` binary into its private data directory. 2. It backs up a setuid system helper from `/system/xbin` (`procrank`, `procmem`, or `librank`). 3. Dirty COW (CVE-2016-5195) replaces the helper in the Linux kernel page cache. 4. SlopRoot executes the patched helper. The helper sets UID 0 and runs the installer script as root. 5. The installer remounts `/system` read-write, copies `su` and `sumanager.apk`, sets file permissions, and restores the original system helper. 6. SlopRoot verifies root access with `su -c id`. The page cache patch is temporary. It disappears when the device reboots. ## SuManager features SuManager manages permissions for applications that request superuser privileges: - Managed Applications tab: View, toggle, and revoke root access for installed applications. - Access Logs tab: Inspect root access timestamps, caller UIDs, and executed commands. - Settings tab: Configure access logging and toast alerts. - Root Terminal: Execute shell commands directly as root. - Interactive authorization dialog: Prompt the user with Allow, Deny, and Remember options. ## Requirements - Android 2.2 through 4.4 for a root-install attempt; the kernel must be vulnerable to CVE-2016-5195. - Root installation is limited to 32-bit ARMv5, ARMv6, ARMv7, and x86. ARM64 and x86_64 are not supported for root installation. - 10 MB free storage in `/data`. ## Build instructions The project does not use Gradle. It builds directly with standard Android SDK tools. 1. Export the Android SDK location: ```sh export ANDROID_HOME="$HOME/android-sdk" export PATH="$ANDROID_HOME/build-tools/35.0.0:$ANDROID_HOME/platform-tools:$PATH" ``` 2. Build the SuManager application: ```sh ./sumanager/build.sh ``` 3. Build the SlopRoot application: ```sh ./app/build.sh ``` The build produces verified APK files: - `sumanager/build/sumanager.apk` - `app/build/sloproot.apk` The build scripts sign APKs with `apksigner` using v1, v2, and v3 schemes with `--min-sdk-version 8`. ## Test execution Run the automated test suite: ```sh ./tests/run_tests.sh ``` The test suite validates: - Policy configuration file parsing and expiry logic. - Unix domain socket wire protocol communication. - APK signatures, asset integrity across all six CPU architectures, and density icons. - Database SQLite schema and cache file synchronization. - Device information detection and CPU architecture matrix. - User interface layout symmetry, button height alignment, and icon clearances. The emulator smoke check installs and launches both apps on API 10, 15, and 19. It does not run the root exploit, and it does not cover API 8 or every OEM kernel. To run it: ```sh ./tests/verify_all_versions.sh ``` Verified screenshots are saved to `docs/screenshots/`. ## License - SlopRoot is licensed under the MIT License. See `LICENSE`. - SuManager and the native `su` binary are licensed under the Apache License, Version 2.0. See `NOTICE`. - Icons are from Pinhead Map Icons under CC0 1.0 Universal. See `NOTICE`.