package com.ss.android.ugc.aweme.bullet.bridge.ad;

import X.0CB;
import X.0CH;
import X.3Ok;
import X.4UQ;
import X.6Is;
import X.7he;
import X.C2564S0q;
import X.C2565S0r;
import X.Crj;
import X.KLH;
import X.KT7;
import X.M12;
import X.S10;
import X.S22;
import X.S23;
import X.S25;
import X.S26;
import com.bytedance.covode.number.Covode;
import com.google.gson.Gson;
import com.ss.android.ugc.aweme.bullet.bridge.BaseBridgeMethod;
import java.util.concurrent.CountDownLatch;
import kotlin.h.b.n;
import org.json.JSONObject;

public final class LocalPhoneNoMethod extends BaseBridgeMethod implements 6Is {
    public CountDownLatch LIZIZ;
    public S26 LIZJ;
    public final String LIZLLL = "localPhoneNo";
    public final Crj LJ = 7he.LIZ(C2564S0q.LIZ);
    public S10 LJFF;
    public final Crj LJI = 7he.LIZ(KLH.LIZ);

    static {
        Covode.recordClassIndex(54932);
    }

    private final C2565S0r LJIIIZ() {
        return (C2565S0r) this.LJ.getValue();
    }

    public final void onStateChanged(0CH r1, 0CB r2) {
        LocalPhoneNoMethod.super.onStateChanged(r1, r2);
    }

    public final String LIZLLL() {
        return this.LIZLLL;
    }

    public static final /* synthetic */ S26 LIZ(LocalPhoneNoMethod localPhoneNoMethod) {
        S26 s26 = localPhoneNoMethod.LIZJ;
        if (s26 == null) {
            n.LIZ("");
        }
        return s26;
    }

    public static final /* synthetic */ CountDownLatch LIZIZ(LocalPhoneNoMethod localPhoneNoMethod) {
        CountDownLatch countDownLatch = localPhoneNoMethod.LIZIZ;
        if (countDownLatch == null) {
            n.LIZ("");
        }
        return countDownLatch;
    }

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

    public final void LIZ(JSONObject jSONObject, 4UQ r8) {
        String str;
        Integer num;
        Integer num2;
        int i;
        int i2;
        Integer num3;
        Integer num4;
        M12.LIZ(jSONObject, r8);
        S26 s26 = new S26();
        this.LIZJ = s26;
        C2565S0r LJIIIZ = LJIIIZ();
        if (LJIIIZ == null || (str = LJIIIZ.LIZ()) == null) {
            str = "";
        }
        M12.LIZ(str);
        s26.LIZ = str;
        S26 s262 = this.LIZJ;
        if (s262 == null) {
            n.LIZ("");
        }
        s262.LJ = LJIIIZ().LIZIZ();
        S26 s263 = this.LIZJ;
        if (s263 == null) {
            n.LIZ("");
        }
        if (s263.LIZ == null) {
            n.LIZ("");
        }
        Object LIZ = ((Gson) this.LJI.getValue()).LIZ(jSONObject.toString(), S10.class);
        n.LIZIZ(LIZ, "");
        S10 s10 = (S10) LIZ;
        S26 s264 = this.LIZJ;
        if (s264 == null) {
            n.LIZ("");
        }
        if ((s10.LIZ != null && (((num3 = s10.LIZ) == null || num3.intValue() != 1) && ((num4 = s10.LIZ) == null || num4.intValue() != 0))) || (s10.LIZIZ != null && (((num = s10.LIZIZ) == null || num.intValue() != 1) && ((num2 = s10.LIZIZ) == null || num2.intValue() != 0)))) {
            s10.LIZ = 0;
            s10.LIZIZ = 0;
            s264.LIZIZ = 0;
        }
        this.LJFF = s10;
        Integer num5 = s10.LIZ;
        if (num5 != null) {
            i = num5.intValue();
        } else {
            i = 0;
        }
        int i3 = i + 0;
        S10 s102 = this.LJFF;
        if (s102 == null) {
            n.LIZ("");
        }
        Integer num6 = s102.LIZIZ;
        if (num6 != null) {
            i2 = num6.intValue();
        } else {
            i2 = 0;
        }
        this.LIZIZ = new CountDownLatch(i3 + i2);
        S10 s103 = this.LJFF;
        if (s103 == null) {
            n.LIZ("");
        }
        Integer num7 = s103.LIZ;
        if (num7 != null && 1 == num7.intValue()) {
            3Ok r1 = new 3Ok();
            r1.element = false;
            LJIIIZ();
            new S22(this, r1);
        }
        S10 s104 = this.LJFF;
        if (s104 == null) {
            n.LIZ("");
        }
        Integer num8 = s104.LIZIZ;
        if (num8 != null && 1 == num8.intValue()) {
            3Ok r12 = new 3Ok();
            r12.element = false;
            LJIIIZ();
            new S23(this, r12);
        }
        new Thread(new S25(this, r8)).start();
    }
}
