Requires mobile phone to support Step Counter Sensor
Root
is required to obtain read and write permissions for the stepcounter.cfg
file. The application only uses Root permissions to execute the following commands:
chmod o+rw /data/data/com.tencent.mm/MicroMsg/stepcounter.cfg
chmod o+x /data/data/com.tencent.mm/MicroMsg/
If you do not want to grant Root permission to the application, or the application does not successfully execute the command, you can also manually execute the above two commands.
Don't change too much at once, as it will be detected as an anomaly. Changing from 3k to 5w won't work, I haven't tested the others.
Supports Android 5.1 and above systems, only tested on Android 7.x systems
By studying WeChat's onSensorChanged
function, we found that the number of WeChat exercise steps is stored in the /data/data/com.tencent.mm/MicroMsg/stepcounter.cfg
file. Use the Linux file command to check the file format of stepcounter.cfg
. The result is stepcounter.cfg: Java serialization data, version 5
. This kind of file is read and written through ObjectInputStream
and ObjectOutputStream
. In fact, the stepcounter.cfg
file saves a HashMap
, and its format is:
{209=47669212487765, 201=6011, 202=150160320, 203=45, 204=1501640915492}
in
201
corresponds to the current number of steps today.202
corresponds to today’s starting time (timestamp / 10)203
corresponds to the number of steps of step counter sensor
204
corresponds to the last save time Therefore, the number of WeChat steps can be modified by modifying the value corresponding to key value 201
. When modifying, the application will call am.killBackgroundProcesses("com.tencent.mm")
to kill the background WeChat process (because the data will be read from stepcounter.cfg
only when WeChat is started, and the data will be saved at other times) .
Finally, I recommend the Hook tool Frida