package K.K.㸾.K;

import ai.advance.core.LServiceParent;
import ai.advance.liveness.lib.Detector;
import ai.advance.liveness.lib.LivenessJNI;
import ai.advance.liveness.lib.http.entity.ResultEntity;
import android.text.TextUtils;
import org.json.JSONException;
import org.json.JSONObject;
import K.K.K.ʬ.C2367;
import K.K.K.ʬ.C2369;

/* renamed from: K.K.㸾.K.㿎  reason: contains not printable characters */
public class C2395 extends Thread {

    /* renamed from: ῲ  reason: contains not printable characters */
    public final /* synthetic */ Detector.AbstractC0022 f8286;

    public C2395(Detector.AbstractC0022 r1) {
        this.f8286 = r1;
    }

    public void run() {
        super.run();
        ResultEntity resultEntity = (ResultEntity) C2367.m6264(C2387.m6413(C2369.m6269()), ResultEntity.class);
        if (resultEntity.f8209) {
            if (LivenessJNI.f90) {
                String oo0OoO = LivenessJNI.oo0OoO();
                if (!TextUtils.isEmpty(oo0OoO)) {
                    C2369.m6327(C2369.f8189, "tra.tk", oo0OoO);
                }
            }
            try {
                LServiceParent.f37 = new JSONObject(resultEntity.f8215).optBoolean("uploadSwitch", true);
            } catch (JSONException unused) {
            }
        }
        Detector.AbstractC0022 r1 = this.f8286;
        if (r1 != null) {
            boolean z = resultEntity.f8209;
            String str = resultEntity.f8212;
            String str2 = resultEntity.f8214;
            C2390 k = (C2390) r1;
            if (z) {
                k.f8283.m61();
            } else {
                Detector detector = k.f8283;
                if (detector.f60 != null) {
                    detector.m67(false, str, str2);
                } else {
                    C2369.m6355(" sdk auth failed ");
                }
            }
            C2386 r12 = k.f8283.m63();
            r12.f8171 = false;
            if (!z) {
                r12.m6183("failed_reason", "auth_failed");
                r12.m6183("auth_failed_reason", str2);
            }
            r12.m6183("auth_duration", Long.valueOf(System.currentTimeMillis() - r12.f8169));
            r12.m6183("param_version", r12.m6184());
            r12.m6183("jni_version", r12.m6179());
            r12.m6183("native_model_version", r12.m6178());
        }
    }
}
