AKTune is an adaptive Magisk module that tunes common Android kernel/sysfs knobs to improve real-world responsiveness and UI smoothness while keeping idle behavior relaxed.
Unlike static "one profile 24/7" tuners, AKTune can run in multiple runtime modes and apply profiles dynamically in a safe, capability-aware way.
AKTune supports 3 modes, switchable anytime using Magisk's Action button:
-
AUTO (default)
- Screen ON → Aggressive profile
- Screen OFF → Strict profile
- This is the intended "fast when you use it, calm when you don't" behavior.
-
AGGRESSIVE
- Always runs the Aggressive profile
- Ignores screen state
-
STRICT
- Always runs the Strict profile
- Ignores screen state
AKTune includes an action.sh script for Magisk Manager.
Each tap cycles:
AUTO → AGGRESSIVE → STRICT → AUTO
The current mode is also printed clearly inside Magisk's output window and takes effect immediately (the daemon is restarted automatically).
Only touches nodes that exist on your device. No hardcoded SoC layouts. Every time AKTune changes a sysfs/proc node for the first time, it saves the original value so it can restore it later.
Users can tune behavior via:
/data/adb/aktune/config.props
AKTune does not overclock beyond vendor limits and does not disable thermal throttling.
Depending on the runtime mode:
-
AUTO:
- Detects interactive state (screen ON/OFF)
- Applies ON profile when interactive
- Applies OFF profile when idle
- Uses debounce logic + stable-state confirmation to avoid rapid toggling
-
AGGRESSIVE:
- Forces interactive profile permanently
-
STRICT:
- Forces idle profile permanently
- When AKTune writes a node the first time, it stores the original value in a TSV database
- On uninstall, it restores those captured baseline values where possible
AKTune checks for major subsystems and enables tuning blocks only if supported:
- CPUFreq:
/sys/devices/system/cpu/cpufreq - GPU devfreq:
/sys/class/devfreq - UCLAMP:
/dev/stune/*/uclamp.*/dev/cpuset/*/uclamp.*- or cgroup v2
cpu.uclamp.*
- zswap:
/sys/module/zswap - zram:
/sys/block/zram0 - MGLRU:
/sys/kernel/mm/lru_gen - Memory class: derived from
MemTotal(small / medium / large)
All activity is logged to:
/data/adb/aktune/logs/aktune.log
AKTune can tune these categories depending on kernel support:
-
Scheduler + overhead sysctls
e.g. perf events CPU time limit, schedstats disable, timer migration -
CPU governor selection + schedutil ramp behavior
Cluster-tier-aware settings (little / big / prime) -
UCLAMP + sched_boost
Prioritizes top-app / foreground and reduces background interference -
Migration thresholds
Moves tasks to bigger cores sooner while interactive -
Touch/input boost hooks (OEM dependent)
Enables short boost windows for better touch-to-frame responsiveness -
GPU devfreq governor + minimum freq bias
Keeps GPU from dropping too low during UI bursts (interactive-biased) -
I/O queue tuning
Read-ahead, iostats toggle, rq_affinity, scheduler preference -
Memory (VM) tuning
Dirty ratios, cache pressure, compaction, stat interval, optional min_free_kbytes -
cpuset placement (if supported)
Protects foreground performance by restricting background groups to little CPUs -
Networking latency flags (optional)
tcp_low_latency and optional timestamps disable
Install like a standard Magisk module:
- Flash the AKTune zip in Magisk
- Reboot
Magisk v20.4+ recommended.
AKTune uses this stage to:
- Create
/data/adb/aktunedirectories - Ensure script permissions are correct
- Create baseline/log/config files if missing
No heavy tuning is applied here.
After Android finishes booting:
- Waits for
sys.boot_completed=1 - Starts the adaptive daemon in the background:
tweaks/daemon.sh
The daemon becomes the main runtime tuning engine.
aktune.sh is a one-time tuning pass (conservative defaults).
It is included mainly for manual usage / debugging.
You can run it manually (optional):
su -c sh /data/adb/modules/aktune/aktune.shAKTune reads configuration from:
/data/adb/aktune/config.props
This file is persistent across reboots and module updates.
The module ships a preset:
common/config.default.props
On first run, AKTune will populate /data/adb/aktune/config.props from this preset if the config file is missing/empty.
This preset is designed so that:
- Interactive behavior (ON profile) is strongly optimized for responsiveness
- Idle behavior (OFF profile) becomes more strict / battery oriented
Preset file: common/config.default.props
Example values included in the preset:
-
Daemon cadence:
daemon.interval_secdaemon.debounce_msdaemon.boost_ms
-
UCLAMP behavior:
uclamp.top.min.interactiveuclamp.top.min.boost
-
CPU schedutil ramp limits:
cpu.schedutil.on.{tier}.up/downcpu.schedutil.off.{tier}.up/down
-
I/O behavior:
io.read_ahead_kb.on/offio.nr_requests.on/offio.nomerges.on/offio.rq_affinity.enable/valueio.iostats.disable
-
Network:
net.tcp_low_latency.enablenet.tcp_timestamps.disable
-
Touch boost:
touchboost.ms
-
GPU min floor:
gpu.min_freq_pct.on/off
Open and modify:
/data/adb/aktune/config.props
Example:
su
vi /data/adb/aktune/config.propsThe daemon reads values at runtime, but the safest workflow is:
- Edit config
- Reboot
To re-apply the shipped preset:
su -c cp /data/adb/modules/aktune/common/config.default.props /data/adb/aktune/config.props
su -c rebootAKTune stores persistent state under:
-
Logs:
/data/adb/aktune/logs/aktune.log
-
Baseline DB (for restore on uninstall):
/data/adb/aktune/state/baseline.tsv
-
Daemon PID:
/data/adb/aktune/state/daemon.pid
-
Forced runtime mode:
/data/adb/aktune/state/force_mode
A simple TSV database:
<path> <original_value>
This allows best-effort restore on uninstall.
Log file:
/data/adb/aktune/logs/aktune.log
You should see entries such as:
-
Capability detection summary
-
Mode state changes:
MODE: auto/MODE: aggressive/MODE: strict -
Profile transitions:
PROFILE: ONPROFILE: OFF
-
Successful writes:
Set: <path> = <value> -
Write failures (if blocked by kernel/SELinux)
-
"Write verify mismatch" warnings for bracketed sysfs formats (handled safely)
To inspect the last lines:
su -c tail -n 200 /data/adb/aktune/logs/aktune.logOn uninstall, AKTune runs:
uninstall.sh
It performs:
- Baseline restore from
baseline.tsv - Optional cleanup of AKTune state directory (currently enabled)
This makes removal best-effort clean, even if the module touched dozens of nodes.
AKTune is intentionally performance-focused during interactive usage.
Depending on device/kernel, you may observe:
- Higher peak temperatures under long interactive sessions
- Faster battery drain during active use
- Improved touch response and smoother UI bursts
AKTune does NOT:
- Overclock CPU/GPU beyond vendor maximums
- Disable thermal throttling
- Patch Android framework services (pure sysfs/proc tuning)
- Your kernel may not expose common tuning nodes
- Some OEM kernels ignore writes or lock them down
Check logs:
su -c tail -n 200 /data/adb/aktune/logs/aktune.logCommon reasons:
- Node exists but write is denied
- SELinux restrictions
- Kernel ignores the value
AKTune will mark problematic nodes and avoid repeated spam where possible.
Check:
su -c cat /data/adb/aktune/state/daemon.pid
su -c ps -A | grep -i daemon.shIf needed, reboot (Magisk service will restart it).
build.sh produces:
AKTune-v2.0.zip
Example:
./build.sh- CPU ramps faster (schedutil tuning + tier awareness)
- top-app gets priority (UCLAMP clamps + sched_boost)
- touch triggers short boosts (input/touchboost hooks)
- GPU doesn't drop too low (min floor during interactive)
- background interference reduced (cpuset + clamps)
- idle mode turns it all back down (AUTO/STRICT)
That combination reduces "Android jitter" on most modern kernels.
| App | What it does |
|---|---|
| IR Blaster | Control and test infrared functionality for compatible devices. |
| USBDevInfo | Inspect USB device details and behavior to understand what's really connected. |
| GadgetFS | Experiment with USB gadget functionality (hardware-adjacent, low-level). |
| TapDucky | A security/testing tool for controlled keystroke injection workflows. |
| HIDWiggle | A mouse jiggler built with USB gadget functionalities. |
| AKTune (Android Kernel Tweaker) | Adaptive Android kernel auto-tuner for CPU/GPU/scheduler/memory/I-O. (Magisk Module). |