diff --git a/CHANGELOG.md b/CHANGELOG.md index c571758..c557f4d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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) 🐛 修复云闪付转账弹出多个指纹支付界面 diff --git a/app/build.gradle b/app/build.gradle index 2d762b4..9ecc7e5 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -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\"" } diff --git a/app/src/main/java/com/surcumference/fingerprint/Constant.java b/app/src/main/java/com/surcumference/fingerprint/Constant.java index 6566e5a..6b84584 100644 --- a/app/src/main/java/com/surcumference/fingerprint/Constant.java +++ b/app/src/main/java/com/surcumference/fingerprint/Constant.java @@ -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; } } diff --git a/app/src/main/java/com/surcumference/fingerprint/bean/DigitPasswordKeyPadInfo.java b/app/src/main/java/com/surcumference/fingerprint/bean/DigitPasswordKeyPadInfo.java new file mode 100644 index 0000000..ecf85b6 --- /dev/null +++ b/app/src/main/java/com/surcumference/fingerprint/bean/DigitPasswordKeyPadInfo.java @@ -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 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); + } + } diff --git a/app/src/main/java/com/surcumference/fingerprint/plugin/AlipayBasePlugin.java b/app/src/main/java/com/surcumference/fingerprint/plugin/AlipayBasePlugin.java index 626a186..bf760d5 100644 --- a/app/src/main/java/com/surcumference/fingerprint/plugin/AlipayBasePlugin.java +++ b/app/src/main/java/com/surcumference/fingerprint/plugin/AlipayBasePlugin.java @@ -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; @@ -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); @@ -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), diff --git a/app/src/main/java/com/surcumference/fingerprint/plugin/WeChatBasePlugin.java b/app/src/main/java/com/surcumference/fingerprint/plugin/WeChatBasePlugin.java index 7abb49f..ff7e6b6 100644 --- a/app/src/main/java/com/surcumference/fingerprint/plugin/WeChatBasePlugin.java +++ b/app/src/main/java/com/surcumference/fingerprint/plugin/WeChatBasePlugin.java @@ -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; @@ -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; @@ -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); @@ -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)); @@ -443,6 +439,49 @@ public void onWindowDetached() { } } + private void inputDigitalPassword(Context context, EditText inputEditText, String pwd, + List 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}; diff --git a/app/src/main/java/com/surcumference/fingerprint/util/AlipayVersionControl.java b/app/src/main/java/com/surcumference/fingerprint/util/AlipayVersionControl.java index a89341a..3ba092c 100644 --- a/app/src/main/java/com/surcumference/fingerprint/util/AlipayVersionControl.java +++ b/app/src/main/java/com/surcumference/fingerprint/util/AlipayVersionControl.java @@ -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"}, @@ -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"}, @@ -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; - } - } } diff --git a/app/src/main/java/com/surcumference/fingerprint/util/WeChatVersionControl.java b/app/src/main/java/com/surcumference/fingerprint/util/WeChatVersionControl.java new file mode 100644 index 0000000..8351a69 --- /dev/null +++ b/app/src/main/java/com/surcumference/fingerprint/util/WeChatVersionControl.java @@ -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"}); + } + +} diff --git a/app/src/main/java/com/surcumference/fingerprint/util/paydialog/WeChatPayDialog.java b/app/src/main/java/com/surcumference/fingerprint/util/paydialog/WeChatPayDialog.java index 4268d66..a7e8725 100644 --- a/app/src/main/java/com/surcumference/fingerprint/util/paydialog/WeChatPayDialog.java +++ b/app/src/main/java/com/surcumference/fingerprint/util/paydialog/WeChatPayDialog.java @@ -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; @@ -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()); } } diff --git a/release/update_riru_alipay.json b/release/update_riru_alipay.json index f6d780e..22a723f 100644 --- a/release/update_riru_alipay.json +++ b/release/update_riru_alipay.json @@ -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" } \ No newline at end of file diff --git a/release/update_riru_qq.json b/release/update_riru_qq.json index 584f744..22599f4 100644 --- a/release/update_riru_qq.json +++ b/release/update_riru_qq.json @@ -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" } \ No newline at end of file diff --git a/release/update_riru_taobao.json b/release/update_riru_taobao.json index 76a3182..1c7b2f6 100644 --- a/release/update_riru_taobao.json +++ b/release/update_riru_taobao.json @@ -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" } \ No newline at end of file diff --git a/release/update_riru_unionpay.json b/release/update_riru_unionpay.json index 99f5252..aad9a3e 100644 --- a/release/update_riru_unionpay.json +++ b/release/update_riru_unionpay.json @@ -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" } \ No newline at end of file diff --git a/release/update_riru_wechat.json b/release/update_riru_wechat.json index c2ff89a..86ef0ed 100644 --- a/release/update_riru_wechat.json +++ b/release/update_riru_wechat.json @@ -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" } \ No newline at end of file diff --git a/release/update_zygisk_alipay.json b/release/update_zygisk_alipay.json index a2364bf..87f27f8 100644 --- a/release/update_zygisk_alipay.json +++ b/release/update_zygisk_alipay.json @@ -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" } \ No newline at end of file diff --git a/release/update_zygisk_qq.json b/release/update_zygisk_qq.json index 4c85abc..1d2af85 100644 --- a/release/update_zygisk_qq.json +++ b/release/update_zygisk_qq.json @@ -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" } \ No newline at end of file diff --git a/release/update_zygisk_taobao.json b/release/update_zygisk_taobao.json index 519bef9..862139a 100644 --- a/release/update_zygisk_taobao.json +++ b/release/update_zygisk_taobao.json @@ -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" } \ No newline at end of file diff --git a/release/update_zygisk_unionpay.json b/release/update_zygisk_unionpay.json index 963823d..43b3255 100644 --- a/release/update_zygisk_unionpay.json +++ b/release/update_zygisk_unionpay.json @@ -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" } \ No newline at end of file diff --git a/release/update_zygisk_wechat.json b/release/update_zygisk_wechat.json index b45d0e1..6722740 100644 --- a/release/update_zygisk_wechat.json +++ b/release/update_zygisk_wechat.json @@ -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" } \ No newline at end of file