Skip to content
This repository has been archived by the owner on Sep 15, 2020. It is now read-only.

步数修改器总结

苇子 edited this page Sep 12, 2017 · 4 revisions

微信

微信的步数数据保存在/data/data/com.tencent.mm/MicroMsg/stepcounter.cfg/data/data/com.tencent.mm/MicroMsg/MM_stepcounter.cfg。这两个文件是Java序列化数据文件,使用ObjectInputStreamObjectOutputStream读写。

stepcounter.cfg中的数据是由SensorEventListener所在的com.tencent.mm:exdevice进程写入的,其格式如下:

{209=47669212487765, 201=11, 202=150160320, 203=45, 204=1501640915492}

其中

  • 键值201对应的就是当前今日步数
  • 键值202对应的是今日开始时间(timestamp / 10000)
  • 键值203对应的是step counter sensor的步数
  • 键值204对应的是上次保存时间
  • 键值209对应的是step counter sensor的时间戳

stepcounter.cfg中的数据由com.tencent.mm进程读取并上传今日步数,然后将上传结果写入MM_stepcounter.cfgMM_stepcounter.cfg文件格式如下:

{1=1501588258133, 2={"stepCounterRateUs":600000,"stepCounterSaveInterval":60000,"stepCounterSaveStep":50,"stepCounterMaxStep5m":1500,"deviceStepSwitch":1,"extStepApiSwitch":0,"stepExtConfig":{"version":1,"interval":7200},"stepCountUploadConfig":{"backgroundTimeInterval":60,"backgroundStepCountInterval":500}}, 3=1501640939165, 4=25}

其中:

  • 键值1对应的是啥,没看到
  • 键值2对应的的是配置
  • 键值3对应的是最后上传时间
  • 键值4对应的是最后上传步数

更改微信运动的步数很简单,只需要更改stepcounter.cfg文件中的当前今日步数,即201对应的值即可。

QQ

QQ的步数数据保存在/data/data/com.tencent.mobileqq/files/step.info。这个文件是一个加密文件,用的加密算法就是腾讯常用的TEA加密算法,网上已经又很多人给出了算法代码,我也会另外的文章中给出分析。加解密所用的密钥为4eY#X@~g.+U)2%$<

数据解密后,格式如下:

{"1504800000000_offset":0,"1504800000000_init":426,"1504800000000_total":2109,"isStepCounterEnable":true,"last_report_time":1504856818805,"1504886400000_init":2109}

其中:

  • 前缀1504800000000是今日开始时间戳
  • 前缀1504886400000是明日开始时间戳
  • 键值last_report_time对应的是最后上传时间
  • 键值_init就是今日开始时的step counter sensor的步数
  • 键值_total是当前step counter sensor的步数

这个文件由SensorEventListener所在的com.tencent.mobileqq:MSF进程写入,由com.tencent.mobileqq进程读取并上传,然后将上传结果写回step.info。当前今日步数step = _total - _init + _offset,所以更改_offset即可修改今日步数。

支付宝

支付宝使用SharedPreferences保存步数数据文件,分别是NewPedoMeterNewPedometer_privateNewPedoMeter_private主要由SensorEventLitstener所在的com.eg.android.AlipayGphone:ext进程写入,的数据如下:

<?xml version='1.0' encoding='utf-8' standalone='yes' ?>
<map>
    <string name="stepRecord">[{&quot;biz&quot;:&quot;alipay&quot;,&quot;steps&quot;:4248,&quot;time&quot;:1504162956624}]</string>
    <boolean name="step_not_keep_reg" value="false" />
    <string name="firstStep">{&quot;biz&quot;:&quot;alipay&quot;,&quot;steps&quot;:4248,&quot;time&quot;:1504162956624}</string>
</map>
  • 键值stepRecord键值对应的是一个记录数组,每条记录中的steps是保存的step counter sensor的步数,time是写入这条记录的时间,根据这些记录就可以算出一段时间内的步数,然后加上上次上传的步数就可以计算出当前步数了

NewPedoMeter数据如下:

<?xml version='1.0' encoding='utf-8' standalone='yes' ?>
<map>
    <boolean name="startup" value="true" />
    <string name="baseStep">{&quot;steps&quot;:1135,&quot;time&quot;:1504162956624}</string>
    <boolean name="checkuser" value="true" />
    <string name="userId">2088802851669638</string>
    <string name="last_stepinfo_today">{&quot;biz&quot;:&quot;alipay&quot;,&quot;steps&quot;:1133,&quot;time&quot;:1504162998266}</string>
</map>
  • 键值baseStep是当前今日步数 NewPedoMeter与当前今日步数的计算无关,只是保存com.eg.android.AlipayGphone进程上传数据的结果。计算当前今日步数时支付宝会向服务器请求上次上传的步数和上传时间,计算上次上传已来的步数,然后加上上次上传步数就是当前步数。要更改当前今日步数,只需要更改NewPedoMeter中的stepRecord的记录即可,最简单的一种方法就是只保留stepRecord中的最后一条记录,然后根据step counter sensor的当前步数相应的减小最后一条记录的steps值就可以了。

注意

在更改文件时,要注意缓存问题,否则更改无效。

无聊的人做的一点无聊、微小的工作

Clone this wiki locally