3131import com .yyxx .wechatfp .util .ImageUtil ;
3232import com .yyxx .wechatfp .util .StyleUtil ;
3333import com .yyxx .wechatfp .util .Task ;
34+ import com .yyxx .wechatfp .util .Tools ;
3435import com .yyxx .wechatfp .util .Umeng ;
3536import com .yyxx .wechatfp .util .ViewUtil ;
3637import com .yyxx .wechatfp .util .log .L ;
@@ -425,25 +426,44 @@ private void inputDigitPassword(Activity activity, String password) {
425426 }
426427
427428 private boolean tryInputGenericPassword (Activity activity , String password ) {
428- ViewGroup rootView = ( ViewGroup ) activity . getWindow (). getDecorView ();
429- EditText pwdEditText = findPasswordEditText (rootView );
429+
430+ EditText pwdEditText = findPasswordEditText (activity );
430431 L .d ("pwdEditText" , pwdEditText );
431432 if (pwdEditText == null ) {
432- return false ;
433+ ViewGroup rootView = (ViewGroup ) activity .getWindow ().getDecorView ();
434+ List <View > outList = new ArrayList <>();
435+ ViewUtil .getChildViews (rootView , outList );
436+ Tools .doUnSupportVersionUpload (rootView .getContext (), "[Alipay pwdEditText NOT FOUND] " + ViewUtil .viewsDesc (outList ));
433437 }
434- View confirmPwdBtn = findConfirmPasswordBtn (rootView );
438+ View confirmPwdBtn = findConfirmPasswordBtn (activity );
435439 L .d ("confirmPwdBtn" , confirmPwdBtn );
436440 if (confirmPwdBtn == null ) {
441+ ViewGroup rootView = (ViewGroup ) activity .getWindow ().getDecorView ();
442+ List <View > outList = new ArrayList <>();
443+ ViewUtil .getChildViews (rootView , outList );
444+ Tools .doUnSupportVersionUpload (rootView .getContext (), "[Alipay confirmPwdBtn NOT FOUND] " + ViewUtil .viewsDesc (outList ));
445+ return false ;
446+ }
447+ if (pwdEditText == null ) {
437448 return false ;
438449 }
439450 pwdEditText .setText (password );
440- (( View ) confirmPwdBtn . getParent ()) .performClick ();
451+ confirmPwdBtn .performClick ();
441452 return true ;
442453 }
443454
444- private EditText findPasswordEditText (ViewGroup viewGroup ) {
455+ private EditText findPasswordEditText (Activity activity ) {
456+ View pwdEditText = ViewUtil .findViewByName (activity , "com.alipay.android.phone.safepaybase" , "input_et_password" );;
457+ L .d ("pwdEditText1" , pwdEditText );
458+ if (pwdEditText instanceof EditText ) {
459+ if (!pwdEditText .isShown ()) {
460+ return null ;
461+ }
462+ return (EditText ) pwdEditText ;
463+ }
464+ ViewGroup rootView = (ViewGroup ) activity .getWindow ().getDecorView ();
445465 List <View > outList = new ArrayList <>();
446- ViewUtil .getChildViews (viewGroup , "" , outList );
466+ ViewUtil .getChildViews (rootView , "" , outList );
447467 for (View view : outList ) {
448468 if (view instanceof EditText ) {
449469 if (view .getId () != -1 ) {
@@ -458,12 +478,23 @@ private EditText findPasswordEditText(ViewGroup viewGroup) {
458478 return null ;
459479 }
460480
461- private View findConfirmPasswordBtn (ViewGroup viewGroup ) {
462-
481+ private View findConfirmPasswordBtn (Activity activity ) {
482+ View okView = ViewUtil .findViewByName (activity , "com.alipay.android.phone.safepaybase" , "button_ok" );
483+ L .d ("okView" , okView );
484+ if (okView != null ) {
485+ if (!okView .isShown ()) {
486+ return null ;
487+ }
488+ return okView ;
489+ }
490+ ViewGroup rootView = (ViewGroup ) activity .getWindow ().getDecorView ();
463491 List <View > outList = new ArrayList <>();
464- ViewUtil .getChildViews (viewGroup , "付款" , outList );
492+ ViewUtil .getChildViews (rootView , "付款" , outList );
493+ if (outList .isEmpty ()) {
494+ ViewUtil .getChildViews (rootView , "Pay" , outList );
495+ }
465496 if (outList .isEmpty ()) {
466- ViewUtil .getChildViews (viewGroup , "Pay " , outList );
497+ ViewUtil .getChildViews (rootView , "确定 " , outList );
467498 }
468499 for (View view : outList ) {
469500 if (view .getId () != -1 ) {
@@ -472,7 +503,7 @@ private View findConfirmPasswordBtn(ViewGroup viewGroup) {
472503 if (!view .isShown ()) {
473504 continue ;
474505 }
475- return view ;
506+ return ( View ) view . getParent () ;
476507 }
477508 return null ;
478509 }
0 commit comments