package com.ss.android.ugc.aweme.im.sdk.chat.feature.businessaccount.ui.helper;

import X.C34683i8;
import X.C41493t7;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import com.bytedance.covode.number.Covode;
import com.bytedance.router.route.IRouteAction;
import com.ss.android.ugc.aweme.AccountService;
import com.ss.android.ugc.aweme.IAccountUserService;
import com.ss.android.ugc.aweme.im.sdk.chat.feature.businessaccount.ui.activity.BaMessageSettingActivity;
import com.ss.android.ugc.aweme.profile.model.User;

public final class BaAutoMessagingRouteAction implements IRouteAction {
    static {
        Covode.recordClassIndex(84299);
    }

    public static void INVOKEVIRTUAL_com_ss_android_ugc_aweme_im_sdk_chat_feature_businessaccount_ui_helper_BaAutoMessagingRouteAction_com_ss_android_ugc_tiktok_security_lancet_ContextLancet_startActivity(Context context, Intent intent) {
        C34683i8.LIZ(intent, context);
        context.startActivity(intent);
    }

    public final Boolean open(Context context, String str, Bundle bundle) {
        User curUser;
        C41493t7 bizAccountInfo;
        if (context == null) {
            return null;
        }
        IAccountUserService LJFF = AccountService.LIZ().LJFF();
        if (LJFF == null || (curUser = LJFF.getCurUser()) == null || (bizAccountInfo = curUser.getBizAccountInfo()) == null || !bizAccountInfo.enableAutoMsg()) {
            return false;
        }
        Intent intent = new Intent(context, BaMessageSettingActivity.class);
        if (bundle != null) {
            intent.putExtras(bundle);
        }
        INVOKEVIRTUAL_com_ss_android_ugc_aweme_im_sdk_chat_feature_businessaccount_ui_helper_BaAutoMessagingRouteAction_com_ss_android_ugc_tiktok_security_lancet_ContextLancet_startActivity(context, intent);
        return true;
    }
}
