package com.ss.android.ugc.aweme.services;

import X.3Q8;
import X.7UF;
import X.C3804ESi;
import X.C3975EYx;
import X.C5020EqO;
import X.C5173Esr;
import X.C5260EuG;
import X.C6152FKq;
import X.Cbz;
import X.CqM;
import X.KpA;
import X.KrI;
import X.LH6;
import X.M12;
import android.app.Activity;
import android.content.ActivityNotFoundException;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import androidx.fragment.app.Fragment;
import com.bytedance.covode.number.Covode;
import com.bytedance.router.SmartRoute;
import com.bytedance.router.SmartRouter;
import com.ss.android.ugc.aweme.base.fragment.AmeBaseFragment;
import com.ss.android.ugc.aweme.crossplatform.activity.CrossPlatformActivity;
import com.ss.android.ugc.aweme.profile.model.User;

public final class BridgeServiceImpl implements C3975EYx {
    static {
        Covode.recordClassIndex(105033);
    }

    public final void checkToTransformMusDraft() {
    }

    public final Fragment createUserProfileEditFragment() {
        return null;
    }

    public final AmeBaseFragment createMyProfileFragment() {
        return C6152FKq.LIZ.LJIIJJI();
    }

    public final AmeBaseFragment createUserProfileFragment() {
        return C6152FKq.LIZ.LJIIL();
    }

    public final boolean needShowSafeInfoNotice() {
        return C5173Esr.LJII.LIZ();
    }

    public final void onFeedStop() {
        3Q8.LIZ.LIZIZ = false;
    }

    public final LH6 getBulletABHelper() {
        return (KpA) KpA.LIZ.getValue();
    }

    public final boolean shouldShowI18nRecommendUserDialogOnMyPrifile() {
        if (!C5020EqO.LIZ.LJIIIZ() || !C5020EqO.LIZ.LJIIJ() || !C5020EqO.LIZ.LJIIJJI()) {
            return false;
        }
        return true;
    }

    public final void setCustomStatusBarInLayout(Activity activity) {
        Cbz.LIZ(activity);
        Cbz.LIZIZ(activity);
    }

    public final void switchToSignature(Activity activity) {
        C6152FKq.LIZ.LIZ(activity, (Bundle) null);
    }

    public final void openWallet(Activity activity) {
        M12.LIZ(activity);
        KrI.LIZ(activity, "page_index");
    }

    public final void postSafeInfoNoticeEvent(boolean z) {
        CqM.LIZ(new 7UF(z));
    }

    public final void switchToBioUrl(Activity activity, String str) {
        C6152FKq.LIZ.LIZ(activity, str);
    }

    public final void enterMyFavorites(Activity activity, Bundle bundle) {
        M12.LIZ(activity, bundle);
        SmartRoute buildRoute = SmartRouter.buildRoute(activity, "//favorite");
        buildRoute.withParam(bundle);
        buildRoute.open();
    }

    public final void startThirdSocialActivity(Context context, User user, int i) {
        String twitterId;
        M12.LIZ(context, user);
        if (i == 1) {
            String insId = user.getInsId();
            if (insId != null && !insId.isEmpty()) {
                M12.LIZ(context, insId);
                Intent intent = new Intent("android.intent.action.VIEW", Uri.parse("instagram://user?username=".concat(String.valueOf(insId))));
                intent.setPackage("com.instagram.android");
                Intent intent2 = new Intent(context, CrossPlatformActivity.class);
                intent2.putExtra("title", context.getString(2131826263));
                intent2.setData(Uri.parse("https://instagram.com/_u/".concat(String.valueOf(insId))));
                if (intent.resolveActivity(context.getPackageManager()) == null) {
                    C5260EuG.LIZ(context, intent2);
                    return;
                }
                try {
                    C5260EuG.LIZ(context, intent);
                } catch (ActivityNotFoundException unused) {
                    C5260EuG.LIZ(context, intent2);
                }
            }
        } else if (i == 2) {
            String youtubeChannelId = user.getYoutubeChannelId();
            if (youtubeChannelId != null && !youtubeChannelId.isEmpty()) {
                M12.LIZ(context, youtubeChannelId);
                Uri parse = Uri.parse("https://www.youtube.com/channel/".concat(String.valueOf(youtubeChannelId)));
                Intent intent3 = new Intent("android.intent.action.VIEW", parse);
                intent3.setPackage("com.google.android.youtube");
                Intent intent4 = new Intent(context, CrossPlatformActivity.class);
                intent4.putExtra("title", context.getString(2131835052));
                intent4.setData(parse);
                if (intent3.resolveActivity(context.getPackageManager()) == null) {
                    C5260EuG.LIZ(context, intent4);
                    return;
                }
                try {
                    C5260EuG.LIZ(context, intent3);
                } catch (ActivityNotFoundException unused2) {
                    C5260EuG.LIZ(context, intent4);
                }
            }
        } else if (i == 3 && (twitterId = user.getTwitterId()) != null && !twitterId.isEmpty()) {
            M12.LIZ(context, twitterId);
            Intent intent5 = new Intent("android.intent.action.VIEW", Uri.parse("twitter://user?id=".concat(String.valueOf(twitterId))));
            intent5.setPackage("com.twitter.android");
            Intent intent6 = new Intent(context, CrossPlatformActivity.class);
            intent6.putExtra("title", context.getString(2131834288));
            intent6.setData(Uri.parse("https://twitter.com/intent/user?user_id=".concat(String.valueOf(twitterId))));
            if (intent5.resolveActivity(context.getPackageManager()) == null) {
                C5260EuG.LIZ(context, intent6);
                return;
            }
            try {
                C5260EuG.LIZ(context, intent5);
            } catch (ActivityNotFoundException unused3) {
                C5260EuG.LIZ(context, intent6);
            }
        }
    }

    public final C3804ESi createAwemeListFragment(int i, int i2, String str, String str2, boolean z, boolean z2, boolean z3, boolean z4) {
        return C6152FKq.LIZ.LIZ(i, i2, str, str2, z, z2, z4, new Bundle());
    }
}
