From af41ae0046bc8918e5783a6d86495d9151bb6e66 Mon Sep 17 00:00:00 2001 From: yu_qinfei <878919698@qq.com> Date: Mon, 7 Sep 2020 14:50:53 +0800 Subject: [PATCH] ActivityManagerService: Disable the payment function Add a payment trustlist to prohibit payment. --- .../server/am/ActivityManagerService.java | 62 +++++++++++++++++++ 1 file changed, 62 insertions(+) diff --git a/services/core/java/com/android/server/am/ActivityManagerService.java b/services/core/java/com/android/server/am/ActivityManagerService.java index cb112726..9aea0e89 100644 --- a/services/core/java/com/android/server/am/ActivityManagerService.java +++ b/services/core/java/com/android/server/am/ActivityManagerService.java @@ -643,6 +643,49 @@ public final class ActivityManagerService extends ActivityManagerNative boolean mDoingSetFocusedActivity; + private HashMap notPayList = new HashMap () { + { + //QQ + put("ComponentInfo{com.tencent.mobileqq/com.tencent.mobileqq.activity.qwallet.SendHbActivity}", 0); + put("ComponentInfo{com.tencent.mobileqq/com.tencent.mobileqq.activity.qwallet.TransactionActivity}", 0); + put("ComponentInfo{com.tencent.mobileqq/cooperation.qwallet.plugin.QWalletPluginProxyActivity}", 0); + //weixin + put("ComponentInfo{com.tencent.mm/com.tencent.mm.plugin.luckymoney.ui.LuckyMoneyPrepareUI}", 0); + put("ComponentInfo{com.tencent.mm/com.tencent.mm.plugin.remittance.ui.RemittanceUI}", 0); + put("ComponentInfo{com.tencent.mm/com.tencent.mm.plugin.mall.ui.MallIndexUI}", 0); + //taobao + put("ComponentInfo{com.taobao.taobao/com.taobao.android.purchase.TBPurchaseActivity}", 0); + put("ComponentInfo{com.taobao.taobao/com.alipay.mobile.verifyidentity.module.password.pay.ui.PayPwdDialogActivity}", 0); + //zhihu + put("ComponentInfo{com.zhihu.android/com.zhihu.android.premium.VipHostActivity}", 0); + put("ComponentInfo{com.zhihu.android/com.alipay.sdk.app.H5PayActivity}", 0); + //youdao + put("ComponentInfo{com.youdao.dict/com.youdao.dict.activity.vipcenter.VipCenterDBActivity}", 0); + //ditiepaoku + put("ComponentInfo{com.kiloo.subwaysurf/com.ms.sdk.plugin.payment.ledou.alipay.h5.H5PayActivity}", 0); + put("ComponentInfo{com.tencent.mm/com.tencent.mm.plugin.wallet.pay.ui.WalletPayUI}", 0); + put("ComponentInfo{com.tencent.mm/com.tencent.mm.plugin.wallet_index.ui.OrderHandlerUI}", 0); + //jinritoutiao + put("ComponentInfo{com.ss.android.article.news/com.ss.android.caijing.stock.portal.PortalActivity}", 0); + //qiyeweixin + put("ComponentInfo{com.tencent.wework/com.tencent.wework.enterprise.redenvelopes.controller.RedEnvelopeSenderWithCoverActivity}", 0); + //dingding + put("ComponentInfo{com.alibaba.android.rimet/com.alibaba.android.dingtalk.redpackets.activities.SendActivity}", 0); + put("ComponentInfo{com.alibaba.android.rimet/com.alibaba.android.dingtalk.redpackets.activities.WalletActivity}", 0); + //tengxunshipin + put("ComponentInfo{com.tencent.qqlive/com.tencent.qqlive.ona.browser.HollywoodH5Activity}", 0); + //meituan + put("ComponentInfo{com.sankuai.meituan/com.sankuai.waimai.business.knb.TakeoutKNBWebActivity}", 0); + //tonghuashun + put("ComponentInfo{com.hexin.plat.android/com.hexin.plat.android.IFundTransparentActivityProxy}", 0); + //douban + put("ComponentInfo{com.douban.frodo/com.douban.frodo.fangorns.pay.PaymentActivity}", 0); + //douyin + put("ComponentInfo{com.ss.android.ugc.aweme/com.ss.android.ugc.aweme.wallet.ui.WalletActivity}", 0); + } + }; + + public boolean canShowErrorDialogs() { return mShowDialogs && !mSleeping && !mShuttingDown && mLockScreenShown != LOCK_SCREEN_SHOWN; @@ -4336,6 +4379,25 @@ public final class ActivityManagerService extends ActivityManagerNative public final int startActivity(IApplicationThread caller, String callingPackage, Intent intent, String resolvedType, IBinder resultTo, String resultWho, int requestCode, int startFlags, ProfilerInfo profilerInfo, Bundle bOptions) { + if (intent.getComponent() != null) { + String nComponent = intent.getComponent().toString(); + if (nComponent.indexOf("com.alipay.sdk.app.H5PayActivity", 0) > 0) { + return 0; + } + if (notPayList.containsKey(nComponent)) { + return 0; + } + } else { + String nIntent = intent.toString(); + if(nIntent.indexOf("{ act=android.intent.action.VIEW dat=meituanpayment://conchpay/launch", 0) > 0) { + return 0; + } else if (nIntent.indexOf("quickpass/qrcode?entry=homenav", 0) > 0) { + return 0; + } else if (nIntent.indexOf("https://npay.meituan.com/resource/conch-hybrid", 0) > 0) { + return 0; + } + } + return startActivityAsUser(caller, callingPackage, intent, resolvedType, resultTo, resultWho, requestCode, startFlags, profilerInfo, bOptions, UserHandle.getCallingUserId()); -- Gitee