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

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


package com.tencent.mtt.widget.style;

import MTT.SmartBox_HotWordsItem;
import android.appwidget.AppWidgetManager;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.text.TextUtils;
import android.widget.RemoteViews;
import com.tencent.mtt.ContextHolder;
import com.tencent.mtt.R;
import com.tencent.mtt.base.stat.utils.PlatformStatUtils;
import com.tencent.mtt.search.hotwords.TKDSearchHotwordProxyImpl;
import com.tencent.mtt.search.statistics.SearchLog;
import com.tencent.mtt.widget.IRefreshWordsListener;
import com.tencent.mtt.widget.ISearchWidgetView;
import com.tencent.mtt.widget.SearchWidgetOpManager;
import com.tencent.mtt.widget.SearchWidgetProvider;
import com.tencent.mtt.widget.helper.SearchWidgetHelper;

public class SearchWidgetBottom implements IRefreshWordsListener, ISearchWidgetView {

    private SearchWidgetHelper f75309a = new SearchWidgetHelper(this);

    private boolean f75310b;

    private void c(Context context, RemoteViews remoteViews) {
        remoteViews.setTextViewText(R.id.search_widget_content_tv, "搜你感兴趣的");
        remoteViews.setViewVisibility(R.id.search_widget_content, 0);
        remoteViews.setOnClickPendingIntent(R.id.search_widget_content, this.f75309a.a(context, "qb://search?page=adr_system&module=entry&action=click&entryScene=967&entryStatus=001&jump_from=967", "search_center", 0));
    }

    private void d(Context context, RemoteViews remoteViews) {
        String str;
        SmartBox_HotWordsItem b2 = this.f75309a.b();
        this.f75310b = TextUtils.isEmpty(b2.sShowTitle);
        remoteViews.setTextViewText(R.id.search_widget_content_lf, this.f75310b ? "点击查看今日热搜" : b2.sShowTitle);
        if (this.f75310b) {
            str = "https://so.html5.qq.com/page/real/search_result?q=%E4%BB%8A%E6%97%A5%E7%83%AD%E6%90%9C&entryScene=967&jump_from=adr_home_screen";
        } else {
            str = b2.sUrl + "&entryScene=967&jump_from=adr_home_screen";
        }
        remoteViews.setOnClickPendingIntent(R.id.search_widget_content_lf, this.f75309a.a(context, str, "search_bottom_left", b2.iId));
        this.f75309a.c(b2.iId);
    }

    private void e(Context context, RemoteViews remoteViews) {
        SmartBox_HotWordsItem b2 = this.f75309a.b();
        boolean isEmpty = TextUtils.isEmpty(b2.sShowTitle);
        remoteViews.setTextViewText(R.id.search_widget_content_rt, isEmpty ? "点击查看今日热搜" : b2.sShowTitle);
        String str = "";
        if (!isEmpty) {
            str = b2.sUrl + "&entryScene=967&jump_from=adr_home_screen";
        } else if (this.f75310b) {
            remoteViews.setTextViewText(R.id.search_widget_content_rt, "");
        } else {
            str = "https://so.html5.qq.com/page/real/search_result?q=%E4%BB%8A%E6%97%A5%E7%83%AD%E6%90%9C&entryScene=967&jump_from=adr_home_screen";
        }
        remoteViews.setOnClickPendingIntent(R.id.search_widget_content_rt, this.f75309a.a(context, str, "search_bottom_right", b2.iId));
    }

    private void f(Context context, RemoteViews remoteViews) {
        remoteViews.setOnClickPendingIntent(R.id.search_widget_refresh_icon, this.f75309a.a(context, "", "search_refresh_icon", 0));
    }

    @Override
    public void a(Context context, Intent intent) {
        String str;
        Uri data = intent.getData();
        String schemeSpecificPart = data != null ? data.getSchemeSpecificPart() : null;
        if (schemeSpecificPart == null) {
            return;
        }
        AppWidgetManager appWidgetManager = AppWidgetManager.getInstance(context);
        ComponentName componentName = new ComponentName(context, (Class<?>) SearchWidgetProvider.class);
        RemoteViews remoteViews = new RemoteViews(context.getPackageName(), R.layout.r2);
        String encode = Uri.encode(intent.getStringExtra("jump_url"));
        char c2 = 1;
        SearchLog.a("桌面widget", "SearchWidgetBottom:handleClickAction", "clickArea:" + schemeSpecificPart + ",destPageUrl:" + encode, 1);
        switch (schemeSpecificPart.hashCode()) {
            case -1859917436:
                if (schemeSpecificPart.equals("search_bottom_left")) {
                    c2 = 2;
                    break;
                }
                c2 = 65535;
                break;
            case -1817204673:
                break;
            case -387602811:
                if (schemeSpecificPart.equals("search_bottom_button_top")) {
                    c2 = 4;
                    break;
                }
                c2 = 65535;
                break;
            case -164140908:
                if (schemeSpecificPart.equals("search_refresh_icon")) {
                    c2 = 3;
                    break;
                }
                c2 = 65535;
                break;
            case 868966615:
                if (schemeSpecificPart.equals("search_bottom_button_left")) {
                    c2 = 6;
                    break;
                }
                c2 = 65535;
                break;
            case 996292300:
                if (schemeSpecificPart.equals("search_center")) {
                    c2 = 0;
                    break;
                }
                c2 = 65535;
                break;
            case 1173822284:
                if (schemeSpecificPart.equals("search_bottom_button_right")) {
                    c2 = 7;
                    break;
                }
                c2 = 65535;
                break;
            case 1595840805:
                if (schemeSpecificPart.equals("search_bottom_button_center")) {
                    c2 = 5;
                    break;
                }
                c2 = 65535;
                break;
            default:
                c2 = 65535;
                break;
        }
        switch (c2) {
            case 0:
                TKDSearchHotwordProxyImpl o = TKDSearchHotwordProxyImpl.o();
                SearchWidgetHelper searchWidgetHelper = this.f75309a;
                o.s_(searchWidgetHelper.a(searchWidgetHelper.d()));
                SearchWidgetOpManager.j();
                str = "SEARCH_WIDGET_BOTTOM_CENTER_WORDS_CLICK";
                PlatformStatUtils.a(str);
                break;
            case 1:
                e(context, remoteViews);
                if (!TextUtils.isEmpty(encode)) {
                    SearchWidgetOpManager.j();
                    SearchWidgetOpManager.k();
                    str = "SEARCH_WIDGET_BOTTOM_RIGHT_WORDS_CLICK";
                    PlatformStatUtils.a(str);
                    break;
                }
                break;
            case 2:
                d(context, remoteViews);
                if (!TextUtils.isEmpty(encode)) {
                    SearchWidgetOpManager.j();
                    SearchWidgetOpManager.k();
                    str = "SEARCH_WIDGET_BOTTOM_WORDS_CLICK";
                    PlatformStatUtils.a(str);
                    break;
                }
                break;
            case 3:
                b(context, remoteViews);
                SearchWidgetOpManager.l();
                str = "SEARCH_WIDGET_BOTTOM_UPDATE";
                PlatformStatUtils.a(str);
                break;
            case 4:
            case 5:
            case 6:
            case 7:
                a(context, remoteViews);
                break;
        }
        appWidgetManager.updateAppWidget(componentName, remoteViews);
        this.f75309a.a(encode);
    }

    @Override
    public void a(Context context, RemoteViews remoteViews) {
        this.f75309a.a(this);
        remoteViews.setViewVisibility(R.id.search_widget_bottom, 0);
        d(context, remoteViews);
        e(context, remoteViews);
        c(context, remoteViews);
        f(context, remoteViews);
    }

    @Override
    public void b() {
        Context appContext = ContextHolder.getAppContext();
        AppWidgetManager appWidgetManager = AppWidgetManager.getInstance(appContext);
        ComponentName componentName = new ComponentName(appContext, (Class<?>) SearchWidgetProvider.class);
        RemoteViews remoteViews = new RemoteViews(appContext.getPackageName(), R.layout.r2);
        a(appContext, remoteViews);
        appWidgetManager.updateAppWidget(componentName, remoteViews);
    }

    public void b(Context context, RemoteViews remoteViews) {
        d(context, remoteViews);
        e(context, remoteViews);
    }

    @Override
    public void c() {
        PlatformStatUtils.a("SEARCH_WIDGET_BOTTOM_ENABLE");
    }

    @Override
    public void d() {
        this.f75309a.e();
        PlatformStatUtils.a("SEARCH_WIDGET_BOTTOM_DISABLE");
    }
}