TikTok.apk(点击下载) / C196367nd.java


package X;

import android.content.Context;
import android.net.Uri;
import com.bytedance.covode.number.Covode;
import com.bytedance.router.SmartRouter;
import com.ss.android.ugc.aweme.feed.model.Aweme;
import com.ss.android.ugc.aweme.feed.model.CaptionItemModel;
import com.ss.android.ugc.aweme.feed.model.CaptionLanguage;
import com.ss.android.ugc.aweme.feed.model.CaptionModel;
import com.ss.android.ugc.aweme.feed.model.Video;
import com.ss.android.ugc.aweme.profile.model.User;
import java.util.Iterator;
import java.util.List;
import kotlin.g.b.m;

/* renamed from: X.7nd  reason: invalid class name and case insensitive filesystem */
public final class C196367nd {
    public static final String LIZ = "cla_crowdsourcing_onboarding_complete";
    public static final C196367nd LIZIZ = new C196367nd();

    static {
        Covode.recordClassIndex(67113);
    }

    public static final int LIZ(Aweme aweme) {
        CaptionItemModel LIZJ = LIZJ(aweme);
        if (LIZJ != null) {
            return LIZJ.getSubId();
        }
        return 0;
    }

    public static final void LIZ(Context context, String str, String str2, String str3, boolean z, Aweme aweme) {
        CaptionItemModel LIZLLL;
        Video video;
        CaptionModel captionModel;
        CaptionLanguage originalCaptionLanguage;
        User author;
        C21090sc.LIZ(context, str, str2, str3);
        String str4 = null;
        StringBuilder append = new StringBuilder("https://www.tiktok.com/web-inapp/cla/crowdsourcing/translation-center?enter_from=").append(str2).append("&enter_method=").append(str3).append("&translator_id=").append(str).append("&group_id=").append(aweme != null ? aweme.getGroupId() : null).append("&author_id=").append((aweme == null || (author = aweme.getAuthor()) == null) ? null : author.getUid()).append("&video_lang=").append((aweme == null || (video = aweme.getVideo()) == null || (captionModel = video.getCaptionModel()) == null || (originalCaptionLanguage = captionModel.getOriginalCaptionLanguage()) == null) ? null : originalCaptionLanguage.getLanguageName()).append("&transl_lang=");
        if (!(aweme == null || (LIZLLL = LIZLLL(aweme)) == null)) {
            str4 = LIZLLL.getLanguageName();
        }
        String sb = append.append(str4).toString();
        if (z) {
            sb = sb + "&tab=translations";
        }
        SmartRouter.buildRoute(context, "aweme://webview").withParam(Uri.parse(sb)).withParam("hide_nav_bar", true).open();
    }

    public static final boolean LIZ(CaptionItemModel captionItemModel) {
        C21090sc.LIZ(captionItemModel);
        return m.LIZ((Object) captionItemModel.getVersionType(), (Object) "20");
    }

    public static final int LIZIZ(Aweme aweme) {
        CaptionItemModel LIZLLL = LIZLLL(aweme);
        if (LIZLLL != null) {
            return LIZLLL.getSubId();
        }
        return 0;
    }

    public static final boolean LIZIZ(CaptionItemModel captionItemModel) {
        C21090sc.LIZ(captionItemModel);
        return captionItemModel.isAutoGenerated();
    }

    public static final CaptionItemModel LIZJ(Aweme aweme) {
        Video video;
        CaptionModel captionModel;
        List<CaptionItemModel> captionList;
        Video video2;
        CaptionModel captionModel2;
        CaptionLanguage originalCaptionLanguage;
        T t = null;
        Long valueOf = (aweme == null || (video2 = aweme.getVideo()) == null || (captionModel2 = video2.getCaptionModel()) == null || (originalCaptionLanguage = captionModel2.getOriginalCaptionLanguage()) == null) ? null : Long.valueOf(originalCaptionLanguage.getLanguageId());
        if (aweme == null || (video = aweme.getVideo()) == null || (captionModel = video.getCaptionModel()) == null || (captionList = captionModel.getCaptionList()) == null) {
            return null;
        }
        Iterator<T> it = captionList.iterator();
        while (true) {
            if (!it.hasNext()) {
                break;
            }
            T next = it.next();
            long languageId = next.getLanguageId();
            if (valueOf != null && valueOf.longValue() == languageId) {
                t = next;
                break;
            }
        }
        return t;
    }

    /* JADX WARNING: Removed duplicated region for block: B:19:0x003b  */
    /* JADX WARNING: Removed duplicated region for block: B:28:0x0049 A[EDGE_INSN: B:28:0x0049->B:22:0x0049 ?: BREAK  , SYNTHETIC] */
    public static final CaptionItemModel LIZLLL(Aweme aweme) {
        Video video;
        CaptionModel captionModel;
        List<CaptionItemModel> captionList;
        Video video2;
        CaptionModel captionModel2;
        CaptionLanguage originalCaptionLanguage;
        T t = null;
        Long valueOf = (aweme == null || (video2 = aweme.getVideo()) == null || (captionModel2 = video2.getCaptionModel()) == null || (originalCaptionLanguage = captionModel2.getOriginalCaptionLanguage()) == null) ? null : Long.valueOf(originalCaptionLanguage.getLanguageId());
        if (aweme == null || (video = aweme.getVideo()) == null || (captionModel = video.getCaptionModel()) == null || (captionList = captionModel.getCaptionList()) == null) {
            return null;
        }
        Iterator<T> it = captionList.iterator();
        while (true) {
            if (!it.hasNext()) {
                T next = it.next();
                long languageId = next.getLanguageId();
                if (valueOf == null || valueOf.longValue() != languageId) {
                    t = next;
                }
                if (!it.hasNext()) {
                    break;
                }
            }
        }
        return t;
    }
}