QQ浏览器 v12.2.3.7053版本的 MD5 值为:8285ab3059e5c8b521a264dfbc5c3685

以下内容为反编译后的 PrivacyImpl.java 源代码,内容仅作参考


package com.tencent.mtt.browser.privacy;

import android.content.Context;
import android.os.Bundle;
import android.text.TextUtils;
import com.tencent.common.manifest.annotation.CreateMethod;
import com.tencent.common.manifest.annotation.ExtensionImpl;
import com.tencent.common.manifest.annotation.ServiceImpl;
import com.tencent.common.utils.StringUtils;
import com.tencent.mtt.ContextHolder;
import com.tencent.mtt.account.base.IAccount;
import com.tencent.mtt.account.base.UserLoginListener;
import com.tencent.mtt.base.account.AccountInfo;
import com.tencent.mtt.base.functionwindow.IFunctionWindow;
import com.tencent.mtt.base.functionwindow.IFunctionWndFactory;
import com.tencent.mtt.base.functionwindow.IFuncwindowExtension;
import com.tencent.mtt.base.functionwindow.MttFunctionActivity;
import com.tencent.mtt.base.functionwindow.MttFunctionwindowProxy;
import com.tencent.mtt.base.stat.StatManager;
import com.tencent.mtt.browser.privacy.facade.IPrivaceCallBack;
import com.tencent.mtt.browser.privacy.facade.IPrivacePage;
import com.tencent.mtt.browser.privacy.facade.PrivacyService;
import com.tencent.mtt.browser.privacy.ui.PrivacyPasswordPage;
import com.tencent.mtt.browser.window.UrlParams;
import com.tencent.mtt.businesscenter.facade.IFrameworkDelegate;
import com.tencent.mtt.commercial.shadow.PluginHelper;
import com.tencent.mtt.log.access.Logs;
import com.tencent.mtt.qbcontext.core.QBContext;
import com.tencent.mtt.sdkcontext.SDKContext;

@ServiceImpl(createMethod = CreateMethod.GET, service = PrivacyService.class)
@ExtensionImpl(createMethod = CreateMethod.GET, extension = IFuncwindowExtension.class, filters = {IFunctionWndFactory.WND_PRIVACY})
public class PrivacyImpl implements UserLoginListener, IFuncwindowExtension, PrivacyService {
    public static int FAV_PRIVACY = 2;
    public static int FILE_PRIVACY = 1;

    private static PrivacyImpl f43808a;

    private PrivacyService.verifyResultCallBack f43809b;

    private PrivacyImpl() {
        ((IAccount) SDKContext.getInstance().getService(IAccount.class)).addUIListener(this);
    }

    private boolean a() {
        try {
            return ContextHolder.getAppContext().getAssets().open(PluginHelper.YLH_AD_PLUGIN_ZIP) != null;
        } catch (Exception unused) {
            Logs.e("PrivacyImpl", "sPluginZip not exist");
            return false;
        }
    }

    public static PrivacyImpl getInstance() {
        if (f43808a == null) {
            synchronized (PrivacyImpl.class) {
                if (f43808a == null) {
                    f43808a = new PrivacyImpl();
                }
            }
        }
        return f43808a;
    }

    @Override
    public IFunctionWindow createWindow(Context context, String str, MttFunctionwindowProxy mttFunctionwindowProxy) {
        if (StringUtils.a(str, IFunctionWndFactory.WND_PRIVACY)) {
            return new PrivacyController(context, mttFunctionwindowProxy, this.f43809b);
        }
        return null;
    }

    @Override
    public void encryptUploadAndDownload() {
        if (((IAccount) SDKContext.getInstance().getService(IAccount.class)).getCurrentUserInfo().isLogined()) {
            String b2 = CollectPrivacyUtils.b();
            String a2 = CollectPrivacyUtils.a();
            int a3 = CollectPrivacyUtils.a(2);
            if (TextUtils.isEmpty(b2) || TextUtils.isEmpty(a2) || a3 == -1) {
                PrivacyPasswordWupManager.a().c();
            } else {
                PrivacyPasswordWupManager.a().a(a2, b2, a3);
            }
        }
    }

    @Override
    public int getBussinessPrivacyState(int i) {
        return CollectPrivacyUtils.a(i);
    }

    @Override
    public String getPrivacyUrl() {
        return a() ? "https://rule.tencent.com/rule/preview/d92fcbbb-98fb-42c5-a360-012bdab56d60" : "https://privacy.qq.com/document/priview/2491347092a64d7fa00cbc2bf68fbbbb";
    }

    @Override
    public IPrivacePage getVerifyView(Context context, int i, IPrivaceCallBack iPrivaceCallBack) {
        return new PrivacyPasswordPage(context, 4, 0, null, i, iPrivaceCallBack);
    }

    @Override
    public boolean hasSetBussinessPrivacy() {
        return (TextUtils.isEmpty(CollectPrivacyUtils.b()) && TextUtils.isEmpty(CollectPrivacyUtils.a())) ? false : true;
    }

    public void jumpByUrlParams(UrlParams urlParams, PrivacyService.verifyResultCallBack verifyresultcallback) {
        this.f43809b = verifyresultcallback;
        ((IFrameworkDelegate) QBContext.getInstance().getService(IFrameworkDelegate.class)).doLoad(urlParams);
    }

    @Override
    public void onLoginFailed(int i, String str) {
    }

    @Override
    public void onLoginSuccess() {
        if (((IAccount) SDKContext.getInstance().getService(IAccount.class)).getCurrentUserInfo().isLogined()) {
            requesetPasswordAndUpload();
            return;
        }
        CollectPrivacyUtils.a(2, -1);
        CollectPrivacyUtils.a(1, -1);
        CollectPrivacyUtils.a("");
        CollectPrivacyUtils.c("");
    }

    @Override
    public void requesetPasswordAndUpload() {
        if (TextUtils.isEmpty(CollectPrivacyUtils.a()) || TextUtils.isEmpty(CollectPrivacyUtils.b())) {
            CollectPrivacyUtils.a(FILE_PRIVACY, -1);
        }
        if (((IAccount) SDKContext.getInstance().getService(IAccount.class)).getCurrentUserInfo().isLogined()) {
            PrivacyPasswordWupManager.a().b();
        }
    }

    @Override
    public void showOpenPrivacy(int i) {
        UrlParams a2;
        Bundle bundle;
        UrlParams urlParams;
        this.f43809b = null;
        if (TextUtils.isEmpty(CollectPrivacyUtils.a())) {
            bundle = new Bundle();
            bundle.putInt(PrivacyService.OPEN_TYPE, 1);
            bundle.putInt(PrivacyService.PRIVACY_BUSSINESS_ID, i);
            urlParams = new UrlParams(IFunctionWndFactory.WND_PRIVACY);
        } else {
            if (!TextUtils.isEmpty(CollectPrivacyUtils.b())) {
                this.f43809b = null;
                CollectPrivacyUtils.a(i, 1);
                Bundle bundle2 = new Bundle();
                bundle2.putInt(PrivacyService.OPEN_TYPE, 6);
                a2 = new UrlParams(IFunctionWndFactory.WND_PRIVACY).d(2).a(bundle2);
                ((IFrameworkDelegate) QBContext.getInstance().getService(IFrameworkDelegate.class)).doLoad(a2.d(true));
            }
            bundle = new Bundle();
            bundle.putInt(PrivacyService.OPEN_TYPE, 7);
            bundle.putInt(PrivacyService.PRIVACY_BUSSINESS_ID, i);
            urlParams = new UrlParams(IFunctionWndFactory.WND_PRIVACY);
        }
        a2 = urlParams.d(2).a(bundle);
        ((IFrameworkDelegate) QBContext.getInstance().getService(IFrameworkDelegate.class)).doLoad(a2.d(true));
    }

    @Override
    public void showPrivacySetting() {
        showPrivacySetting(1001);
    }

    public void showPrivacySetting(int i) {
        this.f43809b = null;
        Bundle bundle = new Bundle();
        bundle.putInt(PrivacyService.OPEN_TYPE, 6);
        bundle.putInt("privacy_from_where", i);
        ((IFrameworkDelegate) QBContext.getInstance().getService(IFrameworkDelegate.class)).doLoad(new UrlParams(IFunctionWndFactory.WND_PRIVACY).d(2).a(bundle).d(true));
    }

    @Override
    public void showPrivacyVerify(int i, Context context, PrivacyService.verifyResultCallBack verifyresultcallback) {
        StatManager b2;
        String str;
        StatManager b3;
        String str2;
        StatManager b4;
        String str3;
        if (CollectPrivacyUtils.a(i) == 1) {
            this.f43809b = verifyresultcallback;
            Bundle bundle = new Bundle();
            bundle.putInt(PrivacyService.OPEN_TYPE, 2);
            UrlParams d2 = new UrlParams(IFunctionWndFactory.WND_PRIVACY).d(2).a(bundle).d(true);
            d2.a(MttFunctionActivity.class);
            d2.b(63);
            ((IFrameworkDelegate) QBContext.getInstance().getService(IFrameworkDelegate.class)).doLoad(d2);
            AccountInfo currentUserInfo = ((IAccount) SDKContext.getInstance().getService(IAccount.class)).getCurrentUserInfo();
            if (i == 2) {
                if (currentUserInfo == null || !currentUserInfo.isLogined()) {
                    b4 = StatManager.b();
                    str3 = "CB9056";
                } else {
                    b4 = StatManager.b();
                    str3 = "CB9055";
                }
                b4.c(str3);
                b3 = StatManager.b();
                str2 = "CB9016";
            } else {
                if (i != 1) {
                    return;
                }
                if (currentUserInfo == null || !currentUserInfo.isLogined()) {
                    b2 = StatManager.b();
                    str = "CB9058";
                } else {
                    b2 = StatManager.b();
                    str = "CB9057";
                }
                b2.c(str);
                b3 = StatManager.b();
                str2 = "CB9017";
            }
            b3.c(str2);
        }
    }

    @Override
    public void stathasSetBussinessPrivacy() {
        if (hasSetBussinessPrivacy()) {
            StatManager.b().c("CB9053");
        }
    }
}