A Magisk module and Android companion app for controlling and automating the internal cooling fan found in supported RedMagic devices.
Currently:
Planned:
- Fan status monitoring
- Fan speed control
- Call-based fan behavior
- Local socket API
- Native Android companion app
Early development
Current progress:
- Magisk module structure
- daemon - Refer to redmagicfancontrold for updates on the daemon
- Device detection
- Call state monitoring
- Temp-based fan curves
- API
- Android app
- RPM monitoring
- Multi-device support
Planned support:
- RedMagic 9 Pro
Additional devices may be supported if compatible fan interfaces are available.
- Magisk
- Root access
- Supported RedMagic device
- Android 12+ (API 31+)
- Root access (granted to the app in Magisk) - the daemon's socket and config are root-only, so the app reaches them through
suandnc -U
The app lives in RedMagicFanControlApp/ (Kotlin, Jetpack Compose, package com.unofficialvim.redmagicfancontrol).
-
JDK 17 or newer (21 recommended). Set
JAVA_HOME, or let Android Studio use its bundled JDK. A JetBrains-vendor JDK is not required. -
Android SDK with the Android 36 platform (
compileSdk = 36). Easiest way is Android Studio; otherwise usesdkmanager "platforms;android-36" "build-tools;36.0.0". -
Tell Gradle where the SDK is, either by setting
ANDROID_HOMEor by creatingRedMagicFanControlApp/local.properties(git-ignored; Android Studio creates it for you):sdk.dir=C\:/Users/<you>/AppData/Local/Android/Sdk
The Gradle wrapper (9.6.0) is checked in, so no separate Gradle install is needed.
From RedMagicFanControlApp/:
# Windows
gradlew.bat assembleDebug
# Linux / macOS
./gradlew assembleDebug
The APK is written to app/build/outputs/apk/debug/app-debug.apk. With a device (or emulator) connected, gradlew installDebug builds and installs it in one step.
Or open RedMagicFanControlApp/ in Android Studio and press Run.
Open Settings (gear icon, top right) and set:
- Config file - path of the daemon's
config.json. The app reads it into memory and rewrites it when you edit profiles, then sendsreloadConfigto the daemon. - Daemon socket - the daemon creates
rmfc_socketin its working directory. The defaults (/data/adb/modules/redmagic-fan-control/...) are only guesses; point them at the real locations.
Then tap Connection test. It checks the socket, su, nc -U and the config file, and prints a log you can copy. The app connects directly if it can, and otherwise through su -c "nc -U <socket>", so grant it root in Magisk when prompted.
- The Android emulator's
suonly works for the shell user, so the root bridge can't be exercised there; test on a rooted device. The UI and config editing work fine on an emulator. - The daemon serves one client at a time, so close other socket clients (e.g.
socat) while using the app.
This project modifies fan behavior at the system level. Use at your own risk. The authors are not responsible for overheating, hardware damage, data loss, or other issues resulting from use of this software.