├── AndroidManifest.xml
├── README.md
├── assets
└── xposed_init
├── bin
├── AndroidManifest.xml
├── HookDemo.apk
├── WeChatHook.apk
├── classes.dex
├── classes
│ └── com
│ │ └── example
│ │ └── hookdemo
│ │ ├── BuildConfig.class
│ │ ├── MainActivity$1.class
│ │ ├── MainActivity$2.class
│ │ ├── MainActivity$3.class
│ │ ├── MainActivity$4.class
│ │ ├── MainActivity$5.class
│ │ ├── MainActivity$6.class
│ │ ├── MainActivity.class
│ │ ├── MyApplication.class
│ │ ├── R$attr.class
│ │ ├── R$dimen.class
│ │ ├── R$drawable.class
│ │ ├── R$id.class
│ │ ├── R$layout.class
│ │ ├── R$string.class
│ │ ├── R$style.class
│ │ ├── R.class
│ │ └── util
│ │ ├── DaoHandler$SingleHolder.class
│ │ ├── DaoHandler.class
│ │ ├── HookUtil$1.class
│ │ ├── HookUtil$2.class
│ │ ├── HookUtil.class
│ │ ├── MyDatabaseHelpser.class
│ │ └── MyProvider.class
├── dexedLibs
│ ├── XposedBridgeApi-54-dfe945aa0eaf1d01e33df3a890283171.jar
│ ├── android-support-v4-e43042395a6938def527928bca48838b.jar
│ └── android-support-v4-ed8ec287b909923fe1578cfc0f3b53cb.jar
├── jarlist.cache
├── res
│ └── crunch
│ │ ├── drawable-hdpi
│ │ └── ic_launcher.png
│ │ ├── drawable-mdpi
│ │ └── ic_launcher.png
│ │ ├── drawable-xhdpi
│ │ └── ic_launcher.png
│ │ └── drawable-xxhdpi
│ │ └── ic_launcher.png
└── resources.ap_
├── gen
└── com
│ └── example
│ └── hookdemo
│ ├── BuildConfig.java
│ └── R.java
├── ic_launcher-web.png
├── lib
└── XposedBridgeApi-54.jar
├── libs
└── android-support-v4.jar
├── proguard-project.txt
├── project.properties
├── res
├── drawable-hdpi
│ └── ic_launcher.png
├── drawable-mdpi
│ └── ic_launcher.png
├── drawable-xhdpi
│ └── ic_launcher.png
├── drawable-xxhdpi
│ └── ic_launcher.png
├── layout
│ └── activity_main.xml
├── values-v11
│ └── styles.xml
├── values-v14
│ └── styles.xml
├── values-w820dp
│ └── dimens.xml
└── values
│ ├── dimens.xml
│ ├── strings.xml
│ └── styles.xml
├── screenshots
├── 1.png
├── 2.png
├── 3.png
├── 4.png
└── 5.png
└── src
└── com
└── example
└── hookdemo
├── MainActivity.java
├── MyApplication.java
└── util
├── DaoHandler.java
├── HookUtil.java
├── MyDatabaseHelpser.java
└── MyProvider.java
/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
10 |
11 |
17 |
20 |
23 |
26 |
27 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
41 |
42 |
43 |
44 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # WeChatHook
2 | 基于Xspoed的微信猜拳、骰子点数作弊插件!
3 |
4 | 注意:该插件是基于weixin_700版本进行hook的,其他版本请自行测试。
5 |
6 | 截图:
7 |
8 | 
9 | 
10 | 
11 | 
12 | 
--------------------------------------------------------------------------------
/assets/xposed_init:
--------------------------------------------------------------------------------
1 | com.example.hookdemo.util.HookUtil
--------------------------------------------------------------------------------
/bin/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
10 |
11 |
17 |
20 |
23 |
26 |
27 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
41 |
42 |
43 |
44 |
--------------------------------------------------------------------------------
/bin/HookDemo.apk:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chendd/WeChatHook/716a98c0a73bad00b85f69b9e5c853f5b76fd459/bin/HookDemo.apk
--------------------------------------------------------------------------------
/bin/WeChatHook.apk:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chendd/WeChatHook/716a98c0a73bad00b85f69b9e5c853f5b76fd459/bin/WeChatHook.apk
--------------------------------------------------------------------------------
/bin/classes.dex:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chendd/WeChatHook/716a98c0a73bad00b85f69b9e5c853f5b76fd459/bin/classes.dex
--------------------------------------------------------------------------------
/bin/classes/com/example/hookdemo/BuildConfig.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chendd/WeChatHook/716a98c0a73bad00b85f69b9e5c853f5b76fd459/bin/classes/com/example/hookdemo/BuildConfig.class
--------------------------------------------------------------------------------
/bin/classes/com/example/hookdemo/MainActivity$1.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chendd/WeChatHook/716a98c0a73bad00b85f69b9e5c853f5b76fd459/bin/classes/com/example/hookdemo/MainActivity$1.class
--------------------------------------------------------------------------------
/bin/classes/com/example/hookdemo/MainActivity$2.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chendd/WeChatHook/716a98c0a73bad00b85f69b9e5c853f5b76fd459/bin/classes/com/example/hookdemo/MainActivity$2.class
--------------------------------------------------------------------------------
/bin/classes/com/example/hookdemo/MainActivity$3.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chendd/WeChatHook/716a98c0a73bad00b85f69b9e5c853f5b76fd459/bin/classes/com/example/hookdemo/MainActivity$3.class
--------------------------------------------------------------------------------
/bin/classes/com/example/hookdemo/MainActivity$4.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chendd/WeChatHook/716a98c0a73bad00b85f69b9e5c853f5b76fd459/bin/classes/com/example/hookdemo/MainActivity$4.class
--------------------------------------------------------------------------------
/bin/classes/com/example/hookdemo/MainActivity$5.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chendd/WeChatHook/716a98c0a73bad00b85f69b9e5c853f5b76fd459/bin/classes/com/example/hookdemo/MainActivity$5.class
--------------------------------------------------------------------------------
/bin/classes/com/example/hookdemo/MainActivity$6.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chendd/WeChatHook/716a98c0a73bad00b85f69b9e5c853f5b76fd459/bin/classes/com/example/hookdemo/MainActivity$6.class
--------------------------------------------------------------------------------
/bin/classes/com/example/hookdemo/MainActivity.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chendd/WeChatHook/716a98c0a73bad00b85f69b9e5c853f5b76fd459/bin/classes/com/example/hookdemo/MainActivity.class
--------------------------------------------------------------------------------
/bin/classes/com/example/hookdemo/MyApplication.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chendd/WeChatHook/716a98c0a73bad00b85f69b9e5c853f5b76fd459/bin/classes/com/example/hookdemo/MyApplication.class
--------------------------------------------------------------------------------
/bin/classes/com/example/hookdemo/R$attr.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chendd/WeChatHook/716a98c0a73bad00b85f69b9e5c853f5b76fd459/bin/classes/com/example/hookdemo/R$attr.class
--------------------------------------------------------------------------------
/bin/classes/com/example/hookdemo/R$dimen.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chendd/WeChatHook/716a98c0a73bad00b85f69b9e5c853f5b76fd459/bin/classes/com/example/hookdemo/R$dimen.class
--------------------------------------------------------------------------------
/bin/classes/com/example/hookdemo/R$drawable.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chendd/WeChatHook/716a98c0a73bad00b85f69b9e5c853f5b76fd459/bin/classes/com/example/hookdemo/R$drawable.class
--------------------------------------------------------------------------------
/bin/classes/com/example/hookdemo/R$id.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chendd/WeChatHook/716a98c0a73bad00b85f69b9e5c853f5b76fd459/bin/classes/com/example/hookdemo/R$id.class
--------------------------------------------------------------------------------
/bin/classes/com/example/hookdemo/R$layout.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chendd/WeChatHook/716a98c0a73bad00b85f69b9e5c853f5b76fd459/bin/classes/com/example/hookdemo/R$layout.class
--------------------------------------------------------------------------------
/bin/classes/com/example/hookdemo/R$string.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chendd/WeChatHook/716a98c0a73bad00b85f69b9e5c853f5b76fd459/bin/classes/com/example/hookdemo/R$string.class
--------------------------------------------------------------------------------
/bin/classes/com/example/hookdemo/R$style.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chendd/WeChatHook/716a98c0a73bad00b85f69b9e5c853f5b76fd459/bin/classes/com/example/hookdemo/R$style.class
--------------------------------------------------------------------------------
/bin/classes/com/example/hookdemo/R.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chendd/WeChatHook/716a98c0a73bad00b85f69b9e5c853f5b76fd459/bin/classes/com/example/hookdemo/R.class
--------------------------------------------------------------------------------
/bin/classes/com/example/hookdemo/util/DaoHandler$SingleHolder.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chendd/WeChatHook/716a98c0a73bad00b85f69b9e5c853f5b76fd459/bin/classes/com/example/hookdemo/util/DaoHandler$SingleHolder.class
--------------------------------------------------------------------------------
/bin/classes/com/example/hookdemo/util/DaoHandler.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chendd/WeChatHook/716a98c0a73bad00b85f69b9e5c853f5b76fd459/bin/classes/com/example/hookdemo/util/DaoHandler.class
--------------------------------------------------------------------------------
/bin/classes/com/example/hookdemo/util/HookUtil$1.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chendd/WeChatHook/716a98c0a73bad00b85f69b9e5c853f5b76fd459/bin/classes/com/example/hookdemo/util/HookUtil$1.class
--------------------------------------------------------------------------------
/bin/classes/com/example/hookdemo/util/HookUtil$2.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chendd/WeChatHook/716a98c0a73bad00b85f69b9e5c853f5b76fd459/bin/classes/com/example/hookdemo/util/HookUtil$2.class
--------------------------------------------------------------------------------
/bin/classes/com/example/hookdemo/util/HookUtil.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chendd/WeChatHook/716a98c0a73bad00b85f69b9e5c853f5b76fd459/bin/classes/com/example/hookdemo/util/HookUtil.class
--------------------------------------------------------------------------------
/bin/classes/com/example/hookdemo/util/MyDatabaseHelpser.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chendd/WeChatHook/716a98c0a73bad00b85f69b9e5c853f5b76fd459/bin/classes/com/example/hookdemo/util/MyDatabaseHelpser.class
--------------------------------------------------------------------------------
/bin/classes/com/example/hookdemo/util/MyProvider.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chendd/WeChatHook/716a98c0a73bad00b85f69b9e5c853f5b76fd459/bin/classes/com/example/hookdemo/util/MyProvider.class
--------------------------------------------------------------------------------
/bin/dexedLibs/XposedBridgeApi-54-dfe945aa0eaf1d01e33df3a890283171.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chendd/WeChatHook/716a98c0a73bad00b85f69b9e5c853f5b76fd459/bin/dexedLibs/XposedBridgeApi-54-dfe945aa0eaf1d01e33df3a890283171.jar
--------------------------------------------------------------------------------
/bin/dexedLibs/android-support-v4-e43042395a6938def527928bca48838b.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chendd/WeChatHook/716a98c0a73bad00b85f69b9e5c853f5b76fd459/bin/dexedLibs/android-support-v4-e43042395a6938def527928bca48838b.jar
--------------------------------------------------------------------------------
/bin/dexedLibs/android-support-v4-ed8ec287b909923fe1578cfc0f3b53cb.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chendd/WeChatHook/716a98c0a73bad00b85f69b9e5c853f5b76fd459/bin/dexedLibs/android-support-v4-ed8ec287b909923fe1578cfc0f3b53cb.jar
--------------------------------------------------------------------------------
/bin/jarlist.cache:
--------------------------------------------------------------------------------
1 | # cache for current jar dependency. DO NOT EDIT.
2 | # format is
3 | # Encoding is UTF-8
4 |
--------------------------------------------------------------------------------
/bin/res/crunch/drawable-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chendd/WeChatHook/716a98c0a73bad00b85f69b9e5c853f5b76fd459/bin/res/crunch/drawable-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/bin/res/crunch/drawable-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chendd/WeChatHook/716a98c0a73bad00b85f69b9e5c853f5b76fd459/bin/res/crunch/drawable-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/bin/res/crunch/drawable-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chendd/WeChatHook/716a98c0a73bad00b85f69b9e5c853f5b76fd459/bin/res/crunch/drawable-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/bin/res/crunch/drawable-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chendd/WeChatHook/716a98c0a73bad00b85f69b9e5c853f5b76fd459/bin/res/crunch/drawable-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/bin/resources.ap_:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chendd/WeChatHook/716a98c0a73bad00b85f69b9e5c853f5b76fd459/bin/resources.ap_
--------------------------------------------------------------------------------
/gen/com/example/hookdemo/BuildConfig.java:
--------------------------------------------------------------------------------
1 | /** Automatically generated file. DO NOT MODIFY */
2 | package com.example.hookdemo;
3 |
4 | public final class BuildConfig {
5 | public final static boolean DEBUG = true;
6 | }
--------------------------------------------------------------------------------
/gen/com/example/hookdemo/R.java:
--------------------------------------------------------------------------------
1 | /* AUTO-GENERATED FILE. DO NOT MODIFY.
2 | *
3 | * This class was automatically generated by the
4 | * aapt tool from the resource data it found. It
5 | * should not be modified by hand.
6 | */
7 |
8 | package com.example.hookdemo;
9 |
10 | public final class R {
11 | public static final class attr {
12 | }
13 | public static final class dimen {
14 | /** Default screen margins, per the Android Design guidelines.
15 |
16 | Example customization of dimensions originally defined in res/values/dimens.xml
17 | (such as screen margins) for screens with more than 820dp of available width. This
18 | would include 7" and 10" devices in landscape (~960dp and ~1280dp respectively).
19 |
20 | */
21 | public static final int activity_horizontal_margin=0x7f040000;
22 | public static final int activity_vertical_margin=0x7f040001;
23 | }
24 | public static final class drawable {
25 | public static final int ic_launcher=0x7f020000;
26 | }
27 | public static final class id {
28 | public static final int bt_set_dice=0x7f070001;
29 | public static final int bt_set_morra=0x7f070003;
30 | public static final int tv_dice_num=0x7f070000;
31 | public static final int tv_morra_num=0x7f070002;
32 | }
33 | public static final class layout {
34 | public static final int activity_main=0x7f030000;
35 | }
36 | public static final class string {
37 | public static final int action_settings=0x7f050001;
38 | public static final int app_name=0x7f050000;
39 | }
40 | public static final class style {
41 | /**
42 | Base application theme, dependent on API level. This theme is replaced
43 | by AppBaseTheme from res/values-vXX/styles.xml on newer devices.
44 |
45 |
46 | Theme customizations available in newer API levels can go in
47 | res/values-vXX/styles.xml, while customizations related to
48 | backward-compatibility can go here.
49 |
50 |
51 | Base application theme for API 11+. This theme completely replaces
52 | AppBaseTheme from res/values/styles.xml on API 11+ devices.
53 |
54 | API 11 theme customizations can go here.
55 |
56 | Base application theme for API 14+. This theme completely replaces
57 | AppBaseTheme from BOTH res/values/styles.xml and
58 | res/values-v11/styles.xml on API 14+ devices.
59 |
60 | API 14 theme customizations can go here.
61 | */
62 | public static final int AppBaseTheme=0x7f060000;
63 | /** Application theme.
64 | All customizations that are NOT specific to a particular API-level can go here.
65 | */
66 | public static final int AppTheme=0x7f060001;
67 | }
68 | }
69 |
--------------------------------------------------------------------------------
/ic_launcher-web.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chendd/WeChatHook/716a98c0a73bad00b85f69b9e5c853f5b76fd459/ic_launcher-web.png
--------------------------------------------------------------------------------
/lib/XposedBridgeApi-54.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chendd/WeChatHook/716a98c0a73bad00b85f69b9e5c853f5b76fd459/lib/XposedBridgeApi-54.jar
--------------------------------------------------------------------------------
/libs/android-support-v4.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chendd/WeChatHook/716a98c0a73bad00b85f69b9e5c853f5b76fd459/libs/android-support-v4.jar
--------------------------------------------------------------------------------
/proguard-project.txt:
--------------------------------------------------------------------------------
1 | # To enable ProGuard in your project, edit project.properties
2 | # to define the proguard.config property as described in that file.
3 | #
4 | # Add project specific ProGuard rules here.
5 | # By default, the flags in this file are appended to flags specified
6 | # in ${sdk.dir}/tools/proguard/proguard-android.txt
7 | # You can edit the include path and order by changing the ProGuard
8 | # include property in project.properties.
9 | #
10 | # For more details, see
11 | # http://developer.android.com/guide/developing/tools/proguard.html
12 |
13 | # Add any project specific keep options here:
14 |
15 | # If your project uses WebView with JS, uncomment the following
16 | # and specify the fully qualified class name to the JavaScript interface
17 | # class:
18 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
19 | # public *;
20 | #}
21 |
--------------------------------------------------------------------------------
/project.properties:
--------------------------------------------------------------------------------
1 | # This file is automatically generated by Android Tools.
2 | # Do not modify this file -- YOUR CHANGES WILL BE ERASED!
3 | #
4 | # This file must be checked in Version Control Systems.
5 | #
6 | # To customize properties used by the Ant build system edit
7 | # "ant.properties", and override values to adapt the script to your
8 | # project structure.
9 | #
10 | # To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):
11 | #proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
12 |
13 | # Project target.
14 | target=android-20
15 | android.library.reference.1=../appcompat_v7
16 |
--------------------------------------------------------------------------------
/res/drawable-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chendd/WeChatHook/716a98c0a73bad00b85f69b9e5c853f5b76fd459/res/drawable-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/res/drawable-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chendd/WeChatHook/716a98c0a73bad00b85f69b9e5c853f5b76fd459/res/drawable-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/res/drawable-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chendd/WeChatHook/716a98c0a73bad00b85f69b9e5c853f5b76fd459/res/drawable-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/res/drawable-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chendd/WeChatHook/716a98c0a73bad00b85f69b9e5c853f5b76fd459/res/drawable-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
7 |
8 |
12 |
13 |
18 |
19 |
27 |
28 |
33 |
34 |
35 |
39 |
40 |
45 |
46 |
54 |
55 |
60 |
61 |
62 |
63 |
--------------------------------------------------------------------------------
/res/values-v11/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/res/values-v14/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
8 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/res/values-w820dp/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
8 | 64dp
9 |
10 |
11 |
--------------------------------------------------------------------------------
/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 16dp
5 | 16dp
6 |
7 |
8 |
--------------------------------------------------------------------------------
/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | WeChatHook
5 | Settings
6 |
7 |
8 |
--------------------------------------------------------------------------------
/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
14 |
15 |
16 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/screenshots/1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chendd/WeChatHook/716a98c0a73bad00b85f69b9e5c853f5b76fd459/screenshots/1.png
--------------------------------------------------------------------------------
/screenshots/2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chendd/WeChatHook/716a98c0a73bad00b85f69b9e5c853f5b76fd459/screenshots/2.png
--------------------------------------------------------------------------------
/screenshots/3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chendd/WeChatHook/716a98c0a73bad00b85f69b9e5c853f5b76fd459/screenshots/3.png
--------------------------------------------------------------------------------
/screenshots/4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chendd/WeChatHook/716a98c0a73bad00b85f69b9e5c853f5b76fd459/screenshots/4.png
--------------------------------------------------------------------------------
/screenshots/5.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chendd/WeChatHook/716a98c0a73bad00b85f69b9e5c853f5b76fd459/screenshots/5.png
--------------------------------------------------------------------------------
/src/com/example/hookdemo/MainActivity.java:
--------------------------------------------------------------------------------
1 | package com.example.hookdemo;
2 |
3 | import com.example.hookdemo.util.DaoHandler;
4 | import de.robv.android.xposed.XposedBridge;
5 | import android.app.Activity;
6 | import android.app.AlertDialog;
7 | import android.content.ContentValues;
8 | import android.content.DialogInterface;
9 | import android.database.Cursor;
10 | import android.os.Bundle;
11 | import android.view.View;
12 | import android.view.View.OnClickListener;
13 | import android.widget.Button;
14 | import android.widget.TextView;
15 |
16 | public class MainActivity extends Activity implements OnClickListener
17 | {
18 | private TextView tvDiceNum;
19 | private TextView tvMorraNum;
20 | private Button btSetDice;
21 | private Button btSetMorra;
22 | private int diceNum = 6; // 默认点数6
23 | private int morraNum = 0; // 默认剪刀
24 |
25 | String[] morraStr = { "剪刀", "石头", "布" };
26 |
27 | @Override
28 | protected void onCreate(Bundle savedInstanceState)
29 | {
30 | super.onCreate(savedInstanceState);
31 | setContentView(R.layout.activity_main);
32 |
33 | setView();
34 | setListener();
35 | setValue();
36 | }
37 |
38 | private void setValue()
39 | {
40 | // TODO Auto-generated method stub
41 | Cursor cursor = DaoHandler.getInstance().query(null, null, null, null);
42 | if (cursor != null)
43 | {
44 | while (cursor.moveToNext())
45 | {
46 | diceNum = cursor.getInt(cursor.getColumnIndex("dice_num"));
47 | tvDiceNum.setText("点数" + (diceNum + 1));
48 | }
49 | }
50 | }
51 |
52 | private void setView()
53 | {
54 | tvDiceNum = (TextView) findViewById(R.id.tv_dice_num);
55 | btSetDice = (Button) findViewById(R.id.bt_set_dice);
56 |
57 | tvMorraNum = (TextView) findViewById(R.id.tv_morra_num);
58 | btSetMorra = (Button) findViewById(R.id.bt_set_morra);
59 | }
60 |
61 | private void setListener()
62 | {
63 | btSetDice.setOnClickListener(this);
64 | btSetMorra.setOnClickListener(this);
65 | }
66 |
67 | @Override
68 | public void onClick(View view)
69 | {
70 | switch (view.getId())
71 | {
72 | case R.id.bt_set_dice: // 设置骰子点数
73 | showSetDiceDialog();
74 | break;
75 |
76 | case R.id.bt_set_morra: // 设置猜拳
77 | showSetMorraDialog();
78 | break;
79 |
80 | }
81 | }
82 |
83 | private void showSetMorraDialog()
84 | {
85 | AlertDialog.Builder builder = new AlertDialog.Builder(this);
86 | builder.setIcon(R.drawable.ic_launcher);
87 | builder.setTitle("请设置猜拳数");
88 |
89 | /**
90 | * 第一个参数指定我们要显示的一组下拉单选框的数据集合 第二个参数代表索引,指定默认哪一个单选框被勾选上
91 | * 第三个参数给每一个单选项绑定一个监听器
92 | */
93 | builder.setSingleChoiceItems(morraStr, morraNum, new DialogInterface.OnClickListener()
94 | {
95 | @Override
96 | public void onClick(DialogInterface dialog, int which)
97 | {
98 | morraNum = which;
99 | }
100 | });
101 |
102 | builder.setPositiveButton("确定", new DialogInterface.OnClickListener()
103 | {
104 | @Override
105 | public void onClick(DialogInterface dialog, int which)
106 | {
107 | saveMorraNum();
108 | }
109 | });
110 | builder.setNegativeButton("取消", new DialogInterface.OnClickListener()
111 | {
112 | @Override
113 | public void onClick(DialogInterface dialog, int which)
114 | {
115 | morraNum = 0;
116 | }
117 | });
118 |
119 | builder.show();
120 | }
121 |
122 | private void showSetDiceDialog()
123 | {
124 | AlertDialog.Builder builder = new AlertDialog.Builder(this);
125 | builder.setIcon(R.drawable.ic_launcher);
126 | builder.setTitle("请选择骰子点数");
127 | final String[] diceStr = { "点数1", "点数2", "点数3", "点数4", "点数5", "点数6" };
128 |
129 | /**
130 | * 第一个参数指定我们要显示的一组下拉单选框的数据集合 第二个参数代表索引,指定默认哪一个单选框被勾选上
131 | * 第三个参数给每一个单选项绑定一个监听器
132 | */
133 | builder.setSingleChoiceItems(diceStr, diceNum, new DialogInterface.OnClickListener()
134 | {
135 | @Override
136 | public void onClick(DialogInterface dialog, int which)
137 | {
138 | diceNum = which;
139 | }
140 | });
141 |
142 | builder.setPositiveButton("确定", new DialogInterface.OnClickListener()
143 | {
144 | @Override
145 | public void onClick(DialogInterface dialog, int which)
146 | {
147 | saveDiceNum();
148 | }
149 | });
150 | builder.setNegativeButton("取消", new DialogInterface.OnClickListener()
151 | {
152 | @Override
153 | public void onClick(DialogInterface dialog, int which)
154 | {
155 | diceNum = 6;
156 | }
157 | });
158 |
159 | builder.show();
160 | }
161 |
162 | protected void saveDiceNum()
163 | {
164 | ContentValues values = new ContentValues();
165 | values.put("dice_num", diceNum);
166 | DaoHandler.getInstance().add(values);
167 | tvDiceNum.setText("点数" + (diceNum + 1));
168 | }
169 |
170 | protected void saveMorraNum()
171 | {
172 | ContentValues values = new ContentValues();
173 | values.put("morra_num", morraNum);
174 | DaoHandler.getInstance().add(values);
175 | tvMorraNum.setText(morraStr[morraNum]);
176 | }
177 | }
178 |
--------------------------------------------------------------------------------
/src/com/example/hookdemo/MyApplication.java:
--------------------------------------------------------------------------------
1 | package com.example.hookdemo;
2 |
3 | import android.app.Application;
4 |
5 | public class MyApplication extends Application
6 | {
7 |
8 | private static MyApplication instance;
9 |
10 | @Override
11 | public void onCreate()
12 | {
13 | super.onCreate();
14 | instance = this;
15 | }
16 |
17 | public static MyApplication getInstance()
18 | {
19 | return instance;
20 | }
21 |
22 | }
23 |
--------------------------------------------------------------------------------
/src/com/example/hookdemo/util/DaoHandler.java:
--------------------------------------------------------------------------------
1 | package com.example.hookdemo.util;
2 |
3 | import android.content.ContentValues;
4 | import android.database.Cursor;
5 | import android.database.sqlite.SQLiteDatabase;
6 | import com.example.hookdemo.MyApplication;
7 |
8 | public class DaoHandler
9 | {
10 | private MyDatabaseHelpser helper;
11 |
12 | private DaoHandler()
13 | {
14 | helper = new MyDatabaseHelpser(MyApplication.getInstance());
15 | }
16 |
17 | private static class SingleHolder
18 | {
19 | private static DaoHandler instance = new DaoHandler();
20 | }
21 |
22 | public static DaoHandler getInstance()
23 | {
24 | return SingleHolder.instance;
25 | }
26 |
27 | public Cursor query(String[] projection, String selection, String[] selectionArgs, String sortOrder)
28 | {
29 | SQLiteDatabase readableDatabase = helper.getReadableDatabase();
30 | return readableDatabase.query(MyDatabaseHelpser.TABLE_NAME, projection, selection, selectionArgs, null, null, sortOrder);
31 | }
32 |
33 | public void add(ContentValues values)
34 | {
35 | SQLiteDatabase writableDatabase = helper.getWritableDatabase();
36 | int result = writableDatabase.update(MyDatabaseHelpser.TABLE_NAME, values, null, null);
37 | if(result == 0)
38 | {
39 | writableDatabase.insert(MyDatabaseHelpser.TABLE_NAME, null, values);
40 | }
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/src/com/example/hookdemo/util/HookUtil.java:
--------------------------------------------------------------------------------
1 | package com.example.hookdemo.util;
2 |
3 | import android.app.AlertDialog;
4 | import android.content.Context;
5 | import android.content.DialogInterface;
6 | import android.database.Cursor;
7 | import android.net.Uri;
8 | import android.os.Bundle;
9 | import com.example.hookdemo.R;
10 | import de.robv.android.xposed.IXposedHookLoadPackage;
11 | import de.robv.android.xposed.XC_MethodHook;
12 | import de.robv.android.xposed.XC_MethodHook.MethodHookParam;
13 | import de.robv.android.xposed.XC_MethodReplacement;
14 | import de.robv.android.xposed.XposedBridge;
15 | import de.robv.android.xposed.XposedHelpers;
16 | import de.robv.android.xposed.callbacks.XC_LoadPackage.LoadPackageParam;
17 |
18 | public class HookUtil implements IXposedHookLoadPackage
19 | {
20 | private int diceCount = 0;
21 | private int morraNum = 0; // 0-剪刀 1-石头 2-布
22 | private Context mContext;
23 |
24 | @Override
25 | public void handleLoadPackage(final LoadPackageParam lpparam) throws Throwable
26 | {
27 |
28 | if (!lpparam.packageName.equals("com.tencent.mm"))
29 | return;
30 |
31 | hookAndGetContext("com.tencent.mm.ui.MMFragmentActivity", lpparam, "onCreate");
32 |
33 | findAndHookMethod("com.tencent.mm.sdk.platformtools.bb", lpparam, "pu");
34 | }
35 |
36 | private void hookAndGetContext(String className, final LoadPackageParam lpparam, String methodName)
37 | {
38 | XposedHelpers.findAndHookMethod(className, lpparam.classLoader, methodName, Bundle.class, new XC_MethodHook()
39 | {
40 | @Override
41 | protected void beforeHookedMethod(MethodHookParam param) throws Throwable
42 | {
43 | // Hook函数之前执行的代码
44 | if (mContext == null)
45 | {
46 | mContext = (Context) param.thisObject;
47 | XposedBridge.log("获取到了Context");
48 | }
49 | }
50 |
51 | @Override
52 | protected void afterHookedMethod(final MethodHookParam param) throws Throwable
53 | {
54 | }
55 | });
56 | }
57 |
58 | /**
59 | * @param className
60 | * 全路径类名:包名 + 类名
61 | * @param methodName
62 | * 需要hook的方法名
63 | * @description:
64 | * @date: 2016-1-18 下午5:02:55
65 | * @author: yems
66 | */
67 | private void findAndHookMethod(String className, final LoadPackageParam lpparam, String methodName)
68 | {
69 | XposedHelpers.findAndHookMethod(className, lpparam.classLoader, methodName, int.class, new XC_MethodReplacement()
70 | {
71 |
72 | @Override
73 | protected Object replaceHookedMethod(MethodHookParam param) throws Throwable
74 | {
75 | int gameType = (int) param.args[0];
76 |
77 | switch (gameType)
78 | {
79 | case 5: // 摇骰子
80 | Uri diceUri = Uri.parse("content://com.example.hookdemo.provider/wx_plugs_setting");
81 | Cursor diceCursor = mContext.getContentResolver().query(diceUri, null, null, null, null);
82 | if (diceCursor != null)
83 | {
84 | while (diceCursor.moveToNext())
85 | {
86 | diceCount = diceCursor.getInt(diceCursor.getColumnIndex("dice_num"));
87 | XposedBridge.log("查询获取骰子数为:" + diceCount);
88 | }
89 | }
90 | break;
91 |
92 | case 2: // 猜拳
93 |
94 | Uri morraUri = Uri.parse("content://com.example.hookdemo.provider/wx_plugs_setting");
95 | Cursor morraCursor = mContext.getContentResolver().query(morraUri, null, null, null, null);
96 | if (morraCursor != null)
97 | {
98 | while (morraCursor.moveToNext())
99 | {
100 | diceCount = morraCursor.getInt(morraCursor.getColumnIndex("morra_num"));
101 | XposedBridge.log("查询猜拳数为:" + morraNum);
102 | }
103 | }
104 | break;
105 |
106 | }
107 |
108 | XposedBridge.log("replaceHookedMethod--函数返回值:" + diceCount);
109 | return diceCount;
110 | }
111 | });
112 | }
113 |
114 | }
115 |
--------------------------------------------------------------------------------
/src/com/example/hookdemo/util/MyDatabaseHelpser.java:
--------------------------------------------------------------------------------
1 | package com.example.hookdemo.util;
2 |
3 | import android.content.Context;
4 | import android.database.sqlite.SQLiteDatabase;
5 | import android.database.sqlite.SQLiteOpenHelper;
6 |
7 | public class MyDatabaseHelpser extends SQLiteOpenHelper
8 | {
9 | private static String DATABASE_NAME = "WxPlugs.db";
10 | public static final String TABLE_NAME = "wx_plugs_setting";
11 | private static int DATABASE_VERSION = 2;
12 |
13 | public MyDatabaseHelpser(Context context)
14 | {
15 | super(context, DATABASE_NAME, null, DATABASE_VERSION);
16 | }
17 |
18 | @Override
19 | public void onCreate(SQLiteDatabase db)
20 | {
21 | db.execSQL("Create table " + TABLE_NAME + "( _id INTEGER PRIMARY KEY AUTOINCREMENT, dice_num INTEGER, morra_num INTEGER);");
22 | }
23 |
24 | @Override
25 | public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion)
26 | {
27 | db.execSQL("DROP TABLE IF EXISTS " + TABLE_NAME);
28 | onCreate(db);
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/src/com/example/hookdemo/util/MyProvider.java:
--------------------------------------------------------------------------------
1 | package com.example.hookdemo.util;
2 |
3 | import android.content.ContentProvider;
4 | import android.content.ContentValues;
5 | import android.content.UriMatcher;
6 | import android.database.Cursor;
7 | import android.database.sqlite.SQLiteDatabase;
8 | import android.net.Uri;
9 |
10 | public class MyProvider extends ContentProvider
11 | {
12 | private final static String AUTHORITIES = "com.example.hookdemo.provider";
13 | private final static int DICE = 1;
14 | private final static int MORRA = 2;
15 | private MyDatabaseHelpser mMyDatabaseHelpser;
16 |
17 | private static UriMatcher mUriMatcher;
18 |
19 | static
20 | {
21 | mUriMatcher = new UriMatcher(UriMatcher.NO_MATCH);
22 | mUriMatcher.addURI(AUTHORITIES, "wx_plugs_setting", DICE); // 骰子
23 | mUriMatcher.addURI(AUTHORITIES, "wx_plugs_setting/#", DICE); // 骰子
24 | mUriMatcher.addURI(AUTHORITIES, "wx_plugs_setting", MORRA); // 猜拳
25 | mUriMatcher.addURI(AUTHORITIES, "wx_plugs_setting/#", MORRA); // 猜拳
26 | }
27 |
28 | @Override
29 | public boolean onCreate()
30 | {
31 | mMyDatabaseHelpser = new MyDatabaseHelpser(getContext());
32 | return (mMyDatabaseHelpser == null) ? false : true;
33 | }
34 |
35 | @Override
36 | public Cursor query(Uri uri, String[] projection, String selection, String[] selectionArgs, String sortOrder)
37 | {
38 | return DaoHandler.getInstance().query(projection, selection, selectionArgs, sortOrder);
39 | }
40 |
41 | @Override
42 | public String getType(Uri uri)
43 | {
44 | return "vnd.android.cursor.dir/vnd." + AUTHORITIES + "." + MyDatabaseHelpser.TABLE_NAME;
45 | }
46 |
47 | @Override
48 | public Uri insert(Uri uri, ContentValues values)
49 | {
50 | // TODO Auto-generated method stub
51 | return null;
52 | }
53 |
54 | @Override
55 | public int delete(Uri uri, String selection, String[] selectionArgs)
56 | {
57 | // TODO Auto-generated method stub
58 | return 0;
59 | }
60 |
61 | @Override
62 | public int update(Uri uri, ContentValues values, String selection, String[] selectionArgs)
63 | {
64 | // TODO Auto-generated method stub
65 | return 0;
66 | }
67 | }
68 |
--------------------------------------------------------------------------------