package com.ss.android.ugc.aweme.share.improve.pkg;

import X.2Pr;
import X.3BB;
import X.4B5;
import X.4gN;
import X.4oZ;
import X.J7F;
import X.JOF;
import X.JPw;
import X.LsC;
import X.M12;
import android.content.Context;
import android.text.TextUtils;
import com.bytedance.covode.number.Covode;
import com.ss.android.ugc.aweme.profile.model.GeneralPermission;
import com.ss.android.ugc.aweme.profile.model.User;
import kotlin.h.b.n;

public final class UserSharePackage extends LinkDefaultSharePackage {
    public static final JPw LIZIZ = new JPw((byte) 0);
    public User LIZ;

    static {
        Covode.recordClassIndex(107501);
    }

    /* JADX INFO: super call moved to the top of the method (can break code semantics) */
    public UserSharePackage(J7F j7f) {
        super(j7f);
        M12.LIZ(j7f);
    }

    public final boolean LIZ(4oZ r4, Context context) {
        String shareProfileToast;
        M12.LIZ(r4, context);
        if (!(r4 instanceof 4gN)) {
            return false;
        }
        User user = this.LIZ;
        if (user == null) {
            n.LIZ("");
        }
        GeneralPermission generalPermission = user.getGeneralPermission();
        String str = null;
        if (generalPermission != null) {
            str = generalPermission.getShareProfileToast();
        }
        if (TextUtils.isEmpty(str)) {
            return false;
        }
        User user2 = this.LIZ;
        if (user2 == null) {
            n.LIZ("");
        }
        GeneralPermission generalPermission2 = user2.getGeneralPermission();
        if (generalPermission2 == null || (shareProfileToast = generalPermission2.getShareProfileToast()) == null) {
            return true;
        }
        3BB r0 = new 3BB(context);
        r0.LIZ(shareProfileToast);
        r0.LIZIZ();
        return true;
    }

    public final boolean LIZ(JOF jof, Context context, LsC<? super Boolean, 2Pr> lsC) {
        String shareProfileToast;
        M12.LIZ(jof, context, lsC);
        User user = this.LIZ;
        if (user == null) {
            n.LIZ("");
        }
        GeneralPermission generalPermission = user.getGeneralPermission();
        String str = null;
        if (generalPermission != null) {
            str = generalPermission.getShareProfileToast();
        }
        if (!TextUtils.isEmpty(str)) {
            User user2 = this.LIZ;
            if (user2 == null) {
                n.LIZ("");
            }
            GeneralPermission generalPermission2 = user2.getGeneralPermission();
            if (!(generalPermission2 == null || (shareProfileToast = generalPermission2.getShareProfileToast()) == null)) {
                3BB r0 = new 3BB(context);
                r0.LIZ(shareProfileToast);
                r0.LIZIZ();
            }
            lsC.invoke(true);
            return true;
        }
        4B5.LIZIZ.LIZ(jof.LIZ(), 0);
        return false;
    }
}
