package com.bytedance.router.route;

import X.0HH;
import android.content.Context;
import com.bytedance.covode.number.Covode;
import com.bytedance.router.OpenResultCallback;
import com.bytedance.router.RouteManager;

public class ActionRoute extends BaseRoute {
    public IRouteAction mMethodRoute;

    static {
        Covode.recordClassIndex(37248);
    }

    public ActionRoute(Class cls) {
        try {
            this.mMethodRoute = (IRouteAction) cls.newInstance();
        } catch (IllegalAccessException e) {
            0HH.LIZ(e);
        } catch (InstantiationException e2) {
            0HH.LIZ(e2);
        }
    }

    public void open(Context context) {
        IRouteAction iRouteAction = this.mMethodRoute;
        if (iRouteAction != null) {
            Object open = iRouteAction.open(context, getUrl(), getParams());
            OpenResultCallback callback = getRouteIntent().getCallback();
            if (callback != null) {
                callback.onActionResult(open);
            }
            RouteManager.getInstance().getRouteCallbackProxy().onSuccess();
        }
    }
}
