Skip to content

Commit

Permalink
v1.06
Browse files Browse the repository at this point in the history
优化微信运动一键点赞卡顿;
  • Loading branch information
su committed Mar 29, 2018
1 parent 1c982b4 commit f89c98b
Show file tree
Hide file tree
Showing 4 changed files with 62 additions and 29 deletions.
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,13 @@ Xposed 微信辅助模块,实现消息防撤回、模拟位置、运动步数
![01.png](https://raw.githubusercontent.com/wuxiaosu/XposedWechatHelper/master/screenshots/01.png)
![02.png](https://raw.githubusercontent.com/wuxiaosu/XposedWechatHelper/master/screenshots/02.png)
## 下载
- release from [github](https://github.com/wuxiaosu/XposedWechatHelper/releases) [v1.05](https://github.com/wuxiaosu/XposedWechatHelper/releases/tag/v1.05)
- release from [github](https://github.com/wuxiaosu/XposedWechatHelper/releases) [v1.06](https://github.com/wuxiaosu/XposedWechatHelper/releases/tag/v1.06)
- release from [酷安](https://www.coolapk.com/apk/180057)
## v1.06
优化
微信运动一键点赞卡顿;
待解决bug
隐藏“发现页”之后,从个人资料页点击“发消息”进入聊天界面,再点击左上角返回按钮会闪退,可以在聊天界面左滑返回;
## v1.05
修复
1.语音消息撤回后无法播放;
Expand Down
4 changes: 2 additions & 2 deletions wechathelper/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ android {
applicationId "com.wuxiaosu.wechathelper"
minSdkVersion 21
targetSdkVersion 23
versionCode 6
versionName "1.05"
versionCode 7
versionName "1.06"
}

signingConfigs {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,7 @@ private void handleHook(ClassLoader classLoader, String versionName) {
new EmojiGameHook(versionName).hook(classLoader);
new MoneyHook(versionName).hook(classLoader);
new UIHook(versionName).hook(classLoader);
new ExdeviceRankHook(versionName).hook(classLoader);

ExdeviceRankHook.getInstance().init(classLoader, versionName);
RevokeMsgHook.hook(classLoader);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package com.wuxiaosu.wechathelper.hook;

import android.annotation.SuppressLint;
import android.app.Activity;
import android.view.MenuItem;
import android.view.View;
import android.widget.LinearLayout;
Expand All @@ -22,7 +24,12 @@ public class ExdeviceRankHook {
private ListView listView;
private int likeIconId = 0;

public ExdeviceRankHook(String versionName) {
private ExdeviceRankHook() {
}

private ClassLoader classLoader;

public void init(ClassLoader classLoader, String versionName) {
switch (versionName) {
case "6.6.0":
itemInfoFieldName = "lqh";
Expand All @@ -41,9 +48,22 @@ public ExdeviceRankHook(String versionName) {
itemInfoFieldName = "meX";
break;
}
if (this.classLoader == null) {
this.classLoader = classLoader;
hook(classLoader);
}
}

public void hook(final ClassLoader classLoader) {
public static ExdeviceRankHook getInstance() {
return ExdeviceRankHookHolder.instance;
}

private static class ExdeviceRankHookHolder {
@SuppressLint("StaticFieldLeak")
private static final ExdeviceRankHook instance = new ExdeviceRankHook();
}

private void hook(final ClassLoader classLoader) {
try {
Class contextMenuClazz = XposedHelpers.findClass("com.tencent.mm.ui.base.n", classLoader);
XposedHelpers.findAndHookMethod(contextMenuClazz, "a",
Expand Down Expand Up @@ -78,30 +98,38 @@ protected void afterHookedMethod(MethodHookParam param) throws Throwable {
protected void afterHookedMethod(MethodHookParam param) throws Throwable {
MenuItem menuItem = (MenuItem) param.args[0];
if (menuItem.getItemId() == 4 && listView != null) {
String nickName = "";
ListAdapter listAdapter = listView.getAdapter();
int count = listAdapter.getCount();
for (int i = 0; i < count; i++) {
Object item = listAdapter.getItem(i);
int type = listAdapter.getItemViewType(i);
if (type == 1 && item != null) {
String username = (String) XposedHelpers.getObjectField(
XposedHelpers.getObjectField(item, itemInfoFieldName),
"field_username");
if (i == 1) {
nickName = username;
continue;
}
if (!nickName.equals(username)) {
View view = ((RelativeLayout) ((LinearLayout)
((RelativeLayout) listAdapter.getView(i, null, null))
.getChildAt(1))
.getChildAt(1)).getChildAt(1);
view.performClick();
view.destroyDrawingCache();

new Thread(new Runnable() {
@Override
public void run() {
ListAdapter listAdapter = listView.getAdapter();
int rankNum = (int) XposedHelpers.getObjectField(
XposedHelpers.getObjectField(listAdapter.getItem(1),
itemInfoFieldName),
"field_ranknum");
for (int i = 3; i < listAdapter.getCount() - 1; i++) {
if (i != rankNum + 2) {
int selfLikeState = (int) XposedHelpers.getObjectField(
XposedHelpers.getObjectField(listAdapter.getItem(i),
itemInfoFieldName),
"field_selfLikeState");
if (selfLikeState == 0) {
final View view = ((RelativeLayout) ((LinearLayout)
((RelativeLayout) listAdapter.getView(i, null, null))
.getChildAt(1))
.getChildAt(1)).getChildAt(1);

((Activity) listView.getContext()).runOnUiThread(new Runnable() {
@Override
public void run() {
view.performClick();
}
});
}
}
}
}
}
}).start();
}
super.afterHookedMethod(param);
}
Expand All @@ -116,6 +144,7 @@ protected void afterHookedMethod(MethodHookParam param) throws Throwable {
super.afterHookedMethod(param);
}
});

} catch (Error | Exception e) {
XposedBridge.log(e);
}
Expand Down

0 comments on commit f89c98b

Please sign in to comment.