Skip to content

Commit af4cc57

Browse files
committed
Fix支付宝再充值界面不能使用指纹支付
1 parent 02da546 commit af4cc57

File tree

2 files changed

+35
-4
lines changed

2 files changed

+35
-4
lines changed

app/src/main/java/com/yyxx/wechatfp/util/ViewUtil.java

Lines changed: 32 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616

1717
import com.yyxx.wechatfp.util.log.L;
1818

19+
import java.util.ArrayList;
20+
import java.util.List;
1921
import java.util.Random;
2022
import java.util.concurrent.atomic.AtomicInteger;
2123

@@ -67,7 +69,7 @@ public static void performActionClick(View view) {
6769
height = 0;
6870
}
6971
long downTime = SystemClock.uptimeMillis();
70-
long eventTime = SystemClock.uptimeMillis() + 100;
72+
long eventTime = SystemClock.uptimeMillis() + 200;
7173

7274
float x = width > 0 ? new Random(downTime).nextInt(width) : 0;
7375
float y = height > 0 ? new Random(eventTime).nextInt(height) : 0;
@@ -114,9 +116,19 @@ public static View findViewByName(Activity activity, String packageName, String.
114116
if (id == 0) {
115117
continue;
116118
}
117-
View view = activity.findViewById(id);
118-
if (view != null) {
119-
return view;
119+
View rootView = activity.getWindow().getDecorView();
120+
List<View> viewList = new ArrayList<>();
121+
getChildViews((ViewGroup) rootView, id, viewList);
122+
int outViewListSize = viewList.size();
123+
if (outViewListSize == 1) {
124+
return viewList.get(0);
125+
} else if (outViewListSize > 1) {
126+
for (View view : viewList) {
127+
if (view.isShown()) {
128+
return view;
129+
}
130+
}
131+
return viewList.get(0);
120132
}
121133
}
122134
return null;
@@ -142,4 +154,20 @@ public static void recursiveLoopChildren(ViewGroup parent) {
142154
}
143155
}
144156
}
157+
158+
public static void getChildViews(ViewGroup parent, int id,List<View> outList) {
159+
for (int i = parent.getChildCount() - 1; i >= 0; i--) {
160+
final View child = parent.getChildAt(i);
161+
if (child == null) {
162+
continue;
163+
}
164+
if (id == child.getId()) {
165+
outList.add(child);
166+
}
167+
if (child instanceof ViewGroup) {
168+
getChildViews((ViewGroup) child, id, outList);
169+
} else {
170+
}
171+
}
172+
}
145173
}

app/src/main/java/com/yyxx/wechatfp/xposed/plugin/XposedAlipayPlugin.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,9 @@ protected void afterHookedMethod(MethodHookParam param) throws Throwable {
7474
final Activity activity = (Activity) param.thisObject;
7575
final String activityClzName = activity.getClass().getName();
7676
mCurrentActivity = activity;
77+
if (BuildConfig.DEBUG) {
78+
L.d("activity", activity, "clz", activityClzName);
79+
}
7780
if (activityClzName.contains(".UserSettingActivity")) {
7881
Task.onMain(10, () -> doSettingsMenuInject(activity));
7982
} else if (activityClzName.contains(".FlyBirdWindowActivity")) {

0 commit comments

Comments
 (0)