package com.tencent.mm.plugin.webview.ui.tools.widget;

import android.os.Bundle;
import com.tencent.matrix.trace.core.AppMethodBeat;
import com.tencent.mm.plugin.webview.stub.c;
import com.tencent.mm.protocal.JsapiPermissionWrapper;
import com.tencent.mm.sdk.platformtools.ab;
import com.tencent.mm.sdk.platformtools.bo;
import com.tencent.ytcommon.BuildConfig;
import java.util.HashMap;

class k$5 extends m {
    final /* synthetic */ k uJE;
    private m uJF = new m();

    k$5(k kVar) {
        this.uJE = kVar;
        AppMethodBeat.i(9942);
        AppMethodBeat.o(9942);
    }

    private m dcW() {
        AppMethodBeat.i(9943);
        m aGt = this.uJE.aGt();
        if (aGt == null) {
            aGt = this.uJF;
            AppMethodBeat.o(9943);
            return aGt;
        }
        AppMethodBeat.o(9943);
        return aGt;
    }

    public final boolean IZ(int i) {
        AppMethodBeat.i(9944);
        boolean IZ = dcW().IZ(i);
        AppMethodBeat.o(9944);
        return IZ;
    }

    public final boolean c(int i, Bundle bundle) {
        AppMethodBeat.i(9945);
        ab.i("MicroMsg.MMWebViewClient", "callback, actionCode = ".concat(String.valueOf(i)));
        HashMap hashMap;
        final String string;
        final int i2;
        switch (i) {
            case 90:
                if (this.uJE.uDd != null) {
                    this.uJE.mHandler.post(new 5(this, bundle));
                    break;
                }
                break;
            case 1002:
                this.uJE.mHandler.post(new 1(this, bundle));
                break;
            case 1003:
                this.uJE.mHandler.post(new 10(this, bundle));
                break;
            case 1006:
                if (this.uJE.uDd != null) {
                    this.uJE.mHandler.post(new 4(this, bundle));
                    break;
                }
                break;
            case 1007:
                long j = bundle.getLong("download_manager_downloadid");
                int i3 = bundle.getInt("download_manager_progress");
                this.uJE.mHandler.post(new 12(this, bundle.getString("download_manager_appid", BuildConfig.FLAVOR), j, i3));
                break;
            case 1008:
                this.uJE.mHandler.post(new 11(this, bundle));
                break;
            case 2002:
                hashMap = new HashMap();
                hashMap.put("err_msg", bundle.getString("playResult"));
                hashMap.put("localId", bundle.getString("localId"));
                this.uJE.mHandler.post(new 2(this, hashMap));
                break;
            case 2003:
                this.uJE.mHandler.post(new 13(this, bundle.getString("webview_jssdk_file_item_local_id"), bundle.getInt("webview_jssdk_file_item_progreess")));
                break;
            case 2004:
                string = bundle.getString("webview_jssdk_file_item_local_id");
                i2 = bundle.getInt("webview_jssdk_file_item_progreess");
                this.uJE.mHandler.post(new Runnable() {
                    public final void run() {
                        AppMethodBeat.i(9938);
                        if (k$5.this.uJE.uDd != null) {
                            k$5.this.uJE.uDd.dI(string, i2);
                        }
                        AppMethodBeat.o(9938);
                    }
                });
                break;
            case 2005:
                this.uJE.mHandler.post(new 15(this, bundle.getString("webview_jssdk_file_item_local_id"), bundle.getInt("webview_jssdk_file_item_progreess")));
                break;
            case 2006:
                string = bundle.getString("webview_jssdk_file_item_local_id");
                i2 = bundle.getInt("webview_jssdk_file_item_progreess");
                this.uJE.mHandler.post(new Runnable() {
                    public final void run() {
                        AppMethodBeat.i(9940);
                        if (k$5.this.uJE.uDd != null) {
                            k$5.this.uJE.uDd.dK(string, i2);
                        }
                        AppMethodBeat.o(9940);
                    }
                });
                break;
            case 2008:
                hashMap = new HashMap();
                hashMap.put("localId", bundle.getString("localId"));
                hashMap.put("err_msg", bundle.getString("recordResult"));
                this.uJE.mHandler.post(new 3(this, hashMap));
                break;
            case 2010:
                this.uJE.mHandler.post(new 17(this, bundle.getString("webview_jssdk_file_item_local_id"), bundle.getInt("webview_jssdk_file_item_progreess")));
                break;
            case 40001:
                if (this.uJE.uDd != null) {
                    this.uJE.mHandler.post(new 6(this, bundle.getString("err_msg")));
                    break;
                }
                break;
            case 40002:
                String string2 = bundle.getString("uuid");
                int i4 = bundle.getInt("major");
                int i5 = bundle.getInt("minor");
                double d = bundle.getDouble("accuracy");
                double d2 = bundle.getDouble("rssi");
                float f = bundle.getFloat("heading");
                if (this.uJE.uDd != null) {
                    this.uJE.mHandler.post(new 7(this, bundle.getString("err_msg"), string2, i4, i5, d, d2, f));
                    break;
                }
                break;
            default:
                ab.e("MicroMsg.MMWebViewClient", "undefine action code!!!");
                break;
        }
        dcW().c(i, bundle);
        AppMethodBeat.o(9945);
        return true;
    }

    public final boolean a(c cVar) {
        AppMethodBeat.i(9946);
        if (this.uJE.fow == null) {
            AppMethodBeat.o(9946);
            return true;
        }
        ab.i("MicroMsg.MMWebViewClient", "onSceneEnd, instance hashcode = " + this.uJE.fow.hashCode());
        this.uJE.mHandler.post(new 8(this, cVar.getType(), cVar.cYW(), cVar.cYX(), cVar.adx(), cVar.getData()));
        boolean a = dcW().a(cVar);
        AppMethodBeat.o(9946);
        return a;
    }

    public final boolean a(String str, String str2, Bundle bundle, boolean z) {
        AppMethodBeat.i(9947);
        if (this.uJE.uDd == null) {
            AppMethodBeat.o(9947);
        } else {
            this.uJE.mHandler.post(new 9(this, str, str2, bundle, z));
            dcW().a(str, str2, bundle, z);
            AppMethodBeat.o(9947);
        }
        return false;
    }

    public final String cYY() {
        return this.uJE.uJt;
    }

    public final String getCurrentUrl() {
        AppMethodBeat.i(9948);
        String c = k.c(this.uJE);
        AppMethodBeat.o(9948);
        return c;
    }

    public final String cYZ() {
        AppMethodBeat.i(9949);
        String cYZ = dcW().cYZ();
        AppMethodBeat.o(9949);
        return cYZ;
    }

    public final void nJ(boolean z) {
        AppMethodBeat.i(9950);
        dcW().nJ(z);
        AppMethodBeat.o(9950);
    }

    public final void nK(boolean z) {
        AppMethodBeat.i(9951);
        dcW().nK(z);
        AppMethodBeat.o(9951);
    }

    public final void q(int i, Bundle bundle) {
        AppMethodBeat.i(9952);
        dcW().q(i, bundle);
        AppMethodBeat.o(9952);
    }

    public final void cZb() {
        AppMethodBeat.i(9953);
        if (this.uJE.uDd != null) {
            this.uJE.uDd.cZb();
        }
        AppMethodBeat.o(9953);
    }

    public final void W(Bundle bundle) {
        AppMethodBeat.i(9954);
        dcW().W(bundle);
        AppMethodBeat.o(9954);
    }

    public final void afd(String str) {
        AppMethodBeat.i(9955);
        dcW().afd(str);
        AppMethodBeat.o(9955);
    }

    public final void hd(String str, String str2) {
        AppMethodBeat.i(9956);
        dcW().hd(str, str2);
        AppMethodBeat.o(9956);
    }

    public final void cZc() {
        AppMethodBeat.i(9957);
        if (this.uJE.uDd != null) {
            this.uJE.uDd.cZc();
        }
        AppMethodBeat.o(9957);
    }

    public final void e(String str, String str2, int i, int i2) {
        AppMethodBeat.i(9958);
        dcW().e(str, str2, i, i2);
        AppMethodBeat.o(9958);
    }

    public final Bundle g(int i, Bundle bundle) {
        AppMethodBeat.i(9959);
        Bundle bundle2;
        if (i == 146) {
            bundle2 = new Bundle();
            String string = bundle.getString("_url");
            if (bo.isNullOrNil(string)) {
                AppMethodBeat.o(9959);
                return bundle2;
            }
            JsapiPermissionWrapper aei = this.uJE.uFu.aei(string);
            if (aei == null) {
                AppMethodBeat.o(9959);
                return bundle2;
            }
            bundle2.putParcelable("_permission_wrapper", aei);
            AppMethodBeat.o(9959);
            return bundle2;
        }
        bundle2 = dcW().g(i, bundle);
        AppMethodBeat.o(9959);
        return bundle2;
    }

    public final void X(Bundle bundle) {
        AppMethodBeat.i(9960);
        dcW().X(bundle);
        AppMethodBeat.o(9960);
    }

    public final void nL(boolean z) {
        AppMethodBeat.i(9961);
        dcW().nL(z);
        AppMethodBeat.o(9961);
    }

    public final void he(String str, String str2) {
        AppMethodBeat.i(9962);
        dcW().he(str, str2);
        AppMethodBeat.o(9962);
    }

    public final Bundle dj(String str, String str2) {
        AppMethodBeat.i(9963);
        Bundle dj = dcW().dj(str, str2);
        AppMethodBeat.o(9963);
        return dj;
    }
}
