Example of Android modifying wechat movement steps based on xposed

Zygote is the core of Android. Every time an app is opened, zygote forks a virtual machine instance to run the app. Based on xposed, we can use Android hook technology to debug methods in APK, intercept key APIs, plug-ins, etc.

This article is based on the development of xposed module. For those who have not developed xposed module, please see this introductory tutorial "Introduction to xposed module development"

1、 Principle of wechat motion modification steps

When you click the wechat sports leaderboard, the wechat app will obtain the value of the counting sensor on the mobile phone, and then the sensor will return to the steps we walked. At this time, we use the xposed framework to hook the queue function dispatchsensorevent() of the counting sensor, which is in the class android.hardware.systemsensormanager $sensoreventqueue. When we ask the sensor, we add the corresponding steps to the value and return it to wechat motion to achieve the deception effect.

2、 Develop xposed module

1. Create a new class weixinport. The specific code is as follows:

In this code, we first filter out the requests from wechat through equals ("com. Tencent. Mm"):

Then hook the dispatchsensorevent() function in the android.hardware.systemsensormanager $sensoreventqueue class:

Before the counting sensor returns the steps to wechat movement, the steps are modified and 1168 steps are added:

In order to facilitate debugging, some data of the sensor are printed:

2. Modify xposed_ init

Xposed_ The entry of init is set to the weixinport class.

Note: the code in this category refers to the article of the great God of steaming rice on the dark cloud. The address of the article is: http://drops.wooyun.org/tips/8416

3、 Testing

After the APK is installed and restarted, open wechat movement, take a few steps and then click the leaderboard. It is found that the number of steps has increased by 1168.

The above is an example of Android modifying wechat movement steps based on xposed introduced by Xiaobian. I hope it will help you. If you have any questions, please leave me a message and Xiaobian will reply to you in time. Thank you very much for your support for the programming tips website!

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>