|
49 | 49 |
|
50 | 50 | import java.lang.reflect.Field;
|
51 | 51 | import java.util.ArrayList;
|
| 52 | +import java.util.Arrays; |
52 | 53 | import java.util.List;
|
53 | 54 |
|
54 | 55 | import de.robv.android.xposed.XC_MethodHook;
|
@@ -106,14 +107,8 @@ protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
|
106 | 107 | XposedHelpers.findAndHookMethod(Dialog.class, "show", new XC_MethodHook() {
|
107 | 108 | @TargetApi(21)
|
108 | 109 | protected void afterHookedMethod(MethodHookParam param) throws Throwable {
|
109 |
| - if (mWeChatVersionCode >= 1240) { // WECHAT 6.6.2 |
110 |
| - if (!"com.tencent.mm.plugin.wallet_core.ui.m".equals(param.thisObject.getClass().getName())) { |
111 |
| - return; |
112 |
| - } |
113 |
| - } else { |
114 |
| - if (!"com.tencent.mm.plugin.wallet_core.ui.l".equals(param.thisObject.getClass().getName())) { |
115 |
| - return; |
116 |
| - } |
| 110 | + if (!verifyPayDialog(param.thisObject.getClass())) { |
| 111 | + return; |
117 | 112 | }
|
118 | 113 | L.d("PayDialog Constructor", param.thisObject);
|
119 | 114 | if (Config.from(context).isOn()) {
|
@@ -513,4 +508,25 @@ private static int getWeChatVersionCode(Context context) {
|
513 | 508 | }
|
514 | 509 | return 0;
|
515 | 510 | }
|
| 511 | + |
| 512 | + private static boolean verifyPayDialog(Class targetClass) { |
| 513 | + if (!targetClass.getName().startsWith("com.tencent.mm.plugin.wallet_core.ui.")) { |
| 514 | + return false; |
| 515 | + } |
| 516 | + String method = Arrays.toString(targetClass.getDeclaredMethods()); |
| 517 | + if (!method.contains("Bankcard")) { |
| 518 | + return false; |
| 519 | + } |
| 520 | + String field = Arrays.toString(targetClass.getDeclaredFields()); |
| 521 | + if (!field.contains("MyKeyboardWindow")) { |
| 522 | + return false; |
| 523 | + } |
| 524 | + if (!field.contains("EditHintPasswdView")) { |
| 525 | + return false; |
| 526 | + } |
| 527 | + if (!field.contains("Bankcard")) { |
| 528 | + return false; |
| 529 | + } |
| 530 | + return true; |
| 531 | + } |
516 | 532 | }
|
0 commit comments