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

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


package com.tencent.mtt.fileclean.page;

import MTT.WelfareTaskInfo;
import android.content.DialogInterface;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable;
import android.text.TextUtils;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;
import com.facebook.drawee.backends.pipeline.Fresco;
import com.facebook.imagepipeline.request.ImageRequest;
import com.tencent.common.featuretoggle.FeatureToggle;
import com.tencent.common.fresco.pipeline.CImage;
import com.tencent.common.fresco.pipeline.ImageHub;
import com.tencent.common.fresco.request.ImageRequestCallBack;
import com.tencent.common.fresco.request.ImageRequester;
import com.tencent.common.utils.StringUtils;
import com.tencent.mtt.ad.coupon.BrowserCouponAdController;
import com.tencent.mtt.base.skin.MttResources;
import com.tencent.mtt.base.stat.StatManager;
import com.tencent.mtt.base.wup.PreferenceData;
import com.tencent.mtt.common.operation.BrowserAdConfigHelper;
import com.tencent.mtt.common.operation.CommonOpManager;
import com.tencent.mtt.common.operation.CommonOpReqParam;
import com.tencent.mtt.common.operation.ICommonOpWrapper;
import com.tencent.mtt.file.page.statistics.FileExperimentConst;
import com.tencent.mtt.file.page.statistics.FileKeyEvent;
import com.tencent.mtt.file.page.wechatpage.utils.FileDateUtils;
import com.tencent.mtt.fileclean.CleanDonePageAdLimit;
import com.tencent.mtt.fileclean.JunkConsts;
import com.tencent.mtt.fileclean.appclean.image.impl.ImageCleanDoneServiceImpl;
import com.tencent.mtt.fileclean.appclean.wx.newpage.view.WxRecommendFunctionItemView;
import com.tencent.mtt.fileclean.page.exp.ShortcutDialogDataBean;
import com.tencent.mtt.fileclean.page.function.FunctionItemManager;
import com.tencent.mtt.fileclean.page.header.HeaderCleanDoneOldView;
import com.tencent.mtt.fileclean.page.header.HeaderCleanDoneView;
import com.tencent.mtt.fileclean.page.view.JunkCleanWelFareCard;
import com.tencent.mtt.fileclean.page.view.JunkPushTipsView;
import com.tencent.mtt.fileclean.page.view.ObtainJunkGoldDialog;
import com.tencent.mtt.fileclean.stat.JunkEventHelper;
import com.tencent.mtt.fileclean.utils.IGetWelfareTaskCallBack;
import com.tencent.mtt.fileclean.utils.JunkCleanWelFareManager;
import com.tencent.mtt.fileclean.utils.JunkFileUtils;
import com.tencent.mtt.fileclean.utils.JunkPermissionHelper;
import com.tencent.mtt.log.access.Logs;
import com.tencent.mtt.monitor.BizTimeOutMonitor;
import com.tencent.mtt.nxeasy.page.EasyPageContext;
import com.tencent.mtt.setting.PublicSettingManager;
import com.tencent.mtt.tool.FilePreferenceManager;
import com.tencent.mtt.view.dialog.newui.SimpleDialogBuilder;
import com.tencent.mtt.view.dialog.newui.builder.api.ICommonDialogBuilder;
import com.tencent.mtt.view.dialog.newui.builder.api.base.IDialogBuilder;
import com.tencent.mtt.view.dialog.newui.builder.api.base.IDialogBuilderInterface;
import com.tencent.mtt.view.dialog.newui.dialog.DialogBase;
import com.tencent.mtt.view.dialog.newui.view.ViewOnClickListener;
import com.tencent.mtt.view.scrollview.QBScrollView;
import com.tencent.mtt.widget.BrowserWidgetHelper;
import com.tencent.mtt.widget.BrowserWidgetUtils;
import com.tencent.mtt.widget.mini.BrowserWidgetMiniHelper;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import qb.file.BuildConfig;

public class JunkcleanDonePageNew extends JunkPageBase implements WxRecommendFunctionItemView.OnWxRecommendItemClickListener {
    private int G;
    private LinearLayout H;
    private boolean I;

    BizTimeOutMonitor f65941a;

    boolean f65942b;

    Map<String, String> f65943c;

    CommonOpReqParam f65944d;
    ICommonOpWrapper e;
    JunkCleanWelFareCard f;
    int g;
    private boolean h;
    private RewardWindow i;
    private long j;

    class AnonymousClass12 implements ImageRequestCallBack {

        final ShortcutDialogDataBean f65949a;

        final JunkcleanDonePageNew f65950b;

        @Override
        public void onRequestFailure(ImageRequester imageRequester, Throwable th) {
            this.f65950b.a(this.f65949a, (Drawable) null);
        }

        @Override
        public void onRequestSuccess(ImageRequester imageRequester, CImage cImage) {
            if (cImage == null || cImage.c() == null) {
                return;
            }
            this.f65950b.a(this.f65949a, new BitmapDrawable(cImage.b()));
        }
    }

    public JunkcleanDonePageNew(EasyPageContext easyPageContext, int i) {
        super(easyPageContext);
        this.h = false;
        this.j = 0L;
        this.G = -1;
        this.f65942b = false;
        this.f65943c = new HashMap();
        this.G = i;
        this.f65943c = c(i);
        FileExperimentConst.a("exp_clean_videoad_show", StringUtils.b(PreferenceData.a("JUNK_VIDEO_AD_SHOW"), 0));
        c();
        setTopBarBgColor(JunkConsts.o);
        StatManager.b().c("BMRB037");
        JunkEventHelper.f66152b++;
        new FileKeyEvent("JUNK_0001", easyPageContext.g, easyPageContext.h, "JUNK_FINISH", "JK", "", JunkEventHelper.b()).b();
        JunkConsts.h();
        new FileKeyEvent("JUNK_0006", easyPageContext.g, easyPageContext.h, "JUNK_FINISH", "JK", "", JunkEventHelper.b()).b();
        this.f65941a = new BizTimeOutMonitor();
        Fresco.getImagePipeline().prefetchToEncodedCache(ImageRequest.fromUri("https://m4.publicimg.browser.qq.com/publicimg/nav/file/junkclean/file_junk_lottery_result_bg.png"), new Object());
        Fresco.getImagePipeline().prefetchToEncodedCache(ImageRequest.fromUri("https://m4.publicimg.browser.qq.com/publicimg/nav/file/junkclean/icon_lottery_card.png"), new Object());
        Fresco.getImagePipeline().prefetchToEncodedCache(ImageRequest.fromUri("https://m4.publicimg.browser.qq.com/publicimg/nav/file/junkclean/icon_lottery_card_hand.png"), new Object());
        Fresco.getImagePipeline().prefetchToEncodedCache(ImageRequest.fromUri("https://m4.publicimg.browser.qq.com/publicimg/nav/file/junkclean/file_junk_done_lottery_bg.png"), new Object());
    }

    public void a(WelfareTaskInfo welfareTaskInfo) {
        this.f = new JunkCleanWelFareCard(this.p, welfareTaskInfo);
        LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(-1, MttResources.s(226));
        int s = MttResources.s(4);
        layoutParams.rightMargin = s;
        layoutParams.leftMargin = s;
        layoutParams.topMargin = -MttResources.s(43);
        this.H.addView(this.f, 1, layoutParams);
        new FileKeyEvent("JUNK_0252", this.p.g, this.p.h, "JUNK_FINISH", "JK", "", JunkEventHelper.b()).b();
    }

    private Map<String, String> c(int i) {
        int i2;
        String str;
        HashMap hashMap = new HashMap();
        int i3 = FilePreferenceManager.a().getInt("TODAY_CLEAN_TIMES", 0);
        String string = FilePreferenceManager.a().getString("BEFORE_CLEAN_TIMES", "");
        if (TextUtils.isEmpty(string)) {
            i2 = i3;
            str = "";
        } else {
            StringBuffer stringBuffer = new StringBuffer();
            List asList = Arrays.asList(string.split("_"));
            Iterator it = asList.iterator();
            i2 = i3;
            while (it.hasNext()) {
                int b2 = StringUtils.b((String) it.next(), 0);
                if (b2 > i2) {
                    i2 = b2;
                }
            }
            if (asList.size() > 14) {
                asList.subList(asList.size() - 14, asList.size());
            }
            for (int i4 = 0; i4 < asList.size(); i4++) {
                stringBuffer.append(((String) asList.get(i4)) + "_");
            }
            str = stringBuffer.substring(0, stringBuffer.length() - 1);
        }
        hashMap.put("clean_type", JunkConsts.c(i));
        hashMap.put("clean_bigest_times", i2 + "");
        hashMap.put("clean_last14_times", str);
        hashMap.put("clean_today_time", i3 + "");
        hashMap.put("callfrom", this.p.g);
        hashMap.put("clean_from", JunkEventHelper.f66153c);
        hashMap.put("timestamp", System.currentTimeMillis() + "");
        hashMap.put("junkCleandoneSerialExposure", (JunkEventHelper.f66152b + 1) + "");
        return hashMap;
    }

    private void c() {
        this.n = new QBScrollView(this.q);
        this.n.setOverScrollMode(2);
        this.k.addView(this.n, new ViewGroup.LayoutParams(-1, -2));
        this.H = new LinearLayout(getContext());
        this.H.setOrientation(1);
        this.n.addView(this.H, new ViewGroup.LayoutParams(-1, -1));
        this.m = new HeaderCleanDoneOldView(this.q);
        this.m.setBgColor(JunkConsts.l);
        this.H.addView(this.m, new LinearLayout.LayoutParams(-1, JunkConsts.e));
        JunkCleanWelFareManager.a().a(new IGetWelfareTaskCallBack() {
            @Override
            public void a(WelfareTaskInfo welfareTaskInfo, boolean z) {
                if (z) {
                    JunkcleanDonePageNew.this.m.getLayoutParams().height = JunkConsts.f;
                    JunkcleanDonePageNew.this.m.requestLayout();
                    JunkcleanDonePageNew.this.a(welfareTaskInfo);
                    if (!FileDateUtils.a(System.currentTimeMillis(), FilePreferenceManager.a().getLong("key_last_show_welfare_dialog", 0L)) && welfareTaskInfo.taskEvolve != 2) {
                        FilePreferenceManager.a().setLong("key_last_show_welfare_dialog", System.currentTimeMillis());
                        new ObtainJunkGoldDialog(JunkcleanDonePageNew.this.p, welfareTaskInfo, new ObtainJunkGoldDialog.ObtainListener() {
                            @Override
                            public void a() {
                                JunkcleanDonePageNew.this.f.b();
                            }
                        }).show();
                        new FileKeyEvent("JUNK_0251", JunkcleanDonePageNew.this.p.g, JunkcleanDonePageNew.this.p.h, "JUNK_FINISH", "JK", "", JunkEventHelper.b()).b();
                        if (JunkcleanDonePageNew.this.I) {
                            return;
                        }
                        JunkcleanDonePageNew.this.m();
                        return;
                    }
                }
                JunkcleanDonePageNew.this.b();
                if (JunkcleanDonePageNew.this.I) {
                }
            }
        });
        e();
    }

    public CommonOpReqParam d(int i) {
        CommonOpReqParam commonOpReqParam = this.f65944d;
        if (commonOpReqParam == null) {
            this.f65944d = new CommonOpReqParam(i);
        } else {
            commonOpReqParam.g = i;
        }
        return this.f65944d;
    }

    private void e() {
        boolean c2 = JunkPermissionHelper.a().c();
        if (FilePreferenceManager.a().getBoolean("HAVE_OPEN_JUNK_PUSH_TIPS", false) || !c2) {
            return;
        }
        JunkPushTipsView junkPushTipsView = new JunkPushTipsView(this.p);
        LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(-1, MttResources.s(38));
        layoutParams.setMargins(MttResources.s(16), MttResources.s(8), MttResources.s(16), MttResources.s(8));
        this.H.addView(junkPushTipsView, layoutParams);
        FilePreferenceManager.a().setBoolean("HAVE_OPEN_JUNK_PUSH_TIPS", true);
        new FileKeyEvent("JUNK_0247", this.p.g, this.p.h, "JUNK_FINISH", "JK", "", JunkEventHelper.b()).b();
    }

    private void f() {
        ImageHub.a().a("https://static.res.qq.com/nav/file/send_clean_widget_dialog_img_2.png", new ImageRequestCallBack() {
            @Override
            public void onRequestFailure(ImageRequester imageRequester, Throwable th) {
                JunkcleanDonePageNew.this.a((Drawable) null);
            }

            @Override
            public void onRequestSuccess(ImageRequester imageRequester, CImage cImage) {
                if (cImage == null || cImage.c() == null) {
                    return;
                }
                JunkcleanDonePageNew.this.a(new BitmapDrawable(cImage.b()));
            }
        });
    }

    public int getOpAreaHeight() {
        if (this.g <= 0) {
            this.g = getMeasuredHeight() - this.m.getMeasuredHeight();
        }
        return this.g;
    }

    @Override
    public void a(long j, int i) {
        this.j = j;
        if ((this.m != null) && (this.m instanceof HeaderCleanDoneView)) {
            if (j > 0) {
                ((HeaderCleanDoneView) this.m).setCleanedSize(j);
            } else {
                ((HeaderCleanDoneView) this.m).setCleanedCount(i);
            }
        }
    }

    public void a(Drawable drawable) {
        PublicSettingManager.a().setBoolean("has_clean_done_widget_dialog_show", true);
        new FileKeyEvent("JUNK_0238", this.p.g, this.p.h, "JUNK_FINISH", "JK", "", JunkEventHelper.b()).b();
        if (!FeatureToggle.a(BuildConfig.FEATURE_TOGGLE_868916915)) {
            SimpleDialogBuilder.a(this.p.f68800c).a(IDialogBuilderInterface.ImageStyle.MATCH_MARGIN).a(drawable).e("添加清理到手机桌面,可一键释放手机空间,有效延长手机寿命。").a((CharSequence) "添加").a_(new ViewOnClickListener() {
                @Override
                public void onClick(View view, DialogBase dialogBase) {
                    BrowserWidgetHelper.getInstance().a();
                    new FileKeyEvent("JUNK_0239", JunkcleanDonePageNew.this.p.g, JunkcleanDonePageNew.this.p.h, "JUNK_FINISH", "JK", "", JunkEventHelper.b()).b();
                    dialogBase.dismiss();
                }
            }).b("取消").b(new ViewOnClickListener() {
                @Override
                public void onClick(View view, DialogBase dialogBase) {
                    dialogBase.dismiss();
                }
            }).b(true).d().show();
            return;
        }
        ICommonDialogBuilder a2 = SimpleDialogBuilder.a();
        a2.b(false);
        a2.e("添加清理到手机桌面,可一键释放手机空间,有效延长手机寿命");
        a2.a((CharSequence) "确定");
        a2.c("取消");
        a2.a("https://m4.publicimg.browser.qq.com/publicimg/nav/widget_clean_new.png");
        a2.a_(new ViewOnClickListener() {
            @Override
            public void onClick(View view, DialogBase dialogBase) {
                BrowserWidgetUtils.a("JUNK_0239");
                BrowserWidgetMiniHelper.getInstance().a();
                dialogBase.dismiss();
            }
        });
        a2.c(new ViewOnClickListener() {
            @Override
            public void onClick(View view, DialogBase dialogBase) {
                dialogBase.dismiss();
            }
        });
        a2.a(new IDialogBuilder.BackListener() {
            @Override
            public boolean handleBack(DialogBase dialogBase) {
                return true;
            }
        });
        a2.a(new DialogInterface.OnShowListener() {
            @Override
            public void onShow(DialogInterface dialogInterface) {
                BrowserWidgetUtils.a("JUNK_0238");
            }
        });
        a2.e();
    }

    public void a(ShortcutDialogDataBean shortcutDialogDataBean, Drawable drawable) {
        StatManager.b().c("BMRB279");
        new FileKeyEvent("JUNK_0029", this.p.g, this.p.h, "JUNK_FINISH", "JK", "", JunkEventHelper.b()).b();
        PublicSettingManager.a().setBoolean("has_after_clean_dialog_show", true);
        SimpleDialogBuilder.a(this.p.f68800c).a(IDialogBuilderInterface.ImageStyle.MATCH_MARGIN).a(drawable).d(shortcutDialogDataBean.f65964b).e(shortcutDialogDataBean.f65965c).a((CharSequence) shortcutDialogDataBean.f65966d).a_(new ViewOnClickListener() {
            @Override
            public void onClick(View view, DialogBase dialogBase) {
                new FileKeyEvent("JUNK_0030", JunkcleanDonePageNew.this.p.g, JunkcleanDonePageNew.this.p.h, "JUNK_FINISH", "JK", "", JunkEventHelper.b()).b();
                JunkcleanDonePageNew.this.a(false);
                dialogBase.dismiss();
            }
        }).b("取消").b(new ViewOnClickListener() {
            @Override
            public void onClick(View view, DialogBase dialogBase) {
                dialogBase.dismiss();
            }
        }).b(true).d().show();
    }

    void b() {
        if (!BrowserWidgetHelper.getInstance().c() || BrowserWidgetHelper.getInstance().b() || PublicSettingManager.a().getBoolean("has_clean_done_widget_dialog_show", false)) {
            this.h = true;
        } else {
            f();
        }
        if (FeatureToggle.a(com.tencent.library.BuildConfig.FEATURE_TOGGLE_865259029)) {
            this.h &= CleanDonePageAdLimit.a(1);
            if (this.h) {
                Logs.c("JunkCleanDonePageNew", "显示弹窗AD");
                CleanDonePageAdLimit.b(1);
            }
        }
    }

    @Override
    public void b(int i) {
        FunctionItemManager.a().a(i);
        post(new Runnable() {
            @Override
            public void run() {
                JunkcleanDonePageNew.this.e = CommonOpManager.a().a(BrowserAdConfigHelper.BizID.BIZ_JUNKCLEAN, JunkcleanDonePageNew.this.getOpAreaHeight());
                JunkcleanDonePageNew.this.e.setLotteryStatHelper(new BrowserCouponAdController.ILotteryStatHelper() {
                    @Override
                    public void a(String str) {
                        new FileKeyEvent(str, JunkcleanDonePageNew.this.p.g, JunkcleanDonePageNew.this.p.h, "JUNK_FINISH", "JK", "", JunkEventHelper.b()).b();
                    }

                    @Override
                    public void b(String str) {
                        if (FeatureToggle.a(com.tencent.library.BuildConfig.FEATURE_TOGGLE_IMAGE_CLEAN_868013093)) {
                            HashMap hashMap = new HashMap();
                            hashMap.put("type", str);
                            new FileKeyEvent("JUNK_0311").a(hashMap);
                        }
                    }
                });
                JunkcleanDonePageNew.this.n.a(new QBScrollView.MttScrollViewListener() {
                    @Override
                    public void a() {
                    }

                    @Override
                    public void a(int i2) {
                    }

                    @Override
                    public void a(int i2, int i3) {
                        if (i3 == 0) {
                            JunkcleanDonePageNew.this.e.f();
                        }
                    }

                    @Override
                    public void b(int i2) {
                    }
                });
                if (JunkcleanDonePageNew.this.e != null) {
                    JunkcleanDonePageNew.this.H.addView(JunkcleanDonePageNew.this.e.getContentView());
                    if (JunkcleanDonePageNew.this.e != null) {
                        JunkcleanDonePageNew.this.e.a(JunkcleanDonePageNew.this.d(2));
                    }
                }
            }
        });
    }

    @Override
    public void d() {
        super.d();
        ICommonOpWrapper iCommonOpWrapper = this.e;
        if (iCommonOpWrapper != null) {
            iCommonOpWrapper.c();
        }
    }

    @Override
    public void da_() {
        if (this.G != 9) {
            this.p.f68798a.a();
        } else {
            ImageCleanDoneServiceImpl.a();
            postDelayed(new Runnable() {
                @Override
                public void run() {
                    JunkcleanDonePageNew.this.p.f68798a.b();
                }
            }, 200L);
        }
    }

    @Override
    public void g() {
        super.g();
        ICommonOpWrapper iCommonOpWrapper = this.e;
        if (iCommonOpWrapper != null) {
            iCommonOpWrapper.a();
        }
    }

    @Override
    public void h() {
        super.h();
        ICommonOpWrapper iCommonOpWrapper = this.e;
        if (iCommonOpWrapper != null) {
            iCommonOpWrapper.b();
        }
    }

    @Override
    public boolean i() {
        JunkEventHelper.f66152b = 0;
        if (this.G == 9) {
            ImageCleanDoneServiceImpl.a();
            postDelayed(new Runnable() {
                @Override
                public void run() {
                    JunkcleanDonePageNew.this.p.f68798a.b();
                }
            }, 200L);
            return true;
        }
        if (this.f65942b) {
            new FileKeyEvent("JUNK_0134", this.p.g, this.p.h, "JUNK_FINISH", "JK", "", JunkEventHelper.b()).b();
            return false;
        }
        if (JunkFileUtils.e(this.p.g)) {
            JunkConsts.c();
        }
        this.p.f68798a.b();
        return true;
    }

    @Override
    public void j() {
        super.j();
        ICommonOpWrapper iCommonOpWrapper = this.e;
        if (iCommonOpWrapper != null) {
            iCommonOpWrapper.d();
        }
    }

    @Override
    public void k() {
        super.k();
        ICommonOpWrapper iCommonOpWrapper = this.e;
        if (iCommonOpWrapper != null) {
            iCommonOpWrapper.e();
        }
        JunkCleanWelFareCard junkCleanWelFareCard = this.f;
        if (junkCleanWelFareCard != null) {
            junkCleanWelFareCard.c();
        }
    }

    @Override
    public void m() {
        this.I = true;
        if (this.h) {
            this.i = RewardWindowFactoryKt.a(this.p, this, this.f65943c);
            this.i.a();
        }
    }

    @Override
    public void n() {
        ((HeaderCleanDoneView) this.m).a();
    }

    @Override
    public boolean o() {
        RewardWindow rewardWindow = this.i;
        return rewardWindow != null && rewardWindow.b();
    }

    @Override
    public void q_(int i) {
    }

    @Override
    public void setCleanDoneTitle(String str) {
        ((HeaderCleanDoneView) this.m).setTitle(str);
    }
}