From eba1917ad028aa37a54d8644bb8e703ed7c7ad6a Mon Sep 17 00:00:00 2001 From: Jason Date: Thu, 15 Jun 2023 23:00:37 +0800 Subject: [PATCH] =?UTF-8?q?+=204.7.2=20fixed=20=E7=BD=91=E7=BB=9C=E5=A4=AA?= =?UTF-8?q?=E6=85=A2=E5=AF=BC=E8=87=B4=E6=94=AF=E4=BB=98=E8=AE=BE=E7=BD=AE?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E5=8A=A0=E8=BD=BD=E8=B6=85=E6=97=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/build.gradle | 2 +- .../fingerprint/plugin/AlipayBasePlugin.java | 19 +++++++++++++++-- .../util/ActivityViewObserver.java | 21 ++++++++++--------- release/update_riru_alipay.json | 4 ++-- release/update_riru_qq.json | 4 ++-- release/update_riru_taobao.json | 4 ++-- release/update_riru_unionpay.json | 4 ++-- release/update_riru_wechat.json | 4 ++-- release/update_zygisk_alipay.json | 4 ++-- release/update_zygisk_qq.json | 4 ++-- release/update_zygisk_taobao.json | 4 ++-- release/update_zygisk_unionpay.json | 4 ++-- release/update_zygisk_wechat.json | 4 ++-- 13 files changed, 49 insertions(+), 33 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index a30e333..34b125d 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -9,7 +9,7 @@ android { minSdkVersion 14 targetSdkVersion 30 versionCode 23 - versionName "4.7.1" + versionName "4.7.2" buildConfigField "String", "APP_PRODUCT_NAME", "\"FingerprintPay\"" } 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 5e89d07..626a186 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.util.ActivityViewObserver; import com.surcumference.fingerprint.util.AlipayVersionControl; import com.surcumference.fingerprint.util.ApplicationUtils; import com.surcumference.fingerprint.util.BlackListUtils; @@ -57,6 +58,7 @@ public class AlipayBasePlugin { private boolean mIsViewTreeObserverFirst; private int mAlipayVersionCode; + private ActivityViewObserver mSettingPageEnteredObserver; private int getAlipayVersionCode(Context context) { if (mAlipayVersionCode != 0) { @@ -75,8 +77,21 @@ protected void onActivityCreated(Activity activity) { } int alipayVersionCode = getAlipayVersionCode(activity); if (alipayVersionCode >= 773 /** 10.3.80.9100 */ && activityClzName.contains(".FBAppWindowActivity")) { - Task.onMain(500, () -> doSettingsMenuInject_10_1_38(activity)); - Task.onMain(1000, () -> doSettingsMenuInject_10_1_38(activity)); + + ActivityViewObserver activityViewObserver = mSettingPageEnteredObserver; + if (activityViewObserver != null) { + activityViewObserver.stop(); + mSettingPageEnteredObserver = null; + } + activityViewObserver = new ActivityViewObserver(activity); + activityViewObserver.setViewIdentifyText("支付密码", "支付密碼", "Payment Password"); + activityViewObserver.start(100, (observer, view) -> doSettingsMenuInject_10_1_38(activity)); + mSettingPageEnteredObserver = activityViewObserver; + ActivityViewObserver finalActivityViewObserver = activityViewObserver; + Task.onBackground(30000, () -> { + mSettingPageEnteredObserver = null; + finalActivityViewObserver.stop(); + }); } else if (activityClzName.contains(".MySettingActivity")) { Task.onMain(100, () -> doSettingsMenuInject_10_1_38(activity)); } else if (activityClzName.contains(".UserSettingActivity")) { diff --git a/app/src/main/java/com/surcumference/fingerprint/util/ActivityViewObserver.java b/app/src/main/java/com/surcumference/fingerprint/util/ActivityViewObserver.java index 948d165..7ec3761 100644 --- a/app/src/main/java/com/surcumference/fingerprint/util/ActivityViewObserver.java +++ b/app/src/main/java/com/surcumference/fingerprint/util/ActivityViewObserver.java @@ -18,7 +18,7 @@ public class ActivityViewObserver { private WeakReference mActivityRef; private boolean mRunning = false; private String mViewIdentifyType; - private String mViewIdentifyText; + private String[] mViewIdentifyTexts; public ActivityViewObserver(Activity weakRefActivity) { this.mActivityRef = new WeakReference<>(weakRefActivity); @@ -28,13 +28,13 @@ public void setViewIdentifyType(String viewIdentifyType) { this.mViewIdentifyType = viewIdentifyType; } - public void setViewIdentifyText(String viewIdentifyText) { - this.mViewIdentifyText = viewIdentifyText; + public void setViewIdentifyText(String ...viewIdentifyTexts) { + this.mViewIdentifyTexts = viewIdentifyTexts; } public void start(long loopMSec, IActivityViewListener listener) { - if (TextUtils.isEmpty(this.mViewIdentifyType) && TextUtils.isEmpty(this.mViewIdentifyText)) { - throw new IllegalArgumentException("Error: ViewIdentifyType or ViewIdentifyText not set"); + if (TextUtils.isEmpty(this.mViewIdentifyType) && (mViewIdentifyTexts == null || mViewIdentifyTexts.length == 0)) { + throw new IllegalArgumentException("Error: ViewIdentifyType or ViewIdentifyTexts not set"); } if (mRunning) { return; @@ -84,11 +84,12 @@ private void task(long loopMSec, IActivityViewListener listener) { break; } } - String viewIdentifyText = this.mViewIdentifyText; - if (!TextUtils.isEmpty(viewIdentifyText)) { - ViewUtils.getChildViews((ViewGroup) decorView, viewIdentifyText, viewList); - if (viewList.size() > 0) { - break; + for (String viewIdentifyText: this.mViewIdentifyTexts) { + if (!TextUtils.isEmpty(viewIdentifyText)) { + ViewUtils.getChildViews((ViewGroup) decorView, viewIdentifyText, viewList); + if (viewList.size() > 0) { + break; + } } } } diff --git a/release/update_riru_alipay.json b/release/update_riru_alipay.json index 00a413c..0867071 100644 --- a/release/update_riru_alipay.json +++ b/release/update_riru_alipay.json @@ -1,6 +1,6 @@ { - "version": "4.7.1", + "version": "4.7.2", "versionCode": "23", - "zipUrl": "https://github.com/eritpchy/FingerprintPay/releases/download/4.7.1-ci/riru-module-xfingerprint-pay-alipay-v4.7.1-release.zip", + "zipUrl": "https://github.com/eritpchy/FingerprintPay/releases/download/4.7.2-ci/riru-module-xfingerprint-pay-alipay-v4.7.2-release.zip", "changelog": "https://raw.githubusercontent.com/eritpchy/FingerprintPay/main/CHANGELOG.md" } \ No newline at end of file diff --git a/release/update_riru_qq.json b/release/update_riru_qq.json index 18c8c99..1d33686 100644 --- a/release/update_riru_qq.json +++ b/release/update_riru_qq.json @@ -1,6 +1,6 @@ { - "version": "4.7.1", + "version": "4.7.2", "versionCode": "23", - "zipUrl": "https://github.com/eritpchy/FingerprintPay/releases/download/4.7.1-ci/riru-module-xfingerprint-pay-qq-v4.7.1-release.zip", + "zipUrl": "https://github.com/eritpchy/FingerprintPay/releases/download/4.7.2-ci/riru-module-xfingerprint-pay-qq-v4.7.2-release.zip", "changelog": "https://raw.githubusercontent.com/eritpchy/FingerprintPay/main/CHANGELOG.md" } \ No newline at end of file diff --git a/release/update_riru_taobao.json b/release/update_riru_taobao.json index d96e0f5..cef5ded 100644 --- a/release/update_riru_taobao.json +++ b/release/update_riru_taobao.json @@ -1,6 +1,6 @@ { - "version": "4.7.1", + "version": "4.7.2", "versionCode": "23", - "zipUrl": "https://github.com/eritpchy/FingerprintPay/releases/download/4.7.1-ci/riru-module-xfingerprint-pay-taobao-v4.7.1-release.zip", + "zipUrl": "https://github.com/eritpchy/FingerprintPay/releases/download/4.7.2-ci/riru-module-xfingerprint-pay-taobao-v4.7.2-release.zip", "changelog": "https://raw.githubusercontent.com/eritpchy/FingerprintPay/main/CHANGELOG.md" } \ No newline at end of file diff --git a/release/update_riru_unionpay.json b/release/update_riru_unionpay.json index 69ad8c6..2a27367 100644 --- a/release/update_riru_unionpay.json +++ b/release/update_riru_unionpay.json @@ -1,6 +1,6 @@ { - "version": "4.7.1", + "version": "4.7.2", "versionCode": "23", - "zipUrl": "https://github.com/eritpchy/FingerprintPay/releases/download/4.7.1-ci/riru-module-xfingerprint-pay-unionpay-v4.7.1-release.zip", + "zipUrl": "https://github.com/eritpchy/FingerprintPay/releases/download/4.7.2-ci/riru-module-xfingerprint-pay-unionpay-v4.7.2-release.zip", "changelog": "https://raw.githubusercontent.com/eritpchy/FingerprintPay/main/CHANGELOG.md" } \ No newline at end of file diff --git a/release/update_riru_wechat.json b/release/update_riru_wechat.json index 2bad890..b806020 100644 --- a/release/update_riru_wechat.json +++ b/release/update_riru_wechat.json @@ -1,6 +1,6 @@ { - "version": "4.7.1", + "version": "4.7.2", "versionCode": "23", - "zipUrl": "https://github.com/eritpchy/FingerprintPay/releases/download/4.7.1-ci/riru-module-xfingerprint-pay-wechat-v4.7.1-release.zip", + "zipUrl": "https://github.com/eritpchy/FingerprintPay/releases/download/4.7.2-ci/riru-module-xfingerprint-pay-wechat-v4.7.2-release.zip", "changelog": "https://raw.githubusercontent.com/eritpchy/FingerprintPay/main/CHANGELOG.md" } \ No newline at end of file diff --git a/release/update_zygisk_alipay.json b/release/update_zygisk_alipay.json index f00f109..8946e01 100644 --- a/release/update_zygisk_alipay.json +++ b/release/update_zygisk_alipay.json @@ -1,6 +1,6 @@ { - "version": "4.7.1", + "version": "4.7.2", "versionCode": "23", - "zipUrl": "https://github.com/eritpchy/FingerprintPay/releases/download/4.7.1-ci/zygisk-module-xfingerprint-pay-alipay-v4.7.1-release.zip", + "zipUrl": "https://github.com/eritpchy/FingerprintPay/releases/download/4.7.2-ci/zygisk-module-xfingerprint-pay-alipay-v4.7.2-release.zip", "changelog": "https://raw.githubusercontent.com/eritpchy/FingerprintPay/main/CHANGELOG.md" } \ No newline at end of file diff --git a/release/update_zygisk_qq.json b/release/update_zygisk_qq.json index 9c08a40..1ebd99a 100644 --- a/release/update_zygisk_qq.json +++ b/release/update_zygisk_qq.json @@ -1,6 +1,6 @@ { - "version": "4.7.1", + "version": "4.7.2", "versionCode": "23", - "zipUrl": "https://github.com/eritpchy/FingerprintPay/releases/download/4.7.1-ci/zygisk-module-xfingerprint-pay-qq-v4.7.1-release.zip", + "zipUrl": "https://github.com/eritpchy/FingerprintPay/releases/download/4.7.2-ci/zygisk-module-xfingerprint-pay-qq-v4.7.2-release.zip", "changelog": "https://raw.githubusercontent.com/eritpchy/FingerprintPay/main/CHANGELOG.md" } \ No newline at end of file diff --git a/release/update_zygisk_taobao.json b/release/update_zygisk_taobao.json index dc54575..150ac5f 100644 --- a/release/update_zygisk_taobao.json +++ b/release/update_zygisk_taobao.json @@ -1,6 +1,6 @@ { - "version": "4.7.1", + "version": "4.7.2", "versionCode": "23", - "zipUrl": "https://github.com/eritpchy/FingerprintPay/releases/download/4.7.1-ci/zygisk-module-xfingerprint-pay-taobao-v4.7.1-release.zip", + "zipUrl": "https://github.com/eritpchy/FingerprintPay/releases/download/4.7.2-ci/zygisk-module-xfingerprint-pay-taobao-v4.7.2-release.zip", "changelog": "https://raw.githubusercontent.com/eritpchy/FingerprintPay/main/CHANGELOG.md" } \ No newline at end of file diff --git a/release/update_zygisk_unionpay.json b/release/update_zygisk_unionpay.json index f52483b..43daa8c 100644 --- a/release/update_zygisk_unionpay.json +++ b/release/update_zygisk_unionpay.json @@ -1,6 +1,6 @@ { - "version": "4.7.1", + "version": "4.7.2", "versionCode": "23", - "zipUrl": "https://github.com/eritpchy/FingerprintPay/releases/download/4.7.1-ci/zygisk-module-xfingerprint-pay-unionpay-v4.7.1-release.zip", + "zipUrl": "https://github.com/eritpchy/FingerprintPay/releases/download/4.7.2-ci/zygisk-module-xfingerprint-pay-unionpay-v4.7.2-release.zip", "changelog": "https://raw.githubusercontent.com/eritpchy/FingerprintPay/main/CHANGELOG.md" } \ No newline at end of file diff --git a/release/update_zygisk_wechat.json b/release/update_zygisk_wechat.json index 62abd94..2525ba8 100644 --- a/release/update_zygisk_wechat.json +++ b/release/update_zygisk_wechat.json @@ -1,6 +1,6 @@ { - "version": "4.7.1", + "version": "4.7.2", "versionCode": "23", - "zipUrl": "https://github.com/eritpchy/FingerprintPay/releases/download/4.7.1-ci/zygisk-module-xfingerprint-pay-wechat-v4.7.1-release.zip", + "zipUrl": "https://github.com/eritpchy/FingerprintPay/releases/download/4.7.2-ci/zygisk-module-xfingerprint-pay-wechat-v4.7.2-release.zip", "changelog": "https://raw.githubusercontent.com/eritpchy/FingerprintPay/main/CHANGELOG.md" } \ No newline at end of file