package com.tencent.mm.plugin.websearch.widget;

import android.os.Bundle;
import com.tencent.matrix.trace.core.AppMethodBeat;
import com.tencent.mm.g.b.a.ad;
import com.tencent.mm.ipcinvoker.a;
import com.tencent.mm.ipcinvoker.c;
import com.tencent.mm.ipcinvoker.i;
import com.tencent.mm.modelappbrand.v;
import com.tencent.mm.plugin.websearch.api.WidgetData;
import com.tencent.mm.sdk.platformtools.ab;
import com.tencent.mm.sdk.platformtools.ah;
import com.tencent.mm.sdk.platformtools.at;

class d$a implements a<Bundle, Bundle>, i<Bundle, Bundle> {
    private d$a() {
    }

    public final /* synthetic */ void a(Object obj, c cVar) {
        AppMethodBeat.i(91436);
        Bundle bundle = (Bundle) obj;
        WidgetData widgetData;
        switch (bundle.getInt("action")) {
            case 2:
                e.cVQ();
                AppMethodBeat.o(91436);
                return;
            case 3:
                e.cVQ().b((WidgetData) bundle.getParcelable("data"), bundle.getString("err"));
                AppMethodBeat.o(91436);
                return;
            case 4:
                widgetData = (WidgetData) bundle.getParcelable("data");
                e.cVQ().udo.add(widgetData);
                AppMethodBeat.o(91436);
                return;
            case 5:
                widgetData = (WidgetData) bundle.getParcelable("data");
                e.cVQ().udo.remove(widgetData);
                AppMethodBeat.o(91436);
                return;
            case 6:
                e cVQ = e.cVQ();
                widgetData = (WidgetData) bundle.getParcelable("data");
                com.tencent.mm.plugin.websearch.widget.a.a aVar = new com.tencent.mm.plugin.websearch.widget.a.a();
                aVar.field_appid = widgetData.ubs.fpS;
                cVQ.udp.a(aVar, new String[0]);
                AppMethodBeat.o(91436);
                return;
            case 7:
                e.cVQ().b((WidgetData) bundle.getParcelable("data"), bundle.getString("err"));
                break;
        }
        AppMethodBeat.o(91436);
    }

    public final /* synthetic */ Object am(Object obj) {
        AppMethodBeat.i(91435);
        Bundle bundle = (Bundle) obj;
        Bundle bundle2 = new Bundle();
        switch (bundle.getInt("action")) {
            case 1:
                boolean z;
                WidgetData widgetData = (WidgetData) bundle.getParcelable("data");
                e cVQ = e.cVQ();
                cVQ.cVE();
                if (cVQ.RP) {
                    com.tencent.mm.plugin.websearch.widget.a.a aVar = new com.tencent.mm.plugin.websearch.widget.a.a();
                    aVar.field_appid = widgetData.ubs.fpS;
                    if (cVQ.udp.b(aVar, new String[0])) {
                        ab.i("WidgetSafeModeProxyImpl", "safeModeRecord appid %s, proc crash count %d, js exception count %d", new Object[]{aVar.field_appid, Integer.valueOf(aVar.field_crashCount), Integer.valueOf(aVar.field_jsExceptionCount)});
                        if (System.currentTimeMillis() - aVar.field_beginTimestamp > 172800000) {
                            cVQ.udp.a(aVar, new String[0]);
                        } else if (aVar.field_pkgVersion == widgetData.ubs.version) {
                            if (aVar.field_jsExceptionCount >= 5) {
                                ab.i("WidgetSafeModeProxyImpl", "local forbidden %s", new Object[]{widgetData.toString()});
                                ad eZ = new ad().eZ(widgetData.ubs.fpS);
                                eZ.cYw = (long) widgetData.ubs.fmr;
                                eZ.cYs = 22;
                                eZ.cYt = System.currentTimeMillis();
                                eZ.fa(at.gB(ah.getContext())).ajK();
                                v.kT(32);
                                z = false;
                                bundle2.putBoolean("result", z);
                                break;
                            }
                        } else {
                            cVQ.udp.a(aVar, new String[0]);
                        }
                    }
                }
                z = true;
                bundle2.putBoolean("result", z);
        }
        AppMethodBeat.o(91435);
        return bundle2;
    }
}
