调研通 v3.0.3版本的 MD5 值为:fe075d21227d488bdb9f6aa09d3b3f35

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


package com.yyt.common.plugin;

import android.graphics.Color;
import android.graphics.PorterDuff;
import android.graphics.drawable.ColorDrawable;
import android.os.Handler;
import android.util.Log;
import android.view.KeyEvent;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.Button;
import android.widget.EditText;
import android.widget.FrameLayout;
import android.widget.TextView;
import c.o.a.a.b;
import cn.carbs.android.segmentcontrolview.library.SegmentControlView;
import com.huawei.hms.push.constant.RemoteMessageConst;
import com.stx.xhb.commontitlebar.CustomTitleBar;
import com.tencent.bugly.Bugly;
import com.tencent.smtt.sdk.TbsListener;
import com.yyt.common.YYTCordovaActivity;
import com.yyt.common.custom.YCMainTabBarActivity;
import com.yyt.common.custom.YCWebViewActivity;
import com.yyt.common.custom.YCWebViewFragment;
import com.yyt.common.custom.z;
import com.yyt.common.i.a.d;
import java.util.ArrayList;
import java.util.List;
import org.apache.cordova.CallbackContext;
import org.apache.cordova.CordovaInterface;
import org.apache.cordova.CordovaPlugin;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

public class YCNavigation extends CordovaPlugin {
    private static final String j = "YCNavigation";
    private static final String k = "setTitle";
    private static final String l = "setTitleAndSubTitle";
    private static final String m = "setTitleClick";
    private static final String n = "setLeft";
    private static final String o = "setLeftCloseBtn";
    private static final String p = "setRight";
    private static final String q = "setMenu";
    private static final String r = "setTranslucent";
    private static final String s = "setIndexTranslucent";
    private static final String t = "isShow";
    private static final String u = "setHeaderSearch";
    private static final String v = "setBackGestureEnable";
    private static final String w = "setHeaderSegment";

    private CallbackContext f11264a;

    private View f11265b;

    private CustomTitleBar f11266c;

    private View f11267d;

    private View f11268e;

    private View f11269f;
    private TextView g;
    com.stx.xhb.commontitlebar.d.a h;
    private com.yyt.common.i.a.d i;

    public class a implements z.a {
        a() {
        }

        @Override
        public void a(int i, int i2) {
            ColorDrawable colorDrawable = new ColorDrawable(Color.parseColor(com.yyt.common.o.n.d(YCNavigation.this.cordova.getActivity())));
            if (i2 >= 110) {
                if (YCNavigation.this.h()) {
                    YYTCordovaActivity.f10857c = false;
                    if (!com.yyt.common.o.n.e(YCNavigation.this.cordova.getActivity()).equals("#FFFFFF")) {
                        YCNavigation.this.j0(Color.parseColor(com.yyt.common.o.n.e(YCNavigation.this.cordova.getActivity())));
                    }
                }
                colorDrawable.setAlpha(255);
            } else {
                if (!YCNavigation.this.h()) {
                    YYTCordovaActivity.f10857c = true;
                    if (!com.yyt.common.o.n.e(YCNavigation.this.cordova.getActivity()).equals("#FFFFFF")) {
                        YCNavigation.this.j0(Color.parseColor("#FFFFFF"));
                    }
                }
                if (i2 > 0 && i2 < 110) {
                    colorDrawable.setAlpha((i2 * TbsListener.ErrorCode.CREATE_TEMP_CONF_ERROR) / 110);
                } else {
                    colorDrawable.setAlpha(0);
                }
            }
            com.stx.xhb.commontitlebar.c.e.h(YCNavigation.this.f11265b, colorDrawable);
        }

        @Override
        public void b(int i, int i2) {
        }
    }

    public void B(final CordovaPlugin cordovaPlugin) {
        if (this.h == null) {
            this.h = this.f11266c.b(b.h.icon_close, b.i.topbar_left_button2);
            int parseColor = Color.parseColor(com.yyt.common.o.n.e(this.cordova.getActivity()));
            if (this.h.getTag() != null) {
                this.cordova.getActivity().getResources().getDrawable(((Integer) this.h.getTag()).intValue()).setColorFilter(parseColor, PorterDuff.Mode.SRC_ATOP);
            }
            if (h()) {
                new Handler().postDelayed(new Runnable() {
                    @Override
                    public final void run() {
                        YCNavigation.this.D();
                    }
                }, 0L);
            }
            this.h.setOnClickListener(new View.OnClickListener() {
                @Override
                public final void onClick(View view) {
                    CordovaPlugin.this.webView.loadUrl("javascript:YC.Navigation.popToRoot()");
                }
            });
        }
    }

    public void D() {
        this.f11266c.setBackgroundDrawable(new ColorDrawable(Color.parseColor("#00000000")));
    }

    public static void F(CordovaPlugin cordovaPlugin, JSONObject jSONObject, CallbackContext callbackContext, View view) {
        try {
            cordovaPlugin.webView.loadUrl("javascript:YC.Navigation.menuHandler('" + jSONObject.getString("id") + "')");
        } catch (JSONException e2) {
            Log.e(j, "获取右边第二个按钮的id出错。" + e2.getMessage(), e2);
            callbackContext.error("获取右边第二个按钮的id出错。" + e2.getMessage());
        }
    }

    public void I(JSONArray jSONArray, int i, final CordovaPlugin cordovaPlugin, JSONObject jSONObject, CallbackContext callbackContext, View view) {
        try {
            if (jSONArray != null && i > 2) {
                g(cordovaPlugin, jSONArray, new d.c() {
                    @Override
                    public final void a(AdapterView adapterView, View view2, int i2, long j2, com.yyt.common.i.a.e eVar) {
                        CordovaPlugin.this.webView.loadUrl("javascript:YC.Navigation.menuHandler('" + eVar.b() + "')");
                    }
                }).O(this.f11268e);
            } else {
                cordovaPlugin.webView.loadUrl("javascript:YC.Navigation.menuHandler('" + jSONObject.getString("id") + "')");
            }
        } catch (JSONException e2) {
            Log.e(j, "获取右边第二个按钮的id出错。" + e2.getMessage(), e2);
            callbackContext.error("获取右边第二个按钮的id出错。" + e2.getMessage());
        }
    }

    public static void J(CordovaPlugin cordovaPlugin, JSONObject jSONObject, CallbackContext callbackContext, View view) {
        try {
            cordovaPlugin.webView.loadUrl("javascript:YC.Navigation.menuHandler('" + jSONObject.getString("id") + "')");
        } catch (JSONException e2) {
            Log.e(j, "获取右边第一个按钮的id出错。" + e2.getMessage(), e2);
            callbackContext.error("获取右边第一个按钮的id出错。" + e2.getMessage());
        }
    }

    public void L(final JSONArray jSONArray, final CordovaPlugin cordovaPlugin, final CallbackContext callbackContext, JSONObject jSONObject, final int i) {
        try {
            this.f11266c.D();
            if (jSONArray != null && jSONArray.length() > 0) {
                if (jSONArray.length() == 1) {
                    final JSONObject jSONObject2 = jSONArray.getJSONObject(0);
                    this.f11268e = e(jSONObject2.has(RemoteMessageConst.Notification.ICON) ? jSONObject2.getString(RemoteMessageConst.Notification.ICON) : null, jSONObject2.has("text") ? jSONObject2.getString("text") : "", b.i.topbar_right_about_button, "right", new View.OnClickListener() {
                        @Override
                        public final void onClick(View view) {
                            YCNavigation.F(CordovaPlugin.this, jSONObject2, callbackContext, view);
                        }
                    });
                    return;
                }
                final JSONObject jSONObject3 = jSONArray.getJSONObject(1);
                final JSONObject jSONObject4 = jSONArray.getJSONObject(0);
                String string = jSONObject3.has(RemoteMessageConst.Notification.ICON) ? jSONObject3.getString(RemoteMessageConst.Notification.ICON) : null;
                String string2 = (jSONArray.length() == 2 && jSONObject3.has("text")) ? jSONObject3.getString("text") : "";
                if (string != null) {
                    String string3 = jSONObject.has("moreIcon") ? jSONObject.getString("moreIcon") : "icon_more";
                    if (jSONArray.length() != 2) {
                        string = string3;
                    }
                }
                String str = string;
                if (jSONArray.length() > 2) {
                    jSONArray.remove(0);
                }
                this.f11268e = e(str, string2, b.i.topbar_right_about_button, "right", new View.OnClickListener() {
                    @Override
                    public final void onClick(View view) {
                        YCNavigation.this.I(jSONArray, i, cordovaPlugin, jSONObject3, callbackContext, view);
                    }
                });
                this.f11269f = e(jSONObject4.has(RemoteMessageConst.Notification.ICON) ? jSONObject4.getString(RemoteMessageConst.Notification.ICON) : null, jSONObject4.has("text") ? jSONObject4.getString("text") : "", b.i.topbar_right_button, "right", new View.OnClickListener() {
                    @Override
                    public final void onClick(View view) {
                        YCNavigation.J(CordovaPlugin.this, jSONObject4, callbackContext, view);
                    }
                });
                jSONArray.length();
                return;
            }
            this.f11266c.D();
        } catch (JSONException e2) {
            Log.e(j, "调用插件的数据格式出错:" + e2.getMessage(), e2);
        }
    }

    public void O(JSONArray jSONArray, JSONObject jSONObject, final CordovaPlugin cordovaPlugin, View view) {
        if (jSONArray != null && jSONArray.length() > 0) {
            try {
                g(cordovaPlugin, jSONObject.getJSONArray("items"), new d.c() {
                    @Override
                    public final void a(AdapterView adapterView, View view2, int i, long j2, com.yyt.common.i.a.e eVar) {
                        CordovaPlugin.this.webView.loadUrl("javascript:YC.Navigation.rightHandler('" + eVar.b() + "')");
                    }
                }).O(this.f11268e);
            } catch (JSONException unused) {
            }
        } else {
            cordovaPlugin.webView.loadUrl("javascript:YC.Navigation.rightHandler()");
        }
    }

    public void Q(final JSONObject jSONObject, final CordovaPlugin cordovaPlugin) {
        try {
            this.f11266c.D();
            if (Boolean.parseBoolean(jSONObject.getString("show"))) {
                String string = jSONObject.has(RemoteMessageConst.Notification.ICON) ? jSONObject.getString(RemoteMessageConst.Notification.ICON) : null;
                String string2 = jSONObject.has("text") ? jSONObject.getString("text") : "";
                final JSONArray jSONArray = jSONObject.has("items") ? jSONObject.getJSONArray("items") : null;
                this.f11268e = e(string, string2, b.i.topbar_right_about_button, "right", new View.OnClickListener() {
                    @Override
                    public final void onClick(View view) {
                        YCNavigation.this.O(jSONArray, jSONObject, cordovaPlugin, view);
                    }
                });
            }
        } catch (JSONException e2) {
            Log.e(j, "调用插件的数据格式出错:" + e2.getMessage(), e2);
        }
    }

    public void S(String str) {
        this.f11266c.E();
        int parseColor = Color.parseColor(com.yyt.common.o.n.e(this.cordova.getActivity()));
        if (h()) {
            parseColor = Color.parseColor("#FFFFFF");
        }
        this.f11266c.setmTitleTextColor(parseColor);
        this.g = this.f11266c.H(str);
    }

    public void U(String str, String str2) {
        this.f11266c.E();
        int parseColor = Color.parseColor(com.yyt.common.o.n.e(this.cordova.getActivity()));
        if (h()) {
            parseColor = Color.parseColor("#FFFFFF");
        }
        this.f11266c.setmTitleTextColor(parseColor);
        this.g = this.f11266c.H(str);
        this.f11266c.setSubTitle(str2);
    }

    public void X(final CordovaPlugin cordovaPlugin) {
        TextView textView = this.g;
        if (textView != null) {
            textView.setOnClickListener(new View.OnClickListener() {
                @Override
                public final void onClick(View view) {
                    CordovaPlugin.this.webView.loadUrl("javascript:YC.Navigation.titleHandler()");
                }
            });
        }
    }

    private void Y(View view, int i) {
        if (view == null) {
            return;
        }
        if (view instanceof Button) {
            ((Button) view).setTextColor(i);
        }
        if (view instanceof com.stx.xhb.commontitlebar.d.a) {
            try {
                ((com.stx.xhb.commontitlebar.d.a) view).getDrawable().setColorFilter(i, PorterDuff.Mode.SRC_ATOP);
            } catch (Exception e2) {
                Log.e(j, e2.getMessage(), e2);
            }
        }
    }

    private void Z(final JSONArray jSONArray) {
        this.cordova.getActivity().runOnUiThread(new Runnable() {
            @Override
            public final void run() {
                YCNavigation.this.q(jSONArray, this);
            }
        });
    }

    private void a0(JSONArray jSONArray) {
        try {
            JSONArray jSONArray2 = jSONArray.getJSONObject(0).getJSONArray("array");
            final ArrayList arrayList = new ArrayList();
            for (int i = 0; jSONArray2.length() > i; i++) {
                arrayList.add(jSONArray2.getString(i));
            }
            this.cordova.getActivity().runOnUiThread(new Runnable() {
                @Override
                public final void run() {
                    YCNavigation.this.t(this, arrayList);
                }
            });
        } catch (JSONException unused) {
        }
    }

    private void b0(JSONArray jSONArray, CallbackContext callbackContext) throws Exception {
        final String string = jSONArray.getString(0);
        final com.yyt.common.custom.z zVar = (com.yyt.common.custom.z) this.webView.getEngine().getView();
        this.cordova.getActivity().runOnUiThread(new Runnable() {
            @Override
            public final void run() {
                YCNavigation.this.v(string, zVar);
            }
        });
    }

    private void c0(JSONArray jSONArray) throws Exception {
        final JSONObject jSONObject = jSONArray.getJSONObject(0);
        this.cordova.getActivity().runOnUiThread(new Runnable() {
            @Override
            public final void run() {
                YCNavigation.this.z(jSONObject, this);
            }
        });
    }

    private View d(String str, String str2, int i, String str3) {
        if (str != null && !"".equals(str)) {
            int a2 = com.yyt.common.o.p.a(this.cordova.getActivity(), str + ".png");
            if (a2 != -1) {
                r2 = str3.equals("left") ? this.f11266c.b(a2, i) : null;
                if (str3.equals("right")) {
                    r2 = this.f11266c.i(a2, i);
                }
            }
        } else {
            r2 = str3.equals("left") ? this.f11266c.e(str2, i) : null;
            if (str3.equals("right")) {
                r2 = this.f11266c.l(str2, i);
            }
        }
        if (r2 != null) {
            f(r2);
            int a3 = com.stx.xhb.commontitlebar.c.a.a(this.cordova.getActivity(), 4);
            r2.setPadding(a3, a3, a3, a3);
        }
        return r2;
    }

    private void d0(JSONArray jSONArray) {
        this.cordova.getActivity().runOnUiThread(new Runnable() {
            @Override
            public final void run() {
                YCNavigation.this.B(this);
            }
        });
    }

    private View e(String str, String str2, int i, String str3, View.OnClickListener onClickListener) {
        View d2 = d(str, str2, i, str3);
        if (d2 != null) {
            d2.setOnClickListener(onClickListener);
        }
        return d2;
    }

    private void e0(JSONArray jSONArray, final CallbackContext callbackContext) throws Exception {
        final JSONObject jSONObject = jSONArray.getJSONObject(0);
        final JSONArray jSONArray2 = jSONObject.has("items") ? jSONObject.getJSONArray("items") : null;
        final int length = jSONArray2 == null ? 0 : jSONArray2.length();
        this.cordova.getActivity().runOnUiThread(new Runnable() {
            @Override
            public final void run() {
                YCNavigation.this.L(jSONArray2, this, callbackContext, jSONObject, length);
            }
        });
    }

    private void f(View view) {
        int parseColor = Color.parseColor(com.yyt.common.o.n.e(this.cordova.getActivity()));
        if (h()) {
            parseColor = Color.parseColor("#FFFFFF");
        }
        Y(view, parseColor);
    }

    private void f0(JSONArray jSONArray) throws Exception {
        final JSONObject jSONObject = jSONArray.getJSONObject(0);
        this.cordova.getActivity().runOnUiThread(new Runnable() {
            @Override
            public final void run() {
                YCNavigation.this.Q(jSONObject, this);
            }
        });
    }

    private com.yyt.common.i.a.d g(CordovaPlugin cordovaPlugin, JSONArray jSONArray, d.c cVar) {
        if (this.i == null) {
            this.i = new com.yyt.common.i.a.d(cordovaPlugin.cordova.getActivity());
        }
        this.i.M(-1);
        this.i.G(b.h.bg_drop_pop_menu_white_shap);
        this.i.I(-16777216);
        this.i.H(true);
        this.i.L(cVar);
        ArrayList arrayList = new ArrayList();
        for (int i = 0; i < jSONArray.length(); i++) {
            try {
                JSONObject jSONObject = jSONArray.getJSONObject(i);
                arrayList.add(new com.yyt.common.i.a.e(com.yyt.common.o.p.a(cordovaPlugin.cordova.getActivity(), jSONObject.getString(RemoteMessageConst.Notification.ICON) + ".png"), jSONObject.getString("id"), jSONObject.getString("text")));
            } catch (Exception unused) {
            }
        }
        this.i.J(arrayList);
        return this.i;
    }

    private void g0(JSONArray jSONArray, CallbackContext callbackContext) throws Exception {
        final String string = jSONArray.getString(0);
        this.cordova.getActivity().runOnUiThread(new Runnable() {
            @Override
            public final void run() {
                YCNavigation.this.S(string);
            }
        });
        callbackContext.success();
    }

    public boolean h() {
        if ((this.cordova.getActivity() instanceof YCWebViewActivity) || (this.cordova instanceof YCWebViewFragment)) {
            return false;
        }
        return YYTCordovaActivity.f10857c;
    }

    private void h0(JSONArray jSONArray, CallbackContext callbackContext) throws Exception {
        final String string = jSONArray.getString(0);
        final String string2 = jSONArray.getString(1);
        this.cordova.getActivity().runOnUiThread(new Runnable() {
            @Override
            public final void run() {
                YCNavigation.this.U(string, string2);
            }
        });
        callbackContext.success();
    }

    private void i(JSONArray jSONArray, CallbackContext callbackContext) throws Exception {
        final String string = jSONArray.getString(0);
        this.cordova.getActivity().runOnUiThread(new Runnable() {
            @Override
            public final void run() {
                YCNavigation.this.m(string);
            }
        });
        callbackContext.success();
    }

    private void i0() {
        this.cordova.getActivity().runOnUiThread(new Runnable() {
            @Override
            public final void run() {
                YCNavigation.this.X(this);
            }
        });
    }

    public void k(String str) {
        c.s.a.c.m(this.cordova.getActivity(), "true".equals(str));
    }

    public void j0(int i) {
        View view = this.f11267d;
        if (view != null) {
            f(view);
        }
        View view2 = this.f11268e;
        if (view2 != null) {
            f(view2);
        }
        View view3 = this.f11269f;
        if (view3 != null) {
            f(view3);
        }
        TextView textView = this.g;
        if (textView != null) {
            textView.setTextColor(i);
        }
    }

    public void m(String str) {
        if (str.equals(Bugly.SDK_IS_DEV)) {
            this.f11266c.setVisibility(8);
        }
        if (str.equals("true")) {
            this.f11266c.setVisibility(0);
        }
    }

    public static boolean n(CordovaPlugin cordovaPlugin, TextView textView, int i, KeyEvent keyEvent) {
        if (i != 4 && (keyEvent == null || keyEvent.getKeyCode() != 66)) {
            return false;
        }
        cordovaPlugin.webView.loadUrl("javascript:YC.Navigation.searchHandler('" + ((Object) textView.getText()) + "')");
        return true;
    }

    public void q(JSONArray jSONArray, final CordovaPlugin cordovaPlugin) {
        this.f11266c.F();
        try {
            JSONObject jSONObject = jSONArray.getJSONObject(0);
            this.f11266c.F();
            View inflate = LayoutInflater.from(cordovaPlugin.cordova.getActivity()).inflate(b.l.view_header_search, (ViewGroup) null, false);
            EditText editText = (EditText) inflate.findViewById(b.i.header_view_search);
            editText.setHint(jSONObject.has("text") ? jSONObject.getString("text") : "");
            ((FrameLayout) inflate.findViewById(b.i.header_view_search_layout)).setVisibility(0);
            View findViewById = inflate.findViewById(b.i.view_search_tran);
            if (jSONObject.has("inputEnable") && "true".equals(jSONObject.getString("inputEnable"))) {
                findViewById.setVisibility(8);
                editText.setOnEditorActionListener(new TextView.OnEditorActionListener() {
                    @Override
                    public final boolean onEditorAction(TextView textView, int i, KeyEvent keyEvent) {
                        return YCNavigation.n(CordovaPlugin.this, textView, i, keyEvent);
                    }
                });
            } else {
                findViewById.setOnClickListener(new View.OnClickListener() {
                    @Override
                    public final void onClick(View view) {
                        CordovaPlugin.this.webView.loadUrl("javascript:YC.Navigation.searchHandler()");
                    }
                });
            }
            this.f11266c.setCenterView(inflate);
        } catch (JSONException e2) {
            com.yyt.common.plugin.logger.c.a(j, "setHeaderSearch时出错:" + e2.getMessage(), e2);
        }
    }

    public void t(final CordovaPlugin cordovaPlugin, List list) {
        this.f11266c.F();
        View inflate = LayoutInflater.from(cordovaPlugin.cordova.getActivity()).inflate(b.l.view_header_segment, (ViewGroup) null, false);
        SegmentControlView segmentControlView = (SegmentControlView) inflate.findViewById(b.i.header_view_segment);
        segmentControlView.setSelectedIndex(0);
        segmentControlView.setTexts((String[]) list.toArray(new String[list.size()]));
        segmentControlView.setOnSegmentChangedListener(new SegmentControlView.c() {
            @Override
            public final void a(int i) {
                CordovaPlugin.this.webView.loadUrl("javascript:YC.Navigation.segmentHandler('" + i + "')");
            }
        });
        this.f11266c.setCenterView(inflate);
    }

    public void v(String str, com.yyt.common.custom.z zVar) {
        if (str.equals(Bugly.SDK_IS_DEV)) {
            com.stx.xhb.commontitlebar.c.e.f(this.f11265b, Color.parseColor(com.yyt.common.o.n.d(this.cordova.getActivity())));
            zVar.setOnScrollChangedCallback(null);
            YYTCordovaActivity.f10857c = false;
        }
        if (str.equals("true")) {
            ViewGroup.MarginLayoutParams marginLayoutParams = (ViewGroup.MarginLayoutParams) zVar.getLayoutParams();
            marginLayoutParams.topMargin = 0;
            zVar.setLayoutParams(marginLayoutParams);
            YYTCordovaActivity.f10857c = true;
            com.stx.xhb.commontitlebar.c.e.f(this.f11265b, Color.parseColor("#00000000"));
            zVar.setOnScrollChangedCallback(new a());
        }
    }

    public static void w(CordovaPlugin cordovaPlugin, View view) {
        if (cordovaPlugin.webView.getUrl().startsWith("http") && cordovaPlugin.webView.getEngine().canGoBack()) {
            cordovaPlugin.webView.getEngine().goBack();
        } else {
            cordovaPlugin.webView.loadUrl("javascript:YC.Navigation.leftHandler()");
        }
    }

    public void z(JSONObject jSONObject, final CordovaPlugin cordovaPlugin) {
        try {
            CustomTitleBar customTitleBar = this.f11266c;
            int i = b.i.topbar_left_button2;
            com.stx.xhb.commontitlebar.d.a aVar = (com.stx.xhb.commontitlebar.d.a) customTitleBar.findViewById(i);
            this.f11266c.C();
            if (Boolean.parseBoolean(jSONObject.getString("show"))) {
                this.f11267d = e(jSONObject.has(RemoteMessageConst.Notification.ICON) ? jSONObject.getString(RemoteMessageConst.Notification.ICON) : null, jSONObject.has("text") ? jSONObject.getString("text") : "", b.i.topbar_left_button, "left", new View.OnClickListener() {
                    @Override
                    public final void onClick(View view) {
                        YCNavigation.w(CordovaPlugin.this, view);
                    }
                });
            }
            if (aVar != null) {
                e("icon_close", "", i, "left", new View.OnClickListener() {
                    @Override
                    public final void onClick(View view) {
                        CordovaPlugin.this.webView.loadUrl("javascript:YC.Navigation.popToRoot()");
                    }
                });
            }
        } catch (JSONException e2) {
            Log.e(j, "调用插件的数据格式出错:" + e2.getMessage(), e2);
        }
    }

    @Override
    public boolean execute(String str, JSONArray jSONArray, CallbackContext callbackContext) throws JSONException {
        if (this.cordova.getActivity() instanceof YCMainTabBarActivity) {
            this.f11265b = ((YCMainTabBarActivity) this.cordova.getActivity()).E();
            this.f11266c = ((YCMainTabBarActivity) this.cordova.getActivity()).P();
        } else {
            CordovaInterface cordovaInterface = this.cordova;
            if (cordovaInterface instanceof YCWebViewFragment) {
                this.f11265b = ((YCWebViewFragment) cordovaInterface).i();
                this.f11266c = ((YCWebViewFragment) this.cordova).j();
            } else {
                View findViewById = cordovaInterface.getActivity().findViewById(b.i.title_layout);
                this.f11265b = findViewById;
                this.f11266c = (CustomTitleBar) findViewById.findViewById(b.i.titlebar);
            }
        }
        if (this.f11265b != null && this.f11266c != null) {
            try {
                this.f11264a = callbackContext;
                if (k.equals(str)) {
                    g0(jSONArray, this.f11264a);
                }
                if (l.equals(str)) {
                    h0(jSONArray, this.f11264a);
                }
                if (m.equals(str)) {
                    i0();
                }
                if (n.equals(str)) {
                    c0(jSONArray);
                }
                if (o.equals(str)) {
                    d0(jSONArray);
                }
                if (v.equals(str)) {
                    final String str2 = (String) jSONArray.get(0);
                    this.cordova.getActivity().runOnUiThread(new Runnable() {
                        @Override
                        public final void run() {
                            YCNavigation.this.k(str2);
                        }
                    });
                }
                if (p.equals(str)) {
                    f0(jSONArray);
                }
                if (q.equals(str)) {
                    e0(jSONArray, this.f11264a);
                }
                if (r.equals(str) || s.equals(str)) {
                    b0(jSONArray, this.f11264a);
                }
                if (t.equals(str)) {
                    i(jSONArray, this.f11264a);
                }
                if (u.equals(str)) {
                    Z(jSONArray);
                }
                if (w.equals(str)) {
                    a0(jSONArray);
                }
                return true;
            } catch (Exception e2) {
                Log.e(j, e2.getMessage(), e2);
            }
        }
        return true;
    }

    @Override
    public void onResume(boolean z) {
        View view = this.f11267d;
        if (view != null) {
            f(view);
        }
        View view2 = this.f11268e;
        if (view2 != null) {
            f(view2);
        }
        View view3 = this.f11269f;
        if (view3 != null) {
            f(view3);
        }
        super.onResume(z);
    }
}