Replace mouse cursor with a custom one.
自定义包括鼠标指针、触控点在内的各种图片资源。
Note: You can use Magisk + RRO for better experience.
See magisk
folder for more information.
(be aware of SELinux context, btw.)
Tested on: Android 10 (AOSP), Android 12 (MIUI 13)
- Select
System framework
(package name may beandroid
orsystem
or empty, see this) in module scope and activate the module - Force stop module
- Add resources to change. Please make sure that image sizes are bigger than hotspot (cursor left-top corner / touch point), otherwise nothing will show.
- Reboot (you MUST reboot when you modify anything, or changes will not be applied until next reboot)
- Reverse engineer
/system/framework/framework-res.apk
to find out the resource ID of the cursor you want to replace.
For MiPad users, install MaxMiPad and enable No Magic Pointer
.
If you have Windows-style .ani
cursors, you can use ani2png to convert them.
For example, use ls -a *.ani | xargs -L1 ani2png
to convert all .ani
files in current directory to .png
files.
From MIUI 13, Android 12.
Resource ID | Description | HotSpot |
---|---|---|
pointer_spot_touch | Touch point | (22, 22) |
pointer_arrow | Mouse Pointer (Arrow) | (5, 5) |
pointer_hand | Mouse Pointer (Hand, for example when hover on sth. clickable) | (9, 4) |
pointer_text | Mouse Pointer (Looks like | , for editing vertical text input) |
(12, 12) |
Please note that the images may be scaled. See Android 加载 drawable 中图片后自动缩放的原理 and Android drawable微技巧,你所不知道的drawable的那些细节 and getResources().getDisplayMetrics().density 的理解 for more informaton. In my case, 360x360
on a xhdpi
device becomes 135x135
(360 * (240 / 320) / 2 = 135
, not sure). You may need to manually adjust size & padding (border) to fit size & hotspot.
Mouse-related resource-id may have a _large
suffix, used when Accessibility
-> Large mouse pointer
(大号鼠标指针
) is enabled.
- android
Home URL: https://github.com/Young-Lord/replaceCursor
Xposed Modules Repo URL: https://github.com/Xposed-Modules-Repo/moe.lyniko.replacecursor
Apache-2.0 License or MIT License are all OK.
- https://github.com/thesandipv/pointer_replacer (doesn't work for me)
- https://github.com/hujiayucc/R-Pointer (per-app configuration)
- https://github.com/quantum5/win2xcur (convert
.cur
and.ani
to Xcursor format, for Linux) - https://github.com/eworm-de/xcur2png (convert Xcursor format to
.png
, see pull requests for a better version) - 将Windows上的鼠标指针主题移植到Linux上 (convert, edit, install Windows cursors to Linux)
Currently, this module use SharedPreferences to store images, which is really shitty. Anyone is free to improve this module.
Also, I am too low to modify hotspot using Xposed. If you know how to do this, please tell me.
Also: Origin image resolution, disable scaling.