Code Monkey home page Code Monkey logo

wechatstepchanger's Introduction

微信运动步数修改器

注意

  • 需要手机支持Step Counter Sensor

  • 需要Root获取stepcounter.cfg文件的读写权限,应用仅使用Root权限执行如下命令:

    • chmod o+rw /data/data/com.tencent.mm/MicroMsg/stepcounter.cfg
    • chmod o+x /data/data/com.tencent.mm/MicroMsg/

    如果不想授予应用Root权限,或者应用没有成功执行命令,也可以手动执行上面两条命令。

支持Android 5.1以上系统,仅在Android 7.x系统上测试过

界面

主界面 加载 保存 详细界面

原理

通过研究微信的onSensorChanged函数,发现微信运动的步数是保存在/data/data/com.tencent.mm/MicroMsg/stepcounter.cfg文件里面的。用Linux的file命令检查stepcounter.cfg的文件格式,结果为stepcounter.cfg: Java serialization data, version 5。这种文件通过ObjectInputStreamObjectOutputStream来读写,实际上stepcounter.cfg文件保存的是一个HashMap, 其格式为:

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

其中

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

所以通过修改键值201对应的值就可以修改微信步数。在修改时,应用会调用am.killBackgroundProcesses("com.tencent.mm")来杀死后台微信进程(因为只有当微信启动的时候才会从stepcounter.cfg读取数据,其他时候都是保存数据)。

最后推荐一下Hook工具Frida

wechatstepchanger's People

Contributors

iweizime avatar

Watchers

imchen avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.