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


package X;

import android.app.Activity;
import android.text.TextUtils;
import com.bytedance.covode.number.Covode;
import com.google.gson.Gson;
import com.ss.android.ugc.aweme.feed.model.Aweme;
import com.ss.android.ugc.aweme.out.AVExternalServiceImpl;
import com.ss.android.ugc.aweme.profile.model.BcUsageConfirmThreshold;
import com.ss.android.ugc.aweme.profile.model.TcmConfig;
import com.zhiliaoapp.musically.R;
import kotlin.g.b.m;

/* renamed from: X.Jif */
public final class C49904Jif {
    public static final C49904Jif LIZ = new C49904Jif();

    static {
        Covode.recordClassIndex(106223);
    }

    /* JADX WARNING: Code restructure failed: missing block: B:42:0x0098, code lost:
        if (r11 == null) goto L_0x009a;
     */
    /* JADX WARNING: Code restructure failed: missing block: B:89:0x0170, code lost:
        if (r11 == null) goto L_0x0172;
     */
    /* JADX WARNING: Code restructure failed: missing block: B:98:0x0186, code lost:
        if (r11 == null) goto L_0x0172;
     */
    /* JADX WARNING: Code restructure failed: missing block: B:99:0x0189, code lost:
        r5 = "0";
     */
    public static final void LIZ(Activity activity, boolean z, String str, boolean z2, Aweme aweme, boolean z3) {
        String str2;
        String str3;
        String str4;
        String str5;
        BcUsageConfirmThreshold bcUsageConfirmThreshold;
        String aid;
        String str6;
        String tcmFeParams;
        String bcSchemaAfterPost;
        String str7;
        String str8;
        String str9;
        C27277Ana LIZ2 = C27585AsY.LIZ();
        if (LIZ2 == null || (str2 = LIZ2.LIZ) == null) {
            str2 = "aweme://webview?url=https%3A%2F%2Fwww.tiktok.com%2Ffalcon%2Ftcm%2Fh5%2Fbranded_content%2F%3Fhide_nav_bar%3D1";
        }
        AnonymousClass27T LIZ3 = AnonymousClass27S.LIZ(str2);
        TcmConfig LIZ4 = C28039Azs.LIZ();
        String str10 = "1";
        String str11 = "";
        if (LIZ4 != null && LIZ4.getUseNewBCSetting()) {
            if (z2) {
                TcmConfig LIZ5 = C28039Azs.LIZ();
                if (LIZ5 == null || (str7 = LIZ5.getBcSchemaInPost()) == null) {
                    str7 = "aweme://webview?url=https%3A%2F%2Fwww.tiktok.com%2Ffalcon%2Ftcm%2Fh5%2Fbranded_content%3Fhide_nav_bar%3D1";
                }
                LIZ3 = AnonymousClass27S.LIZ(str7);
                String str12 = C49905Jig.LJFF;
                if (str12 != null) {
                    LIZ3.LIZ("tcmParams", str12);
                }
                if (C49902Jid.LIZ.LIZ() && (str9 = C49905Jig.LJI) != null) {
                    LIZ3.LIZ("sparkAdsAuth", str9);
                }
                String shootWay = AVExternalServiceImpl.LIZ().publishService().getShootWay();
                if (shootWay == null) {
                    shootWay = str11;
                }
                LIZ3.LIZ("shootWay", shootWay);
                TcmConfig LIZ6 = C28039Azs.LIZ();
                if (LIZ6 == null || (str8 = LIZ6.getTcmFeParams()) == null) {
                    str8 = str11;
                }
                LIZ3.LIZ("tcmFeParams", str8);
            } else {
                Integer num = null;
                if ((aweme == null || aweme.getAid() == null) && activity != null) {
                    C10140ax.LIZ(new C10140ax(activity).LJ(R.string.xc).LIZ(1000L));
                    return;
                } else if (!(aweme == null || (aid = aweme.getAid()) == null)) {
                    TcmConfig LIZ7 = C28039Azs.LIZ();
                    if (LIZ7 == null || (bcSchemaAfterPost = LIZ7.getBcSchemaAfterPost()) == null || (str6 = AnonymousClass1ZS.LIZ(bcSchemaAfterPost, "%@", aid, false)) == null) {
                        str6 = "aweme://webview?url=https%3A%2F%2Fwww.tiktok.com%2Ffalcon%2Ftcm%2Fh5%2Fbranded_content%2F" + aid + "%3Fhide_nav_bar%3D1";
                    }
                    AnonymousClass27T LIZ8 = AnonymousClass27S.LIZ(str6);
                    if (aweme.isTop()) {
                        LIZ8.LIZ("videoTopPlaylist", str10);
                    } else if (aweme.playlist_info != null) {
                        LIZ8.LIZ("videoTopPlaylist", "2");
                    } else if (!aweme.isTop() || aweme.playlist_info == null) {
                        LIZ8.LIZ("videoTopPlaylist", "0");
                    } else {
                        LIZ8.LIZ("videoTopPlaylist", "3");
                    }
                    LIZ8.LIZ("missionToastType", String.valueOf(C82683Nh.LIZ));
                    C13930h4 commerceVideoAuthInfo = aweme.getCommerceVideoAuthInfo();
                    if (commerceVideoAuthInfo != null) {
                        num = Integer.valueOf(commerceVideoAuthInfo.getMissionItemStatus());
                    }
                    LIZ8.LIZ("missionItemStatus", String.valueOf(num));
                    if (!aweme.isPrivate()) {
                        str10 = "0";
                    }
                    LIZ8.LIZ("isPrivate", str10);
                    TcmConfig LIZ9 = C28039Azs.LIZ();
                    if (!(LIZ9 == null || (tcmFeParams = LIZ9.getTcmFeParams()) == null)) {
                        str11 = tcmFeParams;
                    }
                    LIZ8.LIZ("tcmFeParams", str11);
                    if (z) {
                        LIZ8.LIZ("musicType", "general");
                    }
                    C18770os LIZ10 = C18770os.LIZ();
                    if (LIZ10 != null) {
                        C18770os.LIZ(LIZ10, activity, LIZ8.LIZ().toString());
                        return;
                    }
                    return;
                }
            }
        }
        if (C49902Jid.LIZ.LIZ()) {
            str4 = C49905Jig.LIZJ;
            if (str4 == null) {
                str4 = "0";
            }
            String str13 = C49905Jig.LIZLLL;
            if (str13 == null) {
                str13 = str11;
            }
            LIZ3.LIZ("campaignInfo", str13);
            str3 = C49905Jig.LIZLLL;
            str5 = str10;
        } else {
            TcmConfig LIZ11 = C28039Azs.LIZ();
            if (LIZ11 == null || !LIZ11.isBrandedContentCreator()) {
                str4 = C49905Jig.LIZJ;
                if (str4 == null) {
                    str4 = "0";
                }
                String str14 = C49905Jig.LIZLLL;
                if (str14 == null) {
                    str14 = str11;
                }
                LIZ3.LIZ("anchor_content", str14);
                str3 = C49905Jig.LIZLLL;
            } else {
                str4 = C49905Jig.LIZJ;
                if (str4 == null) {
                    str4 = "0";
                }
                String str15 = C49905Jig.LIZLLL;
                if (str15 == null) {
                    str15 = str11;
                }
                LIZ3.LIZ("campaignInfo", str15);
                str3 = C49905Jig.LIZLLL;
            }
            str5 = "0";
        }
        str3 = str11;
        LIZ3.LIZ("brandedContentType", str4);
        LIZ3.LIZ("isTCMUser", str5);
        if (!TextUtils.equals(AVExternalServiceImpl.LIZ().publishService().getShootWay(), "tcm_upload") || !z3) {
            LIZ3.LIZ("fromTCMOrderDetail", "0");
        } else {
            LIZ3.LIZ("fromTCMOrderDetail", str10);
        }
        if (z) {
            LIZ3.LIZ("musicType", "general");
        }
        if (!TextUtils.equals(str4, "2")) {
            if (C28037Azq.LIZ()) {
                C14300hf.onEventV3("more_click_bc");
            } else if (!TextUtils.isEmpty(str3)) {
                C14300hf.LIZ("post_click_bc", new C12740f9().LIZ("sponsored", 1).LIZ);
            } else {
                C14300hf.LIZ("post_click_bc", new C12740f9().LIZ("sponsored", 2).LIZ);
            }
        }
        TcmConfig LIZ12 = C28039Azs.LIZ();
        if (LIZ12 == null || (bcUsageConfirmThreshold = LIZ12.getBcUsageConfirmThreshold()) == null || !bcUsageConfirmThreshold.getH5()) {
            str10 = "0";
        }
        LIZ3.LIZ("bcUsageConfirmThreshold", str10);
        if (C49905Jig.LJ != null) {
            String json = new Gson().toJson(C49905Jig.LJ);
            m.LIZIZ(json, str11);
            LIZ3.LIZ("BAInfo", json);
        }
        if (!TextUtils.isEmpty(str)) {
            if (str != null) {
                str11 = str;
            }
            LIZ3.LIZ("BAToBeTagged", str11);
        }
        C18770os LIZ13 = C18770os.LIZ();
        if (LIZ13 != null) {
            C18770os.LIZ(LIZ13, activity, LIZ3.LIZ().toString());
        }
    }
}