导航菜单

页面标题

页面副标题

PrestMan MX v1.0.0 - LivenessActivity.java 源代码

正在查看: PrestMan MX v1.0.0 应用的 LivenessActivity.java JAVA 源代码文件

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


package aai.liveness.activity;

import a3d20241011.g;
import a3d20241011.h;
import aai.liveness.LivenessView;
import android.app.AlertDialog;
import android.app.ProgressDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.res.Configuration;
import android.graphics.drawable.AnimationDrawable;
import android.os.Build;
import android.os.Bundle;
import android.util.SparseArray;
import android.view.View;
import android.widget.CheckBox;
import android.widget.CompoundButton;
import android.widget.ImageView;
import android.widget.TextView;
import b.EnumC0603a;
import b.EnumC0605c;
import b.EnumC0607e;
import b.i;
import b.j;
import b.k;
import b.l;
import com.android.installreferrer.api.InstallReferrerClient;
import com.kochava.tracker.BuildConfig;
import d.C0638a;
import e.InterfaceC0685a;
import i.AbstractC0772h;
import j.AbstractActivityC0933a;
import java.util.Locale;

public class LivenessActivity extends AbstractActivityC0933a implements InterfaceC0685a {

    private SparseArray f4341C;

    protected ImageView f4342D;

    protected LivenessView f4343E;

    private ImageView f4344F;

    private TextView f4345G;

    private TextView f4346H;

    private CheckBox f4347I;

    private View f4348J;

    ProgressDialog f4349K;

    class a implements View.OnClickListener {
        a() {
        }

        @Override
        public void onClick(View view) {
            LivenessActivity.this.onBackPressed();
        }
    }

    class b implements CompoundButton.OnCheckedChangeListener {
        b() {
        }

        @Override
        public void onCheckedChanged(CompoundButton compoundButton, boolean z4) {
            LivenessActivity.this.f4343E.setSoundPlayEnable(z4);
            if (z4) {
                LivenessActivity.this.L0();
            }
        }
    }

    class c implements DialogInterface.OnClickListener {

        final String f4352a;

        c(String str) {
            this.f4352a = str;
        }

        @Override
        public void onClick(DialogInterface dialogInterface, int i5) {
            h.q(this.f4352a);
            dialogInterface.dismiss();
            LivenessActivity.this.setResult(-1);
            LivenessActivity.this.finish();
        }
    }

    class d implements e.b {
        d() {
        }

        @Override
        public void a(C0638a c0638a) {
            if (!c0638a.f9601b && "NO_RESPONSE".equals(c0638a.f9600a)) {
                h.q(LivenessActivity.this.getString(l.f7976i));
            }
            LivenessActivity.this.M0();
        }

        @Override
        public void b() {
            LivenessActivity.this.f4348J.setVisibility(0);
            LivenessActivity.this.f4346H.setVisibility(4);
            LivenessActivity.this.f4343E.setVisibility(4);
            LivenessActivity.this.f4347I.setVisibility(4);
            LivenessActivity.this.f4344F.setVisibility(4);
            LivenessActivity.this.f4345G.setVisibility(4);
            LivenessActivity.this.f4342D.setVisibility(4);
        }

        @Override
        public void c(C0638a c0638a, String str) {
            LivenessActivity.this.M0();
        }
    }

    class e implements DialogInterface.OnClickListener {
        e() {
        }

        @Override
        public void onClick(DialogInterface dialogInterface, int i5) {
            LivenessActivity.this.finish();
        }
    }

    static class f {

        static final int[] f4356a;

        static final int[] f4357b;

        static final int[] f4358c;

        static {
            int[] iArr = new int[EnumC0603a.values().length];
            f4358c = iArr;
            try {
                iArr[EnumC0603a.FACEMISSING.ordinal()] = 1;
            } catch (NoSuchFieldError unused) {
            }
            try {
                f4358c[EnumC0603a.TIMEOUT.ordinal()] = 2;
            } catch (NoSuchFieldError unused2) {
            }
            try {
                f4358c[EnumC0603a.MULTIPLEFACE.ordinal()] = 3;
            } catch (NoSuchFieldError unused3) {
            }
            try {
                f4358c[EnumC0603a.MUCHMOTION.ordinal()] = 4;
            } catch (NoSuchFieldError unused4) {
            }
            try {
                f4358c[EnumC0603a.WEAKLIGHT.ordinal()] = 5;
            } catch (NoSuchFieldError unused5) {
            }
            try {
                f4358c[EnumC0603a.STRONGLIGHT.ordinal()] = 6;
            } catch (NoSuchFieldError unused6) {
            }
            int[] iArr2 = new int[EnumC0607e.values().length];
            f4357b = iArr2;
            try {
                iArr2[EnumC0607e.FACEMISSING.ordinal()] = 1;
            } catch (NoSuchFieldError unused7) {
            }
            try {
                f4357b[EnumC0607e.FACESMALL.ordinal()] = 2;
            } catch (NoSuchFieldError unused8) {
            }
            try {
                f4357b[EnumC0607e.FACELARGE.ordinal()] = 3;
            } catch (NoSuchFieldError unused9) {
            }
            try {
                f4357b[EnumC0607e.FACENOTCENTER.ordinal()] = 4;
            } catch (NoSuchFieldError unused10) {
            }
            try {
                f4357b[EnumC0607e.FACENOTFRONTAL.ordinal()] = 5;
            } catch (NoSuchFieldError unused11) {
            }
            try {
                f4357b[EnumC0607e.FACENOTSTILL.ordinal()] = 6;
            } catch (NoSuchFieldError unused12) {
            }
            try {
                f4357b[EnumC0607e.FACECAPTURE.ordinal()] = 7;
            } catch (NoSuchFieldError unused13) {
            }
            try {
                f4357b[EnumC0607e.WARN_EYE_OCCLUSION.ordinal()] = 8;
            } catch (NoSuchFieldError unused14) {
            }
            try {
                f4357b[EnumC0607e.WARN_MOUTH_OCCLUSION.ordinal()] = 9;
            } catch (NoSuchFieldError unused15) {
            }
            try {
                f4357b[EnumC0607e.WARN_WEAKLIGHT.ordinal()] = 10;
            } catch (NoSuchFieldError unused16) {
            }
            try {
                f4357b[EnumC0607e.WARN_TOOLIGHT.ordinal()] = 11;
            } catch (NoSuchFieldError unused17) {
            }
            try {
                f4357b[EnumC0607e.WARN_FACE_BIAS_BOTTOM.ordinal()] = 12;
            } catch (NoSuchFieldError unused18) {
            }
            try {
                f4357b[EnumC0607e.WARN_FACE_BIAS_UP.ordinal()] = 13;
            } catch (NoSuchFieldError unused19) {
            }
            try {
                f4357b[EnumC0607e.WARN_FACE_BIAS_RIGHT.ordinal()] = 14;
            } catch (NoSuchFieldError unused20) {
            }
            try {
                f4357b[EnumC0607e.WARN_FACE_BIAS_LEFT.ordinal()] = 15;
            } catch (NoSuchFieldError unused21) {
            }
            try {
                f4357b[EnumC0607e.FACEINACTION.ordinal()] = 16;
            } catch (NoSuchFieldError unused22) {
            }
            int[] iArr3 = new int[EnumC0605c.values().length];
            f4356a = iArr3;
            try {
                iArr3[EnumC0605c.POS_YAW.ordinal()] = 1;
            } catch (NoSuchFieldError unused23) {
            }
            try {
                f4356a[EnumC0605c.MOUTH.ordinal()] = 2;
            } catch (NoSuchFieldError unused24) {
            }
            try {
                f4356a[EnumC0605c.BLINK.ordinal()] = 3;
            } catch (NoSuchFieldError unused25) {
            }
        }
    }

    private void H0(int i5) {
        this.f4345G.setText(i5);
    }

    private void K0() {
        this.f4341C = new SparseArray();
        this.f4343E.setLivenssCallback(this);
    }

    public void L0() {
        int i5;
        if (this.f4347I.getVisibility() != 0) {
            this.f4347I.setVisibility(0);
        }
        EnumC0605c currentDetectionType = this.f4343E.getCurrentDetectionType();
        if (currentDetectionType != null) {
            int i6 = f.f4356a[currentDetectionType.ordinal()];
            if (i6 == 1) {
                i5 = k.f7965c;
            } else if (i6 == 2) {
                i5 = k.f7964b;
            } else if (i6 == 3) {
                i5 = k.f7963a;
            }
            this.f4343E.m(i5, true, 1500L);
        }
        i5 = -1;
        this.f4343E.m(i5, true, 1500L);
    }

    public void M0() {
        setResult(-1);
        finish();
    }

    private void N0() {
        EnumC0605c currentDetectionType = this.f4343E.getCurrentDetectionType();
        if (currentDetectionType != null) {
            int i5 = f.f4356a[currentDetectionType.ordinal()];
            H0(i5 != 1 ? i5 != 2 ? i5 != 3 ? 0 : l.f7969b : l.f7984q : l.f7990w);
            AnimationDrawable J02 = J0(currentDetectionType);
            this.f4344F.setImageDrawable(J02);
            J02.start();
        }
    }

    private void O0() {
        this.f4343E.setVisibility(0);
        this.f4345G.setVisibility(0);
        this.f4344F.setVisibility(0);
        this.f4342D.setVisibility(0);
        this.f4346H.setText("");
        this.f4346H.setBackgroundResource(0);
        this.f4346H.setVisibility(0);
        this.f4347I.setVisibility(4);
        this.f4344F.setImageDrawable(null);
        this.f4348J.setVisibility(4);
    }

    private void P0(EnumC0607e enumC0607e) {
        int i5;
        if (!this.f4343E.i()) {
            i5 = l.f7983p;
        } else if (enumC0607e != null) {
            switch (f.f4357b[enumC0607e.ordinal()]) {
                case 1:
                    i5 = l.f7987t;
                    break;
                case 2:
                    i5 = l.f7992y;
                    break;
                case 3:
                    i5 = l.f7993z;
                    break;
                case InstallReferrerClient.InstallReferrerResponse.PERMISSION_ERROR:
                    i5 = l.f7985r;
                    break;
                case BuildConfig.SDK_ENGAGEMENT_PUSH_MAX_HISTORY:
                    i5 = l.f7982o;
                    break;
                case 6:
                case 7:
                    i5 = l.f7991x;
                    break;
                case 8:
                    i5 = l.f7988u;
                    break;
                case 9:
                    i5 = l.f7974g;
                    break;
                case 10:
                    i5 = l.f7967B;
                    break;
                case 11:
                    i5 = l.f7966A;
                    break;
                case 12:
                    i5 = l.f7973f;
                    break;
                case 13:
                    i5 = l.f7970c;
                    break;
                case 14:
                    i5 = l.f7971d;
                    break;
                case 15:
                    i5 = l.f7972e;
                    break;
                case 16:
                    N0();
                    return;
                default:
                    return;
            }
        } else {
            return;
        }
        H0(i5);
    }

    @Override
    public void C(boolean z4, String str, String str2) {
        ProgressDialog progressDialog = this.f4349K;
        if (progressDialog != null) {
            progressDialog.dismiss();
        }
        if (z4) {
            P0(null);
            return;
        }
        if ("NO_RESPONSE".equals(str)) {
            str2 = getString(l.f7975h);
        }
        new AlertDialog.Builder(this).setMessage(str2).setPositiveButton(l.f7989v, new c(str2)).create().show();
    }

    protected void I0() {
        this.f4342D = (ImageView) findViewById(i.f7956c);
        this.f4343E = (LivenessView) findViewById(i.f7955b);
        this.f4344F = (ImageView) findViewById(i.f7959f);
        this.f4345G = (TextView) findViewById(i.f7960g);
        this.f4346H = (TextView) findViewById(i.f7958e);
        this.f4348J = findViewById(i.f7957d);
        this.f4347I = (CheckBox) findViewById(i.f7961h);
        findViewById(i.f7954a).setOnClickListener(new a());
        this.f4347I.setChecked(this.f4343E.h());
        this.f4347I.setOnCheckedChangeListener(new b());
    }

    public android.graphics.drawable.AnimationDrawable J0(b.EnumC0605c r3) {
        throw new UnsupportedOperationException("Method not decompiled: aai.liveness.activity.LivenessActivity.J0(b.c):android.graphics.drawable.AnimationDrawable");
    }

    @Override
    protected void attachBaseContext(Context context) {
        Locale locale = new Locale("es");
        Locale.setDefault(locale);
        Configuration configuration = new Configuration(context.getResources().getConfiguration());
        if (Build.VERSION.SDK_INT >= 24) {
            configuration.setLocale(locale);
        } else {
            configuration.locale = locale;
        }
        super.attachBaseContext(context.createConfigurationContext(configuration));
    }

    @Override
    public void c() {
        ProgressDialog progressDialog = this.f4349K;
        if (progressDialog != null) {
            progressDialog.dismiss();
        }
        ProgressDialog progressDialog2 = new ProgressDialog(this);
        this.f4349K = progressDialog2;
        progressDialog2.setMessage(getString(l.f7968a));
        this.f4349K.setCanceledOnTouchOutside(false);
        this.f4349K.show();
    }

    @Override
    public void i(EnumC0603a enumC0603a, EnumC0605c enumC0605c) {
        int i5;
        int i6;
        int[] iArr = f.f4358c;
        int i7 = iArr[enumC0603a.ordinal()];
        if (i7 == 5) {
            i5 = l.f7967B;
        } else {
            if (i7 != 6) {
                int i8 = iArr[enumC0603a.ordinal()];
                String str = null;
                if (i8 != 1) {
                    if (i8 == 2) {
                        i6 = l.f7981n;
                    } else {
                        if (i8 != 3) {
                            if (i8 == 4) {
                                i6 = l.f7979l;
                            }
                            h.q(str);
                            M0();
                            return;
                        }
                        i6 = l.f7980m;
                    }
                    str = getString(i6);
                    h.q(str);
                    M0();
                    return;
                }
                int i9 = f.f4356a[enumC0605c.ordinal()];
                if (i9 != 1) {
                    if (i9 == 2 || i9 == 3) {
                        i6 = l.f7977j;
                    }
                    h.q(str);
                    M0();
                    return;
                }
                i6 = l.f7978k;
                str = getString(i6);
                h.q(str);
                M0();
                return;
            }
            i5 = l.f7966A;
        }
        H0(i5);
    }

    @Override
    public void o() {
        this.f4343E.f(new d());
    }

    @Override
    protected void onCreate(Bundle bundle) {
        super.onCreate(bundle);
        Configuration configuration = getResources().getConfiguration();
        Locale locale = new Locale("es");
        if (Build.VERSION.SDK_INT >= 24) {
            configuration.setLocale(locale);
        } else {
            configuration.locale = locale;
        }
        getResources().updateConfiguration(configuration, getResources().getDisplayMetrics());
        setContentView(j.f7962a);
        AbstractC0772h.a(this, 255);
        I0();
        K0();
        if (!g.p() || v0()) {
            return;
        }
        z0();
    }

    @Override
    protected void onDestroy() {
        this.f4343E.j();
        this.f4341C.clear();
        super.onDestroy();
    }

    @Override
    protected void onPause() {
        ProgressDialog progressDialog = this.f4349K;
        if (progressDialog != null) {
            progressDialog.dismiss();
        }
        this.f4343E.k();
        super.onPause();
    }

    @Override
    protected void onResume() {
        O0();
        if (v0()) {
            this.f4343E.l();
        }
        super.onResume();
    }

    @Override
    public void t(long j5) {
        int i5 = (int) (j5 / 1000);
        this.f4346H.setText(i5 + "s");
    }

    @Override
    public void u() {
        L0();
        N0();
        this.f4346H.setBackgroundResource(b.h.f7953d);
    }

    @Override
    protected String[] w0() {
        return new String[]{"android.permission.CAMERA"};
    }

    @Override
    protected void x0() {
    }

    @Override
    public void y(EnumC0607e enumC0607e) {
        P0(enumC0607e);
    }

    @Override
    protected void y0() {
        new AlertDialog.Builder(this).setMessage(getString(l.f7986s)).setPositiveButton(getString(l.f7989v), new e()).create().show();
    }
}