Skip to content

Commit

Permalink
Support WeChat 8.0.43(2460)
Browse files Browse the repository at this point in the history
  • Loading branch information
eritpchy committed Nov 5, 2023
1 parent 737cc60 commit 2685494
Show file tree
Hide file tree
Showing 19 changed files with 157 additions and 76 deletions.
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
# Changelog

### v4.8.0 (2023-11-05)
### v4.8.1 (2023-11-05)

🚩 适配 QQ 8.9.85(4766) 版本

🚩 适配 微信 8.0.43(2460) 内测版

🚩 适配 微信 8.0.42(2460)

🐛 修复云闪付转账弹出多个指纹支付界面
Expand Down
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ android {
applicationId "com.surcumference.fingerprintpay"
minSdkVersion 14
targetSdkVersion 33
versionCode 27
versionName "4.8.0"
versionCode 28
versionName "4.8.1"
buildConfigField "String", "APP_PRODUCT_NAME", "\"FingerprintPay\""
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,6 @@ public static class WeChat {
public static final int WECHAT_VERSION_CODE_8_0_18 = 2060;
public static final int WECHAT_VERSION_CODE_8_0_20 = 2100;
public static final int WECHAT_VERSION_CODE_8_0_30 = 2240;
public static final int WECHAT_VERSION_CODE_8_0_43 = 2460;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
package com.surcumference.fingerprint.bean;

import java.util.HashMap;
import java.util.Map;

public class DigitPasswordKeyPadInfo {
public String modulePackageName;
public String[] key1;
public String[] key2;
public String[] key3;
public String[] key4;
public String[] key5;
public String[] key6;
public String[] key7;
public String[] key8;
public String[] key9;
public String[] key0;

public Map<String, String[]> keys = new HashMap<>();

public DigitPasswordKeyPadInfo(String modulePackageName, String[] key1, String[] key2, String[] key3, String[] key4, String[] key5, String[] key6, String[] key7, String[] key8, String[] key9, String[] key0) {
this.modulePackageName = modulePackageName;
this.key1 = key1;
this.key2 = key2;
this.key3 = key3;
this.key4 = key4;
this.key5 = key5;
this.key6 = key6;
this.key7 = key7;
this.key8 = key8;
this.key9 = key9;
this.key0 = key0;
this.keys.put("1", key1);
this.keys.put("2", key2);
this.keys.put("3", key3);
this.keys.put("4", key4);
this.keys.put("5", key5);
this.keys.put("6", key6);
this.keys.put("7", key7);
this.keys.put("8", key8);
this.keys.put("9", key9);
this.keys.put("0", key0);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import com.surcumference.fingerprint.BuildConfig;
import com.surcumference.fingerprint.Lang;
import com.surcumference.fingerprint.R;
import com.surcumference.fingerprint.bean.DigitPasswordKeyPadInfo;
import com.surcumference.fingerprint.util.ActivityViewObserver;
import com.surcumference.fingerprint.util.AlipayVersionControl;
import com.surcumference.fingerprint.util.ApplicationUtils;
Expand Down Expand Up @@ -152,7 +153,7 @@ protected void onActivityCreated(Activity activity) {
activity.getWindow().getDecorView().setAlpha(0);
Task.onMain(1500, () -> {
int versionCode = getAlipayVersionCode(activity);
AlipayVersionControl.DigitPasswordKeyPad digitPasswordKeyPad = AlipayVersionControl.getDigitPasswordKeyPad(versionCode);
DigitPasswordKeyPadInfo digitPasswordKeyPad = AlipayVersionControl.getDigitPasswordKeyPad(versionCode);
View key1View = ViewUtils.findViewByName(activity, digitPasswordKeyPad.modulePackageName, digitPasswordKeyPad.key1);
if (key1View != null) {
showFingerPrintDialog(activity);
Expand Down Expand Up @@ -497,7 +498,7 @@ private void doSettingsMenuInject(final Activity activity) {

private void inputDigitPassword(Activity activity, String password) {
int versionCode = getAlipayVersionCode(activity);
AlipayVersionControl.DigitPasswordKeyPad digitPasswordKeyPad = AlipayVersionControl.getDigitPasswordKeyPad(versionCode);
DigitPasswordKeyPadInfo digitPasswordKeyPad = AlipayVersionControl.getDigitPasswordKeyPad(versionCode);
View ks[] = new View[] {
ViewUtils.findViewByName(activity, digitPasswordKeyPad.modulePackageName, digitPasswordKeyPad.key1),
ViewUtils.findViewByName(activity, digitPasswordKeyPad.modulePackageName, digitPasswordKeyPad.key2),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
import com.surcumference.fingerprint.Constant;
import com.surcumference.fingerprint.Lang;
import com.surcumference.fingerprint.R;
import com.surcumference.fingerprint.bean.DigitPasswordKeyPadInfo;
import com.surcumference.fingerprint.util.ActivityViewObserver;
import com.surcumference.fingerprint.util.ApplicationUtils;
import com.surcumference.fingerprint.util.BlackListUtils;
Expand All @@ -42,6 +43,7 @@
import com.surcumference.fingerprint.util.StyleUtils;
import com.surcumference.fingerprint.util.Task;
import com.surcumference.fingerprint.util.ViewUtils;
import com.surcumference.fingerprint.util.WeChatVersionControl;
import com.surcumference.fingerprint.util.drawable.XDrawable;
import com.surcumference.fingerprint.util.log.L;
import com.surcumference.fingerprint.util.paydialog.WeChatPayDialog;
Expand Down Expand Up @@ -237,6 +239,7 @@ protected void onPayDialogShown(ViewGroup rootView) {
L.d("PayDialog show");
Context context = rootView.getContext();
Config config = Config.from(context);
ViewUtils.recursiveLoopChildren(rootView);
if (config.isOn()) {
int versionCode = getWeChatVersionCode(context);
WeChatPayDialog payDialogView = WeChatPayDialog.findFrom(versionCode, rootView);
Expand Down Expand Up @@ -333,14 +336,7 @@ public void onWindowDetached() {
Toast.makeText(context, Lang.getString(R.id.toast_password_not_set_wechat), Toast.LENGTH_SHORT).show();
return;
}
if (getWeChatVersionCode(context) >= Constant.WeChat.WECHAT_VERSION_CODE_8_0_18) {
mInputEditText.getText().clear();
for (char c : pwd.toCharArray()) {
mInputEditText.append(String.valueOf(c));
}
} else {
mInputEditText.setText(pwd);
}
inputDigitalPassword(context, mInputEditText, pwd, keyboardViews, smallPayDialogFloating);
});
if (titleTextView != null) {
titleTextView.setText(Lang.getString(R.id.wechat_payview_fingerprint_title));
Expand Down Expand Up @@ -443,6 +439,49 @@ public void onWindowDetached() {
}
}

private void inputDigitalPassword(Context context, EditText inputEditText, String pwd,
List<View> keyboardViews, boolean smallPayDialogFloating) {
int versionCode = getWeChatVersionCode(context);
if (versionCode >= Constant.WeChat.WECHAT_VERSION_CODE_8_0_43) {
DigitPasswordKeyPadInfo digitPasswordKeyPad = WeChatVersionControl.getDigitPasswordKeyPad(versionCode);
inputEditText.getText().clear();
View keyboardView = keyboardViews.get(0);
// 在半高支付界面需要先激活inputEditText才能正常输入
if (!smallPayDialogFloating) {
((ViewGroup)inputEditText.getParent().getParent()).setAlpha(0.01f);
inputEditText.setVisibility(View.VISIBLE);
}
ViewGroup.LayoutParams keyboardViewParams = keyboardView.getLayoutParams();
int keyboardViewHeight = keyboardViewParams.height;
keyboardViewParams.height = 2;
inputEditText.requestFocus();
inputEditText.post(() -> {
for (char c : pwd.toCharArray()) {
View digitView = ViewUtils.findViewByName(keyboardView, context.getPackageName(),
digitPasswordKeyPad.keys.get(String.valueOf(c)));
if (digitView != null) {
ViewUtils.performActionClick(digitView);
}
}
// inputEditText.setVisibility(View.VISIBLE); 副作用反制
keyboardView.post(() -> inputEditText.setVisibility(View.GONE));
keyboardView.postDelayed(() -> {
((ViewGroup)inputEditText.getParent().getParent()).setAlpha(1f);
keyboardViewParams.height = keyboardViewHeight;
}, 1000);
});
return;
}
if (getWeChatVersionCode(context) >= Constant.WeChat.WECHAT_VERSION_CODE_8_0_18) {
inputEditText.getText().clear();
for (char c : pwd.toCharArray()) {
inputEditText.append(String.valueOf(c));
}
return;
}
inputEditText.setText(pwd);
}

private boolean isSmallPayDialogFloating(ViewGroup passwordLayout) {
ViewGroup floatRootView = ((ViewGroup) passwordLayout.getParent().getParent().getParent().getParent().getParent());
int []location = new int[]{0,0};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
package com.surcumference.fingerprint.util;

import com.surcumference.fingerprint.bean.DigitPasswordKeyPadInfo;

public class AlipayVersionControl {

public static DigitPasswordKeyPad getDigitPasswordKeyPad(int alipayVersion) {
public static DigitPasswordKeyPadInfo getDigitPasswordKeyPad(int alipayVersion) {
//10.2.0.8026
if (alipayVersion >= 291) {
return new DigitPasswordKeyPad("com.alipay.mobile.antui",
return new DigitPasswordKeyPadInfo("com.alipay.mobile.antui",
new String[]{"au_num_1"},
new String[]{"au_num_2"},
new String[]{"au_num_3"},
Expand All @@ -17,7 +19,7 @@ public static DigitPasswordKeyPad getDigitPasswordKeyPad(int alipayVersion) {
new String[]{"au_num_9"},
new String[]{"au_num_0"});
} else {
return new DigitPasswordKeyPad("com.alipay.android.phone.safepaybase",
return new DigitPasswordKeyPadInfo("com.alipay.android.phone.safepaybase",
new String[]{"key_num_1"},
new String[]{"key_num_2"},
new String[]{"key_num_3"},
Expand All @@ -30,32 +32,4 @@ public static DigitPasswordKeyPad getDigitPasswordKeyPad(int alipayVersion) {
new String[]{"key_num_0"});
}
}

public static class DigitPasswordKeyPad {
public String modulePackageName;
public String[] key1;
public String[] key2;
public String[] key3;
public String[] key4;
public String[] key5;
public String[] key6;
public String[] key7;
public String[] key8;
public String[] key9;
public String[] key0;

public DigitPasswordKeyPad(String modulePackageName, String[] key1, String[] key2, String[] key3, String[] key4, String[] key5, String[] key6, String[] key7, String[] key8, String[] key9, String[] key0) {
this.modulePackageName = modulePackageName;
this.key1 = key1;
this.key2 = key2;
this.key3 = key3;
this.key4 = key4;
this.key5 = key5;
this.key6 = key6;
this.key7 = key7;
this.key8 = key8;
this.key9 = key9;
this.key0 = key0;
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package com.surcumference.fingerprint.util;

import com.surcumference.fingerprint.Constant;
import com.surcumference.fingerprint.bean.DigitPasswordKeyPadInfo;

public class WeChatVersionControl {

public static DigitPasswordKeyPadInfo getDigitPasswordKeyPad(int versionCode) {
return new DigitPasswordKeyPadInfo(Constant.PACKAGE_NAME_WECHAT,
new String[]{"tenpay_keyboard_1"},
new String[]{"tenpay_keyboard_2"},
new String[]{"tenpay_keyboard_3"},
new String[]{"tenpay_keyboard_4"},
new String[]{"tenpay_keyboard_5"},
new String[]{"tenpay_keyboard_6"},
new String[]{"tenpay_keyboard_7"},
new String[]{"tenpay_keyboard_8"},
new String[]{"tenpay_keyboard_9"},
new String[]{"tenpay_keyboard_0"});
}

}
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.surcumference.fingerprint.util.paydialog;

import android.graphics.Color;
import android.view.View;
import android.view.ViewGroup;
import android.widget.EditText;
Expand Down Expand Up @@ -67,7 +66,6 @@ public static WeChatPayDialog findFrom(int versionCode, ViewGroup rootView) {
+ " shownInScreen: " + ViewUtils.isShownInScreen(view)
+ " attachToParent: " + (view.getParent() != null));
if (view.getParent() != null) {
view.setBackgroundColor(Color.RED);
payDialog.keyboardViews.add((View)view.getParent());
}
}
Expand Down
6 changes: 3 additions & 3 deletions release/update_riru_alipay.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"version": "4.8.0",
"versionCode": "27",
"zipUrl": "https://file.xdow.net/d/download/fingerprintpay/4.8.0/riru-module-xfingerprint-pay-alipay-v4.8.0-release.zip",
"version": "4.8.1",
"versionCode": "28",
"zipUrl": "https://file.xdow.net/d/download/fingerprintpay/4.8.1/riru-module-xfingerprint-pay-alipay-v4.8.1-release.zip",
"changelog": "https://gitee.com/eritpchy/FingerprintPay/raw/main/CHANGELOG.md"
}
6 changes: 3 additions & 3 deletions release/update_riru_qq.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"version": "4.8.0",
"versionCode": "27",
"zipUrl": "https://file.xdow.net/d/download/fingerprintpay/4.8.0/riru-module-xfingerprint-pay-qq-v4.8.0-release.zip",
"version": "4.8.1",
"versionCode": "28",
"zipUrl": "https://file.xdow.net/d/download/fingerprintpay/4.8.1/riru-module-xfingerprint-pay-qq-v4.8.1-release.zip",
"changelog": "https://gitee.com/eritpchy/FingerprintPay/raw/main/CHANGELOG.md"
}
6 changes: 3 additions & 3 deletions release/update_riru_taobao.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"version": "4.8.0",
"versionCode": "27",
"zipUrl": "https://file.xdow.net/d/download/fingerprintpay/4.8.0/riru-module-xfingerprint-pay-taobao-v4.8.0-release.zip",
"version": "4.8.1",
"versionCode": "28",
"zipUrl": "https://file.xdow.net/d/download/fingerprintpay/4.8.1/riru-module-xfingerprint-pay-taobao-v4.8.1-release.zip",
"changelog": "https://gitee.com/eritpchy/FingerprintPay/raw/main/CHANGELOG.md"
}
6 changes: 3 additions & 3 deletions release/update_riru_unionpay.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"version": "4.8.0",
"versionCode": "27",
"zipUrl": "https://file.xdow.net/d/download/fingerprintpay/4.8.0/riru-module-xfingerprint-pay-unionpay-v4.8.0-release.zip",
"version": "4.8.1",
"versionCode": "28",
"zipUrl": "https://file.xdow.net/d/download/fingerprintpay/4.8.1/riru-module-xfingerprint-pay-unionpay-v4.8.1-release.zip",
"changelog": "https://gitee.com/eritpchy/FingerprintPay/raw/main/CHANGELOG.md"
}
6 changes: 3 additions & 3 deletions release/update_riru_wechat.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"version": "4.8.0",
"versionCode": "27",
"zipUrl": "https://file.xdow.net/d/download/fingerprintpay/4.8.0/riru-module-xfingerprint-pay-wechat-v4.8.0-release.zip",
"version": "4.8.1",
"versionCode": "28",
"zipUrl": "https://file.xdow.net/d/download/fingerprintpay/4.8.1/riru-module-xfingerprint-pay-wechat-v4.8.1-release.zip",
"changelog": "https://gitee.com/eritpchy/FingerprintPay/raw/main/CHANGELOG.md"
}
6 changes: 3 additions & 3 deletions release/update_zygisk_alipay.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"version": "4.8.0",
"versionCode": "27",
"zipUrl": "https://file.xdow.net/d/download/fingerprintpay/4.8.0/zygisk-module-xfingerprint-pay-alipay-v4.8.0-release.zip",
"version": "4.8.1",
"versionCode": "28",
"zipUrl": "https://file.xdow.net/d/download/fingerprintpay/4.8.1/zygisk-module-xfingerprint-pay-alipay-v4.8.1-release.zip",
"changelog": "https://gitee.com/eritpchy/FingerprintPay/raw/main/CHANGELOG.md"
}
6 changes: 3 additions & 3 deletions release/update_zygisk_qq.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"version": "4.8.0",
"versionCode": "27",
"zipUrl": "https://file.xdow.net/d/download/fingerprintpay/4.8.0/zygisk-module-xfingerprint-pay-qq-v4.8.0-release.zip",
"version": "4.8.1",
"versionCode": "28",
"zipUrl": "https://file.xdow.net/d/download/fingerprintpay/4.8.1/zygisk-module-xfingerprint-pay-qq-v4.8.1-release.zip",
"changelog": "https://gitee.com/eritpchy/FingerprintPay/raw/main/CHANGELOG.md"
}
6 changes: 3 additions & 3 deletions release/update_zygisk_taobao.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"version": "4.8.0",
"versionCode": "27",
"zipUrl": "https://file.xdow.net/d/download/fingerprintpay/4.8.0/zygisk-module-xfingerprint-pay-taobao-v4.8.0-release.zip",
"version": "4.8.1",
"versionCode": "28",
"zipUrl": "https://file.xdow.net/d/download/fingerprintpay/4.8.1/zygisk-module-xfingerprint-pay-taobao-v4.8.1-release.zip",
"changelog": "https://gitee.com/eritpchy/FingerprintPay/raw/main/CHANGELOG.md"
}
6 changes: 3 additions & 3 deletions release/update_zygisk_unionpay.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"version": "4.8.0",
"versionCode": "27",
"zipUrl": "https://file.xdow.net/d/download/fingerprintpay/4.8.0/zygisk-module-xfingerprint-pay-unionpay-v4.8.0-release.zip",
"version": "4.8.1",
"versionCode": "28",
"zipUrl": "https://file.xdow.net/d/download/fingerprintpay/4.8.1/zygisk-module-xfingerprint-pay-unionpay-v4.8.1-release.zip",
"changelog": "https://gitee.com/eritpchy/FingerprintPay/raw/main/CHANGELOG.md"
}
6 changes: 3 additions & 3 deletions release/update_zygisk_wechat.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"version": "4.8.0",
"versionCode": "27",
"zipUrl": "https://file.xdow.net/d/download/fingerprintpay/4.8.0/zygisk-module-xfingerprint-pay-wechat-v4.8.0-release.zip",
"version": "4.8.1",
"versionCode": "28",
"zipUrl": "https://file.xdow.net/d/download/fingerprintpay/4.8.1/zygisk-module-xfingerprint-pay-wechat-v4.8.1-release.zip",
"changelog": "https://gitee.com/eritpchy/FingerprintPay/raw/main/CHANGELOG.md"
}

0 comments on commit 2685494

Please sign in to comment.