导航菜单

页面标题

页面副标题

Mabilis Cash v1.19.4 - ActionLivenessActivity.java 源代码

正在查看: Mabilis Cash v1.19.4 应用的 ActionLivenessActivity.java JAVA 源代码文件

本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。


package com.face.csg.lv5.sdk.detect.action;

import android.animation.ValueAnimator;
import android.annotation.SuppressLint;
import android.app.Activity;
import android.app.AlertDialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.res.Resources;
import android.graphics.SurfaceTexture;
import android.graphics.drawable.AnimationDrawable;
import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
import android.os.Message;
import android.text.TextUtils;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewTreeObserver;
import android.view.accessibility.AccessibilityManager;
import android.view.animation.LinearInterpolator;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;
import androidx.constraintlayout.core.motion.utils.TypedValues;
import androidx.core.view.PointerIconCompat;
import com.face.csg.lv5.sdk.R;
import com.face.csg.lv5.sdk.base.DetectBaseActivity;
import com.face.csg.lv5.sdk.view.CameraGLSurfaceView;
import com.face.csg.lv5.sdk.view.LoadingCoverView;
import com.face.csg.lv5.sdk.view.RadarView;
import com.megvii.lv5.a0;
import com.megvii.lv5.a5;
import com.megvii.lv5.b5;
import com.megvii.lv5.c;
import com.megvii.lv5.c0;
import com.megvii.lv5.e3;
import com.megvii.lv5.e4;
import com.megvii.lv5.f1;
import com.megvii.lv5.g4;
import com.megvii.lv5.i4;
import com.megvii.lv5.j;
import com.megvii.lv5.j3;
import com.megvii.lv5.j4;
import com.megvii.lv5.k3;
import com.megvii.lv5.k4;
import com.megvii.lv5.l0;
import com.megvii.lv5.l3;
import com.megvii.lv5.m4;
import com.megvii.lv5.m5;
import com.megvii.lv5.n4;
import com.megvii.lv5.o;
import com.megvii.lv5.q4;
import com.megvii.lv5.t4;
import com.megvii.lv5.u;
import com.megvii.lv5.u4;
import com.megvii.lv5.w2;
import com.megvii.lv5.w4;
import com.megvii.lv5.y4;
import com.megvii.lv5.z4;
import com.sensorsdata.analytics.android.autotrack.aop.SensorsDataAutoTrackHelper;
import com.sensorsdata.analytics.android.sdk.SensorsDataInstrumented;
import java.lang.ref.WeakReference;
import java.util.HashMap;

public class ActionLivenessActivity extends DetectBaseActivity implements View.OnClickListener, l3.c, e3, k3, m5 {
    public static final int M0 = 0;
    public ImageView A0;
    public int F0;
    public int G0;
    public int I0;
    public HashMap<String, byte[]> J0;
    public CameraGLSurfaceView O;
    public RadarView P;
    public LinearLayout Q;
    public l0 R;
    public String S;
    public ImageView T;
    public ImageView U;
    public ImageView V;
    public TextView W;
    public TextView X;
    public TextView Y;
    public TextView Z;
    public TextView a0;
    public TextView b0;
    public TextView c0;
    public ImageView d0;
    public LoadingCoverView e0;
    public ImageView f0;
    public n4 g0;
    public View.OnClickListener h0;
    public SurfaceTexture r0;
    public AnimationDrawable s0;
    public AnimationDrawable t0;
    public AnimationDrawable u0;
    public AnimationDrawable v0;
    public AnimationDrawable w0;
    public i4 x0;
    public t4 y0;
    public ImageView z0;
    public int i0 = 0;
    public int j0 = 2;
    public int k0 = 0;
    public String l0 = "";
    public boolean m0 = true;
    public volatile boolean n0 = false;
    public boolean o0 = true;
    public boolean p0 = false;
    public boolean q0 = false;
    public boolean B0 = false;
    public boolean C0 = false;
    public volatile boolean D0 = false;
    public int E0 = 0;
    public Handler H0 = new a(Looper.getMainLooper());
    public boolean K0 = false;
    public boolean L0 = false;

    public class a extends Handler {
        public a(Looper looper) {
            super(looper);
        }

        @Override
        @SuppressLint({"HandlerLeak"})
        public void handleMessage(Message message) {
            String str;
            int i2;
            String str2;
            t4 t4Var;
            String str3;
            t4 t4Var2;
            Resources resources;
            y4 a2;
            int i3;
            TextView textView;
            Resources resources2;
            int i4;
            super.handleMessage(message);
            String str4 = "";
            switch (message.what) {
                case 100:
                    int[] iArr = ActionLivenessActivity.this.R.m2;
                    int i5 = iArr[0];
                    int i6 = iArr[1];
                    ActionLivenessActivity actionLivenessActivity = ActionLivenessActivity.this;
                    int i7 = actionLivenessActivity.G0;
                    int i8 = actionLivenessActivity.F0;
                    o oVar = o.M;
                    oVar.a(actionLivenessActivity.K, i7, i8, i5, i6);
                    ActionLivenessActivity.this.O.setLayoutParams(ActionLivenessActivity.this.e0.a(i5, i6));
                    ActionLivenessActivity.this.O.setVisibility(0);
                    ActionLivenessActivity.this.D0 = true;
                    RelativeLayout.LayoutParams layoutParams = (RelativeLayout.LayoutParams) ActionLivenessActivity.this.X.getLayoutParams();
                    layoutParams.setMargins(0, (int) oVar.l, 0, 0);
                    ActionLivenessActivity.this.X.setLayoutParams(layoutParams);
                    ActionLivenessActivity.this.X.setVisibility(0);
                    RelativeLayout.LayoutParams layoutParams2 = (RelativeLayout.LayoutParams) ActionLivenessActivity.this.Y.getLayoutParams();
                    layoutParams2.setMargins(0, (int) oVar.m, 0, 0);
                    ActionLivenessActivity.this.Y.setLayoutParams(layoutParams2);
                    ActionLivenessActivity.this.Y.setVisibility(0);
                    RelativeLayout.LayoutParams layoutParams3 = (RelativeLayout.LayoutParams) ActionLivenessActivity.this.c0.getLayoutParams();
                    layoutParams3.topMargin = (int) oVar.m;
                    ActionLivenessActivity.this.c0.setLayoutParams(layoutParams3);
                    RelativeLayout.LayoutParams layoutParams4 = (RelativeLayout.LayoutParams) ActionLivenessActivity.this.Z.getLayoutParams();
                    layoutParams4.setMargins(0, (int) oVar.a(ActionLivenessActivity.this.I0), 0, 0);
                    ActionLivenessActivity.this.Z.setLayoutParams(layoutParams4);
                    ActionLivenessActivity.this.Z.setVisibility(0);
                    if (com.megvii.lv5.b.b) {
                        RelativeLayout.LayoutParams layoutParams5 = (RelativeLayout.LayoutParams) ActionLivenessActivity.this.a0.getLayoutParams();
                        layoutParams5.setMargins(0, (int) oVar.n, 0, 0);
                        layoutParams5.addRule(10);
                        ActionLivenessActivity.this.a0.setLayoutParams(layoutParams5);
                        RelativeLayout.LayoutParams layoutParams6 = (RelativeLayout.LayoutParams) ActionLivenessActivity.this.Y.getLayoutParams();
                        layoutParams6.width = a5.a(ActionLivenessActivity.this, 240.0f);
                        ActionLivenessActivity.this.Y.setLayoutParams(layoutParams6);
                    }
                    RelativeLayout.LayoutParams layoutParams7 = (RelativeLayout.LayoutParams) ActionLivenessActivity.this.d0.getLayoutParams();
                    layoutParams7.topMargin = (int) oVar.D;
                    layoutParams7.width = (int) oVar.E;
                    layoutParams7.height = (int) oVar.F;
                    ActionLivenessActivity.this.d0.setLayoutParams(layoutParams7);
                    RelativeLayout.LayoutParams layoutParams8 = (RelativeLayout.LayoutParams) ActionLivenessActivity.this.b0.getLayoutParams();
                    layoutParams8.setMargins(0, (int) oVar.n, 0, 0);
                    ActionLivenessActivity.this.b0.setLayoutParams(layoutParams8);
                    float f2 = oVar.d - (oVar.b / 2.0f);
                    RelativeLayout.LayoutParams layoutParams9 = (RelativeLayout.LayoutParams) ActionLivenessActivity.this.z0.getLayoutParams();
                    int i9 = (int) (oVar.b * 1.5d);
                    layoutParams9.height = i9;
                    layoutParams9.width = (int) (i9 * 1.3636364f);
                    int i10 = (int) f2;
                    layoutParams9.topMargin = i10;
                    ActionLivenessActivity.this.z0.setLayoutParams(layoutParams9);
                    ActionLivenessActivity.this.z0.requestLayout();
                    RelativeLayout.LayoutParams layoutParams10 = (RelativeLayout.LayoutParams) ActionLivenessActivity.this.A0.getLayoutParams();
                    int i11 = (int) (oVar.b * 1.5d);
                    layoutParams10.height = i11;
                    layoutParams10.width = (int) (i11 * 1.5f);
                    layoutParams10.topMargin = i10;
                    ActionLivenessActivity.this.A0.setLayoutParams(layoutParams10);
                    ActionLivenessActivity.this.A0.requestLayout();
                    return;
                case 101:
                case 106:
                case 108:
                case 109:
                case 111:
                case 112:
                case 117:
                case 119:
                default:
                    return;
                case 102:
                    Bundle data = message.getData();
                    int i12 = data.getInt("actionIndex");
                    int i13 = data.getInt("currentAction");
                    ActionLivenessActivity actionLivenessActivity2 = ActionLivenessActivity.this;
                    actionLivenessActivity2.c0.setVisibility(8);
                    if (!com.megvii.lv5.b.b) {
                        actionLivenessActivity2.e0.d();
                    }
                    actionLivenessActivity2.b0.setVisibility(0);
                    actionLivenessActivity2.V.setVisibility(0);
                    actionLivenessActivity2.X.setVisibility(0);
                    actionLivenessActivity2.Z.setVisibility(8);
                    float f3 = 1.0f / actionLivenessActivity2.R.b;
                    float f4 = i12 * f3;
                    float f5 = f3 * (i12 - 1);
                    float f6 = f5 >= 0.0f ? f5 : 0.0f;
                    actionLivenessActivity2.e0.setProgressLineColor(actionLivenessActivity2.getResources().getColor(actionLivenessActivity2.f1904f));
                    actionLivenessActivity2.a(f6, f4, 300L);
                    actionLivenessActivity2.m();
                    actionLivenessActivity2.n();
                    t4 t4Var3 = actionLivenessActivity2.y0;
                    if (t4Var3 != null) {
                        t4Var3.b();
                    }
                    if (1 == i13) {
                        y4 a3 = y4.a(actionLivenessActivity2);
                        Resources resources3 = actionLivenessActivity2.getResources();
                        int i14 = R.string.key_facelive_eye_blink_m4a;
                        i2 = a3.c(resources3.getString(i14));
                        if (TextUtils.isEmpty(actionLivenessActivity2.B)) {
                            str2 = null;
                        } else {
                            str2 = actionLivenessActivity2.B + "/" + actionLivenessActivity2.getResources().getString(i14) + ".m4a";
                        }
                        String string = actionLivenessActivity2.getResources().getString(y4.a(actionLivenessActivity2).d(actionLivenessActivity2.getString(R.string.key_liveness_home_promptBlink_text)));
                        if (actionLivenessActivity2.t0 == null) {
                            AnimationDrawable animationDrawable = new AnimationDrawable();
                            actionLivenessActivity2.t0 = animationDrawable;
                            animationDrawable.addFrame(actionLivenessActivity2.getResources().getDrawable(y4.a(actionLivenessActivity2).b(actionLivenessActivity2.getString(R.string.key_eye_open))), 500);
                            actionLivenessActivity2.t0.addFrame(actionLivenessActivity2.getResources().getDrawable(y4.a(actionLivenessActivity2).b(actionLivenessActivity2.getString(R.string.key_eye_close))), 500);
                            actionLivenessActivity2.t0.setOneShot(false);
                        }
                        actionLivenessActivity2.w0 = actionLivenessActivity2.t0;
                        str = string;
                    } else if (2 == i13) {
                        y4 a4 = y4.a(actionLivenessActivity2);
                        Resources resources4 = actionLivenessActivity2.getResources();
                        int i15 = R.string.key_facelive_mouth_open_m4a;
                        i2 = a4.c(resources4.getString(i15));
                        if (TextUtils.isEmpty(actionLivenessActivity2.B)) {
                            str2 = null;
                        } else {
                            str2 = actionLivenessActivity2.B + "/" + actionLivenessActivity2.getResources().getString(i15) + ".m4a";
                        }
                        str = actionLivenessActivity2.getResources().getString(y4.a(actionLivenessActivity2).d(actionLivenessActivity2.getString(R.string.key_liveness_home_promptOpenMouth_text)));
                        if (actionLivenessActivity2.s0 == null) {
                            AnimationDrawable animationDrawable2 = new AnimationDrawable();
                            actionLivenessActivity2.s0 = animationDrawable2;
                            animationDrawable2.addFrame(actionLivenessActivity2.getResources().getDrawable(y4.a(actionLivenessActivity2).b(actionLivenessActivity2.getString(R.string.key_mouth_close))), 500);
                            actionLivenessActivity2.s0.addFrame(actionLivenessActivity2.getResources().getDrawable(y4.a(actionLivenessActivity2).b(actionLivenessActivity2.getString(R.string.key_mouth_open))), 500);
                            actionLivenessActivity2.s0.setOneShot(false);
                        }
                        actionLivenessActivity2.w0 = actionLivenessActivity2.s0;
                    } else if (3 == i13) {
                        y4 a5 = y4.a(actionLivenessActivity2);
                        Resources resources5 = actionLivenessActivity2.getResources();
                        int i16 = R.string.key_facelive_yaw_m4a;
                        i2 = a5.c(resources5.getString(i16));
                        if (TextUtils.isEmpty(actionLivenessActivity2.B)) {
                            str2 = null;
                        } else {
                            str2 = actionLivenessActivity2.B + "/" + actionLivenessActivity2.getResources().getString(i16) + ".m4a";
                        }
                        str = actionLivenessActivity2.getResources().getString(y4.a(actionLivenessActivity2).d(actionLivenessActivity2.getString(R.string.key_liveness_home_promptShakeHead_text)));
                        if (actionLivenessActivity2.v0 == null) {
                            AnimationDrawable animationDrawable3 = new AnimationDrawable();
                            actionLivenessActivity2.v0 = animationDrawable3;
                            Resources resources6 = actionLivenessActivity2.getResources();
                            y4 a6 = y4.a(actionLivenessActivity2);
                            int i17 = R.string.key_action_normal;
                            animationDrawable3.addFrame(resources6.getDrawable(a6.b(actionLivenessActivity2.getString(i17))), 500);
                            actionLivenessActivity2.v0.addFrame(actionLivenessActivity2.getResources().getDrawable(y4.a(actionLivenessActivity2).b(actionLivenessActivity2.getString(R.string.key_shakehead_left))), 500);
                            actionLivenessActivity2.v0.addFrame(actionLivenessActivity2.getResources().getDrawable(y4.a(actionLivenessActivity2).b(actionLivenessActivity2.getString(i17))), 500);
                            actionLivenessActivity2.v0.addFrame(actionLivenessActivity2.getResources().getDrawable(y4.a(actionLivenessActivity2).b(actionLivenessActivity2.getString(R.string.key_shakehead_right))), 500);
                            actionLivenessActivity2.v0.setOneShot(false);
                        }
                        actionLivenessActivity2.w0 = actionLivenessActivity2.v0;
                    } else if (4 == i13) {
                        y4 a7 = y4.a(actionLivenessActivity2);
                        Resources resources7 = actionLivenessActivity2.getResources();
                        int i18 = R.string.key_facelive_pitch_down_m4a;
                        i2 = a7.c(resources7.getString(i18));
                        if (TextUtils.isEmpty(actionLivenessActivity2.B)) {
                            str2 = null;
                        } else {
                            str2 = actionLivenessActivity2.B + "/" + actionLivenessActivity2.getResources().getString(i18) + ".m4a";
                        }
                        String string2 = actionLivenessActivity2.getResources().getString(y4.a(actionLivenessActivity2).d(actionLivenessActivity2.getString(R.string.key_liveness_home_promptNod_text)));
                        if (actionLivenessActivity2.u0 == null) {
                            AnimationDrawable animationDrawable4 = new AnimationDrawable();
                            actionLivenessActivity2.u0 = animationDrawable4;
                            animationDrawable4.addFrame(actionLivenessActivity2.getResources().getDrawable(y4.a(actionLivenessActivity2).b(actionLivenessActivity2.getString(R.string.key_nod_up))), 500);
                            actionLivenessActivity2.u0.addFrame(actionLivenessActivity2.getResources().getDrawable(y4.a(actionLivenessActivity2).b(actionLivenessActivity2.getString(R.string.key_nod_down))), 500);
                            actionLivenessActivity2.u0.setOneShot(false);
                        }
                        actionLivenessActivity2.w0 = actionLivenessActivity2.u0;
                        str = string2;
                    } else {
                        str = "";
                        i2 = -1;
                        str2 = null;
                    }
                    actionLivenessActivity2.o();
                    actionLivenessActivity2.W.measure(0, 0);
                    int height = actionLivenessActivity2.W.getHeight();
                    o oVar2 = o.M;
                    int min = (int) Math.min(oVar2.j - height, oVar2.b * 2.0f * 0.16f);
                    i4 i4Var = actionLivenessActivity2.x0;
                    ((Activity) i4Var.b).runOnUiThread(new g4(i4Var, actionLivenessActivity2.w0, oVar2.a(height, min)));
                    if (i12 != 0) {
                        if (TextUtils.isEmpty(actionLivenessActivity2.B)) {
                            str3 = null;
                        } else {
                            str3 = actionLivenessActivity2.B + "/" + actionLivenessActivity2.getResources().getString(R.string.key_facelive_well_done_m4a) + ".m4a";
                        }
                        t4 t4Var4 = actionLivenessActivity2.y0;
                        if (t4Var4 != null) {
                            t4Var4.a(y4.a(actionLivenessActivity2).c(actionLivenessActivity2.getResources().getString(R.string.key_facelive_well_done_m4a)), str3);
                        }
                        if ((i2 != -1 || !TextUtils.isEmpty(str2)) && (t4Var2 = actionLivenessActivity2.y0) != null) {
                            t4Var2.b(i2, str2);
                        }
                    } else if (i2 != -1 && (t4Var = actionLivenessActivity2.y0) != null) {
                        t4Var.a(i2, str2);
                    }
                    actionLivenessActivity2.X.setText(str);
                    TextView textView2 = actionLivenessActivity2.Z;
                    if (actionLivenessActivity2.p0) {
                        ((AccessibilityManager) textView2.getContext().getSystemService("accessibility")).interrupt();
                    }
                    actionLivenessActivity2.a(actionLivenessActivity2.X, str);
                    actionLivenessActivity2.g0.start();
                    return;
                case 103:
                    int i19 = message.getData().getInt("action_error_type");
                    ActionLivenessActivity actionLivenessActivity3 = ActionLivenessActivity.this;
                    n4 n4Var = actionLivenessActivity3.g0;
                    if (n4Var != null) {
                        n4Var.cancel();
                    }
                    actionLivenessActivity3.b0.setVisibility(8);
                    t4 t4Var5 = actionLivenessActivity3.y0;
                    if (t4Var5 != null) {
                        t4Var5.b();
                    }
                    i4 i4Var2 = actionLivenessActivity3.x0;
                    ((Activity) i4Var2.b).runOnUiThread(new j4(i4Var2));
                    actionLivenessActivity3.Z.setVisibility(8);
                    actionLivenessActivity3.c0.setVisibility(0);
                    actionLivenessActivity3.e0.setProgressLineColor(actionLivenessActivity3.getResources().getColor(actionLivenessActivity3.f1906h));
                    if (i19 == 1) {
                        resources = actionLivenessActivity3.getResources();
                        a2 = y4.a(actionLivenessActivity3);
                        i3 = R.string.key_livenessHomePromptCorrectActionText;
                    } else if (i19 == 2) {
                        resources = actionLivenessActivity3.getResources();
                        a2 = y4.a(actionLivenessActivity3);
                        i3 = R.string.key_livenessHomePromptCoherenceText;
                    } else if (i19 == 4) {
                        resources = actionLivenessActivity3.getResources();
                        a2 = y4.a(actionLivenessActivity3);
                        i3 = R.string.key_livenessHomePromptNoFaceText;
                    } else if (i19 == 5) {
                        resources = actionLivenessActivity3.getResources();
                        a2 = y4.a(actionLivenessActivity3);
                        i3 = R.string.key_livenessHomePromptFaceLocationText;
                    } else if (i19 == 6) {
                        resources = actionLivenessActivity3.getResources();
                        a2 = y4.a(actionLivenessActivity3);
                        i3 = R.string.key_livenessHomePromptFaceLostText;
                    } else if (i19 == 7) {
                        resources = actionLivenessActivity3.getResources();
                        a2 = y4.a(actionLivenessActivity3);
                        i3 = R.string.key_livenessHomePromptActionSpeedText;
                    } else {
                        if (i19 != 8) {
                            if (i19 == 9) {
                                resources = actionLivenessActivity3.getResources();
                                a2 = y4.a(actionLivenessActivity3);
                                i3 = R.string.key_livenessHomePromptMaskText;
                            }
                            actionLivenessActivity3.c0.setText(str4);
                            return;
                        }
                        resources = actionLivenessActivity3.getResources();
                        a2 = y4.a(actionLivenessActivity3);
                        i3 = R.string.key_livenessHomePromptOcclusionText;
                    }
                    str4 = resources.getString(a2.d(actionLivenessActivity3.getString(i3)));
                    actionLivenessActivity3.c0.setText(str4);
                    return;
                case 104:
                    Bundle data2 = message.getData();
                    int i20 = data2.getInt("curStep");
                    int i21 = data2.getInt("actionIndex");
                    data2.getInt("detectResult");
                    ActionLivenessActivity actionLivenessActivity4 = ActionLivenessActivity.this;
                    int i22 = ActionLivenessActivity.M0;
                    actionLivenessActivity4.d(i20, i21);
                    return;
                case 105:
                    int i23 = message.getData().getInt("qualityResult");
                    ActionLivenessActivity actionLivenessActivity5 = ActionLivenessActivity.this;
                    actionLivenessActivity5.b0.setVisibility(8);
                    actionLivenessActivity5.V.setVisibility(8);
                    actionLivenessActivity5.Z.setVisibility(0);
                    actionLivenessActivity5.X.setVisibility(8);
                    actionLivenessActivity5.Y.setVisibility(8);
                    if (i23 == 15) {
                        actionLivenessActivity5.a0.setText(actionLivenessActivity5.getResources().getString(y4.a(actionLivenessActivity5.K).d(actionLivenessActivity5.getString(R.string.key_livenessHomePromptVerticalText))));
                        actionLivenessActivity5.a0.setVisibility(0);
                        actionLivenessActivity5.d0.setVisibility(0);
                    } else {
                        actionLivenessActivity5.a0.setVisibility(8);
                        actionLivenessActivity5.d0.setVisibility(8);
                    }
                    String c2 = actionLivenessActivity5.c(i23, 4);
                    if (TextUtils.isEmpty(c2)) {
                        return;
                    }
                    if (i23 == 14 || actionLivenessActivity5.m0) {
                        textView = actionLivenessActivity5.Z;
                        resources2 = actionLivenessActivity5.getResources();
                        i4 = actionLivenessActivity5.f1905g;
                    } else {
                        textView = actionLivenessActivity5.Z;
                        resources2 = actionLivenessActivity5.getResources();
                        i4 = actionLivenessActivity5.f1906h;
                    }
                    actionLivenessActivity5.a(textView, c2, resources2.getColor(i4));
                    return;
                case 107:
                    Bundle data3 = message.getData();
                    String string3 = data3.getString("bizToken");
                    int i24 = data3.getInt("errorcode");
                    String string4 = data3.getString("errormessage");
                    byte[] byteArray = data3.getByteArray("delta");
                    HashMap hashMap = (HashMap) data3.getSerializable("imagedata");
                    ActionLivenessActivity actionLivenessActivity6 = ActionLivenessActivity.this;
                    int i25 = ActionLivenessActivity.M0;
                    if (actionLivenessActivity6.isFinishing()) {
                        return;
                    }
                    actionLivenessActivity6.f1901c.a(i24, string4, string3, actionLivenessActivity6.I, byteArray, hashMap);
                    actionLivenessActivity6.finish();
                    return;
                case 110:
                    ActionLivenessActivity actionLivenessActivity7 = ActionLivenessActivity.this;
                    int i26 = ActionLivenessActivity.M0;
                    actionLivenessActivity7.j();
                    return;
                case 113:
                    n4 n4Var2 = ActionLivenessActivity.this.g0;
                    if (n4Var2 != null) {
                        n4Var2.cancel();
                    }
                    int i27 = message.getData().getInt("actionStep");
                    if (i27 == 4) {
                        ActionLivenessActivity.this.e0.b(0.0f, true);
                        ActionLivenessActivity.this.e0.a();
                        ActionLivenessActivity.this.f0.setVisibility(0);
                        ActionLivenessActivity.this.P.setVisibility(8);
                        ActionLivenessActivity.this.l();
                        ActionLivenessActivity.this.n0 = false;
                        ActionLivenessActivity.this.e0.setProgress(0.0f);
                        return;
                    }
                    if (i27 == 5) {
                        ActionLivenessActivity.this.m0 = false;
                        ActionLivenessActivity.this.d0.setVisibility(8);
                        ActionLivenessActivity.this.a0.setVisibility(8);
                        if (!com.megvii.lv5.b.b) {
                            ActionLivenessActivity.this.e0.d();
                        }
                        ActionLivenessActivity.this.f0.setVisibility(4);
                        return;
                    }
                    if (i27 == 16) {
                        l3.r = true;
                        ActionLivenessActivity.this.V.setVisibility(8);
                        ActionLivenessActivity.this.P.setVisibility(8);
                        ActionLivenessActivity.this.m();
                        ActionLivenessActivity.this.n();
                        ActionLivenessActivity.this.d0.setVisibility(8);
                        ActionLivenessActivity.this.a0.setVisibility(8);
                        ActionLivenessActivity.this.b0.setVisibility(8);
                        ActionLivenessActivity.this.Z.setVisibility(8);
                        ActionLivenessActivity.this.X.setVisibility(8);
                        ActionLivenessActivity.a(ActionLivenessActivity.this);
                        ActionLivenessActivity.this.e0.e();
                        ActionLivenessActivity.this.e0.setProgress(100.0f);
                        ActionLivenessActivity actionLivenessActivity8 = ActionLivenessActivity.this;
                        actionLivenessActivity8.e0.setProgressLineColor(actionLivenessActivity8.getResources().getColor(ActionLivenessActivity.this.f1904f));
                        ActionLivenessActivity.this.e0.f();
                        ActionLivenessActivity.this.f0.setVisibility(4);
                        String string5 = ActionLivenessActivity.this.getResources().getString(y4.a(ActionLivenessActivity.this.getApplicationContext()).d(ActionLivenessActivity.this.getString(R.string.key_liveness_home_promptWait_text)));
                        ActionLivenessActivity.this.Y.setVisibility(0);
                        ActionLivenessActivity actionLivenessActivity9 = ActionLivenessActivity.this;
                        TextView textView3 = actionLivenessActivity9.X;
                        if (actionLivenessActivity9.p0) {
                            ((AccessibilityManager) textView3.getContext().getSystemService("accessibility")).interrupt();
                        }
                        ActionLivenessActivity.this.Y.setText(string5);
                        ActionLivenessActivity actionLivenessActivity10 = ActionLivenessActivity.this;
                        actionLivenessActivity10.a(actionLivenessActivity10.Y, string5);
                        return;
                    }
                    if (i27 == 17) {
                        ActionLivenessActivity.this.e0.a();
                        ActionLivenessActivity.this.e0.setProgress(0.0f);
                        ActionLivenessActivity.this.e0.b();
                        ActionLivenessActivity.this.f0.setVisibility(4);
                        ActionLivenessActivity.this.V.setVisibility(8);
                        ActionLivenessActivity.this.m();
                        ActionLivenessActivity.this.n();
                        ActionLivenessActivity.this.d0.setVisibility(8);
                        ActionLivenessActivity.this.a0.setVisibility(8);
                        ActionLivenessActivity.this.b0.setVisibility(8);
                        ActionLivenessActivity.this.X.setVisibility(8);
                        ActionLivenessActivity.a(ActionLivenessActivity.this);
                        ActionLivenessActivity actionLivenessActivity11 = ActionLivenessActivity.this;
                        actionLivenessActivity11.e0.setForegroundColor(actionLivenessActivity11.getResources().getColor(ActionLivenessActivity.this.f1910l));
                        ActionLivenessActivity.this.P.setSpeed(6);
                        ActionLivenessActivity.this.P.setScaning(true);
                        ActionLivenessActivity.this.P.setVisibility(0);
                        break;
                    } else {
                        return;
                    }
                case 114:
                    message.getData().getLong(TypedValues.TransitionType.S_DURATION);
                    return;
                case 115:
                    if (message.getData().getInt("curStep") == 17) {
                        ActionLivenessActivity.this.e0.a();
                        ActionLivenessActivity.this.e0.setProgress(0.0f);
                        ActionLivenessActivity.this.V.setVisibility(8);
                        ActionLivenessActivity.this.m();
                        ActionLivenessActivity.this.n();
                        ActionLivenessActivity.this.d0.setVisibility(8);
                        ActionLivenessActivity.this.a0.setVisibility(8);
                        ActionLivenessActivity.this.b0.setVisibility(8);
                        ActionLivenessActivity.this.X.setVisibility(8);
                        ActionLivenessActivity.a(ActionLivenessActivity.this);
                        ActionLivenessActivity actionLivenessActivity12 = ActionLivenessActivity.this;
                        actionLivenessActivity12.e0.setForegroundColor(actionLivenessActivity12.getResources().getColor(ActionLivenessActivity.this.f1910l));
                        ActionLivenessActivity.this.P.setSpeed(6);
                        ActionLivenessActivity.this.P.setScaning(true);
                        ActionLivenessActivity.this.P.setVisibility(0);
                        return;
                    }
                    return;
                case 116:
                    break;
                case 118:
                    message.getData();
                    ActionLivenessActivity.this.n0 = true;
                    ActionLivenessActivity.this.Q.setVisibility(8);
                    return;
                case 120:
                    ActionLivenessActivity.this.e0.setProgress(message.getData().getFloat("progress") * 100.0f);
                    return;
            }
            l3.r = true;
        }
    }

    public class b implements ViewTreeObserver.OnGlobalLayoutListener {
        public b() {
        }

        @Override
        public void onGlobalLayout() {
            ActionLivenessActivity actionLivenessActivity;
            int min;
            ActionLivenessActivity.this.O.getViewTreeObserver().removeOnGlobalLayoutListener(this);
            if (!m4.f(ActionLivenessActivity.this.K).I2) {
                ActionLivenessActivity actionLivenessActivity2 = ActionLivenessActivity.this;
                if (actionLivenessActivity2.L != w4.c) {
                    actionLivenessActivity2.G0 = Math.min(actionLivenessActivity2.O.getMeasuredWidth(), ActionLivenessActivity.this.O.getMeasuredHeight());
                    actionLivenessActivity = ActionLivenessActivity.this;
                    min = Math.max(actionLivenessActivity.O.getMeasuredWidth(), ActionLivenessActivity.this.O.getMeasuredHeight());
                    actionLivenessActivity.F0 = min;
                    ActionLivenessActivity actionLivenessActivity3 = ActionLivenessActivity.this;
                    int i2 = actionLivenessActivity3.G0;
                    int i3 = actionLivenessActivity3.F0;
                    actionLivenessActivity3.e0.setForegroundColor(actionLivenessActivity3.getResources().getColor(ActionLivenessActivity.this.f1910l));
                }
            }
            ActionLivenessActivity actionLivenessActivity4 = ActionLivenessActivity.this;
            actionLivenessActivity4.G0 = Math.max(actionLivenessActivity4.O.getMeasuredWidth(), ActionLivenessActivity.this.O.getMeasuredHeight());
            actionLivenessActivity = ActionLivenessActivity.this;
            min = Math.min(actionLivenessActivity.O.getMeasuredWidth(), ActionLivenessActivity.this.O.getMeasuredHeight());
            actionLivenessActivity.F0 = min;
            ActionLivenessActivity actionLivenessActivity32 = ActionLivenessActivity.this;
            int i22 = actionLivenessActivity32.G0;
            int i32 = actionLivenessActivity32.F0;
            actionLivenessActivity32.e0.setForegroundColor(actionLivenessActivity32.getResources().getColor(ActionLivenessActivity.this.f1910l));
        }
    }

    public class c implements n4.a {

        public class a implements Runnable {
            public a() {
            }

            @Override
            public void run() {
                ActionLivenessActivity actionLivenessActivity = ActionLivenessActivity.this;
                ActionLivenessActivity.a(actionLivenessActivity, actionLivenessActivity.z0, 1);
            }
        }

        public class b implements Runnable {
            public b() {
            }

            @Override
            public void run() {
                ActionLivenessActivity actionLivenessActivity = ActionLivenessActivity.this;
                ActionLivenessActivity.a(actionLivenessActivity, actionLivenessActivity.A0, 0);
            }
        }

        public c() {
        }

        public void a() {
            ActionLivenessActivity actionLivenessActivity = ActionLivenessActivity.this;
            AnimationDrawable animationDrawable = actionLivenessActivity.w0;
            if (animationDrawable == actionLivenessActivity.v0) {
                actionLivenessActivity.z0.setVisibility(0);
                ActionLivenessActivity.this.z0.post(new a());
            } else if (animationDrawable == actionLivenessActivity.u0) {
                actionLivenessActivity.A0.setVisibility(0);
                ActionLivenessActivity.this.A0.post(new b());
            }
        }
    }

    public class d implements Runnable {
        public d() {
        }

        @Override
        public void run() {
            ActionLivenessActivity.this.q0 = true;
        }
    }

    public class e implements Runnable {
        public e() {
        }

        @Override
        public void run() {
            ActionLivenessActivity.this.W.setTextSize(2, 15.0f);
            ActionLivenessActivity.this.W.measure(0, 0);
            ActionLivenessActivity actionLivenessActivity = ActionLivenessActivity.this;
            actionLivenessActivity.I0 = actionLivenessActivity.W.getHeight();
            o oVar = o.M;
            int min = (int) Math.min(oVar.j - ActionLivenessActivity.this.I0, oVar.b * 2.0f * 0.16f);
            ViewGroup.LayoutParams layoutParams = ActionLivenessActivity.this.V.getLayoutParams();
            layoutParams.width = min;
            layoutParams.height = min;
            ActionLivenessActivity.this.V.setLayoutParams(layoutParams);
            ActionLivenessActivity actionLivenessActivity2 = ActionLivenessActivity.this;
            actionLivenessActivity2.V.setY(oVar.a(actionLivenessActivity2.I0, layoutParams.width));
        }
    }

    public class f implements DialogInterface.OnClickListener {
        public f() {
        }

        @Override
        @SensorsDataInstrumented
        public void onClick(DialogInterface dialogInterface, int i2) {
            ActionLivenessActivity.this.G = false;
            dialogInterface.dismiss();
            ActionLivenessActivity actionLivenessActivity = ActionLivenessActivity.this;
            actionLivenessActivity.a(q4.J, actionLivenessActivity.S);
            SensorsDataAutoTrackHelper.trackDialog(dialogInterface, i2);
        }
    }

    public class g implements ValueAnimator.AnimatorUpdateListener {

        public final float f1926a;

        public final float f1927b;

        public g(float f2, float f3) {
            this.f1926a = f2;
            this.f1927b = f3;
        }

        @Override
        public void onAnimationUpdate(ValueAnimator valueAnimator) {
            float floatValue = ((Float) valueAnimator.getAnimatedValue()).floatValue();
            LoadingCoverView loadingCoverView = ActionLivenessActivity.this.e0;
            float f2 = this.f1926a;
            loadingCoverView.setProgress((f2 + (floatValue * (this.f1927b - f2))) * 100.0f);
        }
    }

    public static class h implements View.OnClickListener {

        public WeakReference<ActionLivenessActivity> f1929a;

        public h(ActionLivenessActivity actionLivenessActivity) {
            this.f1929a = new WeakReference<>(actionLivenessActivity);
        }

        @Override
        @SensorsDataInstrumented
        public void onClick(View view) {
            ActionLivenessActivity actionLivenessActivity = this.f1929a.get();
            if (actionLivenessActivity != null) {
                if (actionLivenessActivity.isFinishing()) {
                    SensorsDataAutoTrackHelper.trackViewOnClick(view);
                    return;
                }
                if (view.getId() == R.id.ll_action_close) {
                    int i2 = ActionLivenessActivity.M0;
                    actionLivenessActivity.g();
                } else if (view.getId() == R.id.tv_face_dialog_left) {
                    AlertDialog alertDialog = actionLivenessActivity.f1899a;
                    if (alertDialog != null) {
                        alertDialog.dismiss();
                    }
                    com.megvii.lv5.c.a = actionLivenessActivity.l0;
                    b5.a(c.a.a.a("click_cancel_quit", actionLivenessActivity.S, actionLivenessActivity.j0));
                    actionLivenessActivity.m0 = true;
                    actionLivenessActivity.L0 = false;
                    actionLivenessActivity.i0++;
                    i4 i4Var = actionLivenessActivity.x0;
                    ((Activity) i4Var.b).runOnUiThread(new k4(i4Var));
                    j3.a.a.a(actionLivenessActivity.r0);
                    com.megvii.lv5.d.b(actionLivenessActivity);
                } else if (view.getId() == R.id.tv_face_dialog_right) {
                    actionLivenessActivity.b();
                }
            }
            SensorsDataAutoTrackHelper.trackViewOnClick(view);
        }
    }

    public void a(float f2) {
        Bundle bundle = new Bundle();
        bundle.putFloat("progress", f2);
        a(120, bundle);
    }

    public void b(int i2) {
        if (i2 == 16 || i2 == 17) {
            this.n0 = true;
        }
        Bundle bundle = new Bundle();
        bundle.putInt("actionStep", i2);
        a(113, bundle);
    }

    @Override
    public int c() {
        return R.layout.activity_action_liveness_ex;
    }

    @Override
    public void f() {
        CameraGLSurfaceView cameraGLSurfaceView = (CameraGLSurfaceView) findViewById(R.id.livess_layout_cameraview);
        this.O = cameraGLSurfaceView;
        cameraGLSurfaceView.a(this, this);
        this.O.setVisibility(0);
        this.P = (RadarView) findViewById(R.id.radar_view);
        this.f0 = (ImageView) findViewById(R.id.liveness_img_color_line);
        LoadingCoverView loadingCoverView = (LoadingCoverView) findViewById(R.id.liveness_layout_lcv);
        this.e0 = loadingCoverView;
        loadingCoverView.setParamView(this.f0);
        this.e0.setStatusBarColorCallback(this);
        this.h0 = new h(this);
        this.U = (ImageView) findViewById(R.id.iv_face_powerby);
        this.T = (ImageView) findViewById(R.id.iv_liveness_homepage_close);
        LinearLayout linearLayout = (LinearLayout) findViewById(R.id.ll_action_close);
        this.Q = linearLayout;
        linearLayout.setOnClickListener(this.h0);
        this.W = (TextView) findViewById(R.id.tv_liveness_top_tips);
        this.X = (TextView) findViewById(R.id.tv_action_tips);
        this.Y = (TextView) findViewById(R.id.tv_finish_tips);
        this.Z = (TextView) findViewById(R.id.tv_status_tips);
        this.a0 = (TextView) findViewById(R.id.tv_vertical_tips);
        this.b0 = (TextView) findViewById(R.id.tv_the_countdown);
        this.d0 = (ImageView) findViewById(R.id.iv_bg_vertical);
        this.z0 = (ImageView) findViewById(R.id.image_animation_shake);
        this.A0 = (ImageView) findViewById(R.id.image_animation_nod);
        this.c0 = (TextView) findViewById(R.id.tv_tips_action_failed);
        this.O.getViewTreeObserver().addOnGlobalLayoutListener(new b());
    }

    @Override
    public void h() {
        if (this.n0 || !this.R.o2) {
            return;
        }
        AlertDialog alertDialog = this.f1899a;
        if (alertDialog == null || !alertDialog.isShowing()) {
            this.f1899a = this.f1900b.a(!this.R.I2, this.h0);
            com.megvii.lv5.c.a = this.l0;
            b5.a(c.a.a.a("click_quit_icon", this.S, this.j0));
            j();
        }
    }

    public final void i() {
        try {
            if (this.K0) {
                return;
            }
            boolean z = f1.v;
            f1 f1Var = f1.j.a;
            synchronized (f1Var) {
                Thread.currentThread().getName();
                f1Var.k = null;
            }
            e4.b.a.a(this);
            this.O.onPause();
            Handler handler = this.H0;
            if (handler != null) {
                handler.removeCallbacksAndMessages(null);
            }
            t4 t4Var = this.y0;
            if (t4Var != null) {
                t4Var.a();
            }
            AlertDialog alertDialog = this.f1899a;
            if (alertDialog != null) {
                alertDialog.dismiss();
            }
            this.K0 = true;
        } catch (Throwable unused) {
        }
    }

    public final void j() {
        this.L0 = true;
        this.H0.removeCallbacksAndMessages(null);
        n4 n4Var = this.g0;
        if (n4Var != null) {
            n4Var.cancel();
        }
        m();
        n();
        boolean z = f1.v;
        f1 f1Var = f1.j.a;
        c0 c0Var = f1Var.m;
        c0Var.getClass();
        try {
            j jVar = ((a0) c0Var).a;
            if (jVar != null) {
                jVar.a.n();
            }
        } catch (Throwable th) {
            th.printStackTrace();
        }
        f1Var.m.J();
        i4 i4Var = this.x0;
        ((Activity) i4Var.b).runOnUiThread(new j4(i4Var));
        t4 t4Var = this.y0;
        if (t4Var != null) {
            t4Var.b();
            this.y0.b(-1, (String) null);
        }
    }

    public final void k() {
        try {
            com.megvii.lv5.c.d = true;
            j();
            if (!isFinishing() && !this.n0) {
                q4 q4Var = q4.z;
                a(q4Var, this.S);
                a(PointerIconCompat.TYPE_TOP_LEFT_DIAGONAL_DOUBLE_ARROW, q4Var.b, this.S, (byte[]) null, (HashMap<String, byte[]>) null);
            }
            if (isFinishing()) {
                i();
            }
        } catch (Throwable unused) {
        }
    }

    public final void l() {
        LinearLayout linearLayout;
        int i2;
        if (this.R.o2) {
            linearLayout = this.Q;
            i2 = 0;
        } else {
            linearLayout = this.Q;
            i2 = 8;
        }
        linearLayout.setVisibility(i2);
    }

    public final void m() {
        this.A0.setVisibility(8);
        this.A0.clearAnimation();
    }

    public final void n() {
        this.z0.setVisibility(8);
        this.z0.clearAnimation();
    }

    public final void o() {
        if (this.R.s2 == 1) {
            String string = getResources().getString(y4.a(this).d(getString(R.string.key_liveness_home_active_prompt_mode_text)));
            if (!this.B0 && TextUtils.isEmpty(string)) {
                string = this.R.t2;
            }
            if (TextUtils.isEmpty(string)) {
                return;
            }
            this.W.setVisibility(0);
            this.W.setText(string);
            if (this.f1908j != 0) {
                this.W.setBackgroundColor(getResources().getColor(this.f1908j));
            }
            if (this.f1909k != 0) {
                this.W.setTextColor(getResources().getColor(this.f1909k));
            }
            this.W.post(new e());
        }
    }

    @Override
    public void onActivityResult(int i2, int i3, Intent intent) {
        super.onActivityResult(i2, i3, intent);
        if (i2 == 10086 && i3 == -1) {
            com.megvii.lv5.c.a = "liveness-sdk";
            b5.a(c.a.a.a("scrn_user_click_yes", this.S, this.j0));
            this.G = false;
            e4.b.a.a(i2, i3, intent, true);
            j3.a.a.a(this.r0);
        } else {
            com.megvii.lv5.c.a = "liveness-sdk";
            b5.a(c.a.a.a("scrn_user_click_no", this.S, this.j0));
            if (this.E0 == 1) {
                String string = getResources().getString(this.D);
                new AlertDialog.Builder(this).setCancelable(false).setMessage(string).setPositiveButton(getResources().getString(this.E), new f()).create().show();
            } else {
                getWindow().addFlags(8192);
                this.G = false;
                j3.a.a.a(this.r0);
            }
        }
        com.megvii.lv5.c.a = "liveness-sdk";
        b5.a(c.a.a.a("scrn_pass_permissions_detect", this.S, this.j0));
    }

    @Override
    @SensorsDataInstrumented
    public void onClick(View view) {
        SensorsDataAutoTrackHelper.trackViewOnClick(view);
    }

    @Override
    public void onDestroy() {
        super.onDestroy();
        i();
    }

    @Override
    public void onPause() {
        super.onPause();
        try {
            if (this.G || this.R.Q2) {
                return;
            }
            k();
        } catch (Exception e2) {
            e2.printStackTrace();
        }
    }

    @Override
    public void onResume() {
        super.onResume();
    }

    @Override
    public void onStop() {
        super.onStop();
        if (this.R.Q2) {
            k();
        }
    }

    public final void a(float f2, float f3, long j2) {
        ValueAnimator ofFloat = ValueAnimator.ofFloat(0.0f, 1.0f);
        ofFloat.setDuration(j2);
        ofFloat.addUpdateListener(new g(f2, f3));
        ofFloat.start();
    }

    public void b(int i2, int i3) {
        if (this.L0) {
            return;
        }
        Bundle bundle = new Bundle();
        bundle.putInt("actionIndex", i2);
        bundle.putInt("currentAction", i3);
        a(102, bundle);
    }

    public void c(int i2) {
        this.N.setBackgroundColor(i2);
        com.megvii.lv5.d.a(this, i2);
    }

    public final void d(int i2, int i3) {
        m();
        n();
        if (i2 == 5) {
            if (!com.megvii.lv5.b.b) {
                this.e0.d();
            }
            float f2 = 1.0f / this.R.b;
            float f3 = i3 * f2;
            float f4 = f2 * (i3 - 1);
            float f5 = f4 >= 0.0f ? f4 : 0.0f;
            this.e0.setProgressLineColor(getResources().getColor(this.f1904f));
            a(f5, f3, 300L);
            return;
        }
        if (i2 == 16) {
            this.e0.e();
            this.e0.setProgress(100.0f);
            this.e0.setProgressLineColor(getResources().getColor(this.f1904f));
        } else if (i2 == 4) {
            this.e0.setProgress(0.0f);
        }
    }

    @Override
    public void e() {
        this.B0 = com.megvii.lv5.b.a;
        boolean z = f1.v;
        f1 f1Var = f1.j.a;
        synchronized (f1Var) {
            Thread.currentThread().getName();
            f1Var.k = this;
        }
        this.z0.setImageDrawable(getResources().getDrawable(y4.a(this).b(getString(R.string.key_liveness_action_shake_tips_icon))));
        this.A0.setImageDrawable(getResources().getDrawable(y4.a(this).b(getString(R.string.key_liveness_action_nod_tips_icon))));
        this.R = m4.f(getApplicationContext());
        this.y0 = new t4(this);
        this.j0 = this.R.a;
        int intValue = ((Integer) u4.a(getApplicationContext(), "face_liveness_platform", 1)).intValue();
        this.k0 = intValue;
        this.l0 = intValue == 1 ? "liveness-sdk" : "FinAuthZFAC";
        l0 l0Var = this.R;
        int[] iArr = l0Var.e;
        this.E0 = l0Var.E2;
        if (!u4.a(this)) {
            this.E0 = 0;
        }
        this.S = m4.a(getApplicationContext());
        ImageView imageView = (ImageView) findViewById(R.id.image_animation);
        this.V = imageView;
        this.x0 = new i4(this, imageView);
        this.T.setImageDrawable(getResources().getDrawable(this.t));
        this.d0.setImageDrawable(getResources().getDrawable(this.f1917s));
        this.Z.setTextSize(0, getResources().getDimension(this.f1911m));
        this.X.setTextSize(0, getResources().getDimension(this.f1912n));
        this.X.setTextColor(com.megvii.lv5.b.b ? getResources().getColor(R.color.face_liveness_tips_color_black) : -1);
        this.Y.setTextSize(0, getResources().getDimension(this.f1913o));
        this.Y.setTextColor(-1);
        this.a0.setTextSize(0, getResources().getDimension(this.f1914p));
        this.a0.setTextColor(getResources().getColor(this.f1907i));
        this.b0.setTextSize(0, getResources().getDimension(this.f1915q));
        this.b0.setTextColor(com.megvii.lv5.b.b ? getResources().getColor(R.color.face_liveness_tips_color_black) : -1);
        if (com.megvii.lv5.b.b) {
            u4.a(this.a0, 3, 8);
            u4.a(this.Z, 3, 8);
            u4.a(this.X, 3, 8);
            u4.a(this.b0, 1, 8);
            u4.a(this.Y, 2, 8);
        }
        if (this.w) {
            this.U.setImageDrawable(getResources().getDrawable(this.f1916r));
            this.U.setVisibility(0);
        } else {
            this.U.setVisibility(8);
        }
        l();
        o();
        boolean c2 = com.megvii.lv5.d.c(this);
        this.p0 = c2;
        if (this.R.K2 || c2) {
            this.y0 = null;
        } else if (this.x) {
            e(this.y);
        }
        this.g0 = new n4(this.b0, this.R.d * 1000, 1000L, new c());
        if (this.p0) {
            this.Q.setContentDescription(getResources().getString(y4.a(this.K).d(getString(R.string.key_liveness_home_close_button_text))));
            this.H0.postDelayed(new d(), 3500L);
        }
        com.megvii.lv5.c.a = "liveness-sdk";
        b5.a(c.a.a.a("enter_page_success", this.S, this.j0));
    }

    public void a(int i2) {
        Bundle bundle = new Bundle();
        bundle.putInt("qualityResult", i2);
        if (!this.p0 || this.q0) {
            a(105, bundle);
        }
    }

    public void a(int i2, int i3) {
        Bundle bundle = new Bundle();
        bundle.putInt("action_error_type", i2);
        a(103, bundle);
    }

    @Override
    public void b() {
        AlertDialog alertDialog = this.f1899a;
        if (alertDialog != null) {
            alertDialog.dismiss();
        }
        com.megvii.lv5.c.a = this.l0;
        b5.a(c.a.a.a("click_confirm_quit", this.S, this.j0));
        a(q4.y, this.S);
    }

    public final void a(int i2, Bundle bundle) {
        Message message = new Message();
        message.what = i2;
        message.setData(bundle);
        this.H0.sendMessage(message);
    }

    public void a(int i2, String str, w2 w2Var, byte[] bArr, byte[] bArr2) {
        Bundle bundle = new Bundle();
        bundle.putString("bizToken", this.S);
        bundle.putInt("errorcode", i2);
        bundle.putString("errormessage", str);
        bundle.putByteArray("delta", bArr);
        bundle.putSerializable("imagedata", this.J0);
        this.I = m4.a(w2Var);
        a(107, bundle);
    }

    public final void a(int i2, String str, String str2, byte[] bArr, HashMap<String, byte[]> hashMap) {
        if (isFinishing()) {
            return;
        }
        this.f1901c.a(i2, str, str2, this.I, bArr, hashMap);
        finish();
    }

    public final void a(TextView textView, String str, int i2) {
        textView.setText(str);
        a(textView, str);
        textView.setTextColor(i2);
    }

    public void a(String str) {
    }

    public void a(Throwable th) {
        a(1005, String.format("{%s}", m4.a(th)), this.S, "".getBytes(), (HashMap<String, byte[]>) null);
    }

    public void a(HashMap<String, byte[]> hashMap) {
        this.J0 = hashMap;
    }

    public void a(byte[] bArr, int i2, int i3) {
        this.O.a(bArr, i2, i3);
    }

    public static void a(ActionLivenessActivity actionLivenessActivity) {
        actionLivenessActivity.Q.setVisibility(8);
    }

    public static void a(ActionLivenessActivity actionLivenessActivity, ImageView imageView, int i2) {
        actionLivenessActivity.getClass();
        if (imageView == null || imageView.getAnimation() == null) {
            imageView.getWidth();
            imageView.getHeight();
            z4 z4Var = new z4(actionLivenessActivity, 0.0f, 180.0f, imageView.getWidth() / 2.0f, imageView.getHeight() / 2.0f, 1.0f, true, i2);
            z4Var.setDuration(1000L);
            z4Var.setRepeatCount(-1);
            z4Var.setRepeatMode(2);
            z4Var.setInterpolator(new LinearInterpolator());
            z4Var.setAnimationListener(new u(actionLivenessActivity));
            imageView.startAnimation(z4Var);
        }
    }

    @Override
    public void a(q4 q4Var, String str) {
        String str2 = (q4Var == q4.B || q4Var == q4.O) ? "camera_fail" : q4Var == q4.z ? "go_to_background" : q4Var == q4.y ? "user_cancel" : q4Var == q4.J ? "scrn_authorized_fail" : "";
        com.megvii.lv5.c.a = this.l0;
        b5.a(c.a.a.a("fail_detect:" + str2, this.S, this.j0));
        j3.a.a.a(m4.a(q4Var));
    }

    public void a(SurfaceTexture surfaceTexture) {
        boolean z;
        this.r0 = surfaceTexture;
        Bundle bundle = new Bundle();
        Message message = new Message();
        message.what = 100;
        message.setData(bundle);
        this.H0.sendMessageDelayed(message, 200L);
        int i2 = this.E0;
        if (i2 == 0) {
            if (this.D0) {
                j3.a.a.a(this.r0);
                return;
            }
            return;
        }
        if (i2 == 0) {
            return;
        }
        if (i2 == 1 && !com.megvii.lv5.d.a(this)) {
            a(q4.M, this.S);
            return;
        }
        e4 e4Var = e4.b.a;
        if (e4Var.d != null || ((z = this.C0) && !this.G)) {
            e4Var.a(this);
            j3.a.a.a(this.r0);
        } else {
            if (z) {
                return;
            }
            com.megvii.lv5.c.a = "liveness-sdk";
            b5.a(c.a.a.a("scrn_enter_permissions_detect", this.S, this.j0));
            this.C0 = true;
            this.G = true;
            e4Var.a(this);
        }
    }

    public final void a(View view, String str) {
        if (!this.p0 || TextUtils.isEmpty(str.trim())) {
            return;
        }
        view.announceForAccessibility(str);
        if (this.o0) {
            this.o0 = false;
            if (this.p0) {
                view.requestFocus();
                view.sendAccessibilityEvent(8);
            }
        }
    }
}