正在查看: klikUMKM v2.0.1 应用的 LivenessActivity.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: klikUMKM v2.0.1 应用的 LivenessActivity.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package aai.liveness.activity;
import a3d20250402.a0;
import a3d20250402.f;
import a3d20250402.k0;
import a3d20250402.o0o00;
import a3d20250402.p0;
import a3d20250402.x;
import aai.liveness.LivenessView;
import ai.advance.core.PermissionActivity;
import android.app.ProgressDialog;
import android.graphics.drawable.AnimationDrawable;
import android.hardware.SensorManager;
import android.os.Bundle;
import android.os.Handler;
import android.util.SparseArray;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import android.widget.CheckBox;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.appcompat.app.g;
import androidx.media.o;
import bb.e;
import c.b;
import c.d;
import com.google.firebase.encoders.json.BuildConfig;
import d.c;
import e.a;
import h4.m;
import java.util.ArrayList;
import java.util.Iterator;
public class LivenessActivity extends PermissionActivity implements a {
public static final int P = 0;
public SparseArray G;
public LivenessView H;
public ImageView I;
public TextView J;
public TextView K;
public CheckBox L;
public View M;
public ProgressDialog N;
public View O;
@Override
public final String[] H() {
return new String[]{"android.permission.CAMERA"};
}
@Override
public final void I() {
m mVar = new m(this);
String string = getString(R$string.liveness_no_camera_permission);
g gVar = (g) mVar.f8887c;
gVar.f476f = string;
String string2 = getString(R$string.liveness_perform);
c cVar = new c(this);
gVar.f477g = string2;
gVar.f478h = cVar;
mVar.f().show();
}
public final void J(int i10) {
this.J.setText(i10);
}
public final void K(d dVar) {
this.H.a.getClass();
if (dVar != null) {
switch (d.d.f7781b[dVar.ordinal()]) {
case 1:
J(R$string.liveness_no_people_face);
break;
case 2:
J(R$string.liveness_tip_move_closer);
break;
case 3:
J(R$string.liveness_tip_move_furthre);
break;
case 4:
J(R$string.liveness_move_face_center);
break;
case 5:
J(R$string.liveness_frontal);
break;
case 6:
case 7:
J(R$string.liveness_still);
break;
case 8:
J(R$string.liveness_open_eyes);
break;
case 9:
J(R$string.liveness_face_occ);
break;
case 10:
J(R$string.liveness_weak_light);
break;
case 11:
J(R$string.liveness_too_light);
break;
case 12:
case 13:
case 14:
case 15:
J(R$string.liveness_face_move);
break;
case 16:
J(R$string.liveness_blink);
break;
case 17:
b currentDetectionType = this.H.getCurrentDetectionType();
if (currentDetectionType != null) {
int[] iArr = d.d.a;
int i10 = iArr[currentDetectionType.ordinal()];
J(i10 != 1 ? i10 != 2 ? i10 != 3 ? 0 : R$string.liveness_blink : R$string.liveness_mouse : R$string.liveness_pos_raw);
int i11 = iArr[currentDetectionType.ordinal()];
int i12 = i11 != 1 ? i11 != 2 ? i11 != 3 ? -1 : R$drawable.anim_frame_blink : R$drawable.anim_frame_open_mouse : R$drawable.anim_frame_turn_head;
AnimationDrawable animationDrawable = (AnimationDrawable) this.G.get(i12);
if (animationDrawable == null) {
animationDrawable = (AnimationDrawable) getResources().getDrawable(i12);
this.G.put(i12, animationDrawable);
}
this.I.setImageDrawable(animationDrawable);
animationDrawable.start();
break;
}
break;
case 18:
J(R$string.liveness_large_yaw);
break;
case 19:
J(R$string.liveness_multi_faces);
break;
}
}
}
@Override
public final void d() {
ProgressDialog progressDialog = this.N;
if (progressDialog != null) {
progressDialog.dismiss();
}
ProgressDialog progressDialog2 = new ProgressDialog(this);
this.N = progressDialog2;
progressDialog2.setMessage(getString(R$string.liveness_auth_check));
this.N.setCanceledOnTouchOutside(false);
this.N.show();
}
@Override
public final void g(c.a aVar, b bVar) {
int[] iArr = d.d.f7782c;
int i10 = iArr[aVar.ordinal()];
if (i10 == 5) {
J(R$string.liveness_weak_light);
return;
}
if (i10 == 6) {
J(R$string.liveness_too_light);
return;
}
int i11 = iArr[aVar.ordinal()];
String str = null;
if (i11 == 1) {
int i12 = d.d.a[bVar.ordinal()];
if (i12 == 1) {
str = getString(R$string.liveness_failed_reason_facemissing_pos_yaw);
} else if (i12 == 2 || i12 == 3) {
str = getString(R$string.liveness_failed_reason_facemissing_blink_mouth);
}
} else if (i11 == 2) {
str = getString(R$string.liveness_failed_reason_timeout);
} else if (i11 == 3) {
str = getString(R$string.liveness_failed_reason_multipleface);
} else if (i11 == 4) {
str = getString(R$string.liveness_failed_reason_muchaction);
}
a0.m(str);
setResult(-1);
finish();
}
@Override
public final void j(d dVar) {
K(dVar);
}
@Override
public final void l() {
LivenessView livenessView = this.H;
o oVar = new o(11, this);
livenessView.getClass();
f fVar = new f(7, oVar);
o0o00 o0o00Var = livenessView.a;
if (o0o00Var.B()) {
LivenessActivity livenessActivity = (LivenessActivity) ((o) fVar.f149b).f4990b;
livenessActivity.M.setVisibility(0);
livenessActivity.K.setVisibility(4);
livenessActivity.H.setVisibility(4);
livenessActivity.L.setVisibility(4);
livenessActivity.I.setVisibility(4);
livenessActivity.J.setVisibility(4);
livenessActivity.O.setVisibility(0);
new Thread(new k0(o0o00Var, fVar, 0)).start();
}
}
@Override
public final void onCreate(Bundle bundle) {
super.onCreate(bundle);
setContentView(R$layout.activity_liveness);
Window window = getWindow();
WindowManager.LayoutParams attributes = window.getAttributes();
attributes.screenBrightness = 255 / 255.0f;
window.setAttributes(attributes);
this.H = (LivenessView) findViewById(R$id.liveness_view);
this.I = (ImageView) findViewById(R$id.tip_image_view);
this.J = (TextView) findViewById(R$id.tip_text_view);
this.K = (TextView) findViewById(R$id.timer_text_view_camera_activity);
this.M = findViewById(R$id.progress_layout);
this.L = (CheckBox) findViewById(R$id.voice_check_box);
View findViewById = findViewById(R$id.back_view_camera_activity);
this.O = findViewById(R$id.text_view_loading);
findViewById.setOnClickListener(new androidx.appcompat.app.c(6, this));
this.L.setChecked(this.H.a.f376x);
this.L.setOnCheckedChangeListener(new d.a(this));
this.G = new SparseArray();
this.H.setLivenssCallback(this);
if (!p0.f204l || G() || G()) {
return;
}
l2.d.f(this, new String[]{"android.permission.CAMERA"}, 1991);
}
@Override
public final void onDestroy() {
SensorManager sensorManager;
LivenessView livenessView = this.H;
o0o00 o0o00Var = livenessView.a;
synchronized (o0o00Var) {
try {
o0o00Var.H = null;
o0o00Var.G();
o0o00Var.I();
Handler handler = o0o00Var.I;
if (handler != null) {
handler.removeCallbacksAndMessages(null);
o0o00Var.I = null;
}
ArrayList arrayList = o0o00Var.A;
if (arrayList != null && !arrayList.isEmpty()) {
Iterator it = o0o00Var.A.iterator();
while (it.hasNext()) {
e eVar = (e) it.next();
eVar.getClass();
try {
if (eVar.f5585c != null && (sensorManager = eVar.f5584b) != null) {
sensorManager.unregisterListener(eVar);
}
} catch (Exception unused) {
}
eVar.f5588f = new StringBuilder();
eVar.f5589g = null;
}
}
ArrayList arrayList2 = o0o00Var.J;
if (arrayList2 != null) {
arrayList2.clear();
}
} catch (Throwable th) {
throw th;
}
}
livenessView.a("destroy");
this.G.clear();
super.onDestroy();
}
@Override
public final void onPause() {
ProgressDialog progressDialog = this.N;
if (progressDialog != null) {
progressDialog.dismiss();
}
this.H.d();
super.onPause();
}
@Override
public final void onResume() {
int i10 = 0;
x xVar = this.H.a.D;
if (xVar == null || !xVar.H) {
this.H.setVisibility(0);
this.J.setVisibility(0);
this.I.setVisibility(0);
this.K.setText(BuildConfig.FLAVOR);
this.K.setBackgroundResource(0);
this.K.setVisibility(0);
this.L.setVisibility(4);
this.I.setImageDrawable(null);
this.M.setVisibility(4);
this.O.setVisibility(4);
if (G()) {
LivenessView livenessView = this.H;
x xVar2 = livenessView.a.D;
if (xVar2 == null || !xVar2.H) {
o0o00 o0o00Var = livenessView.a;
o0o00Var.C = false;
ArrayList arrayList = o0o00Var.J;
if (arrayList == null) {
a aVar = o0o00Var.H;
synchronized (o0o00Var) {
try {
ArrayList arrayList2 = p0.f205m;
if (arrayList2 == null || arrayList2.isEmpty()) {
o0o00Var.E(aVar, b.BLINK, b.POS_YAW);
} else {
b[] bVarArr = new b[arrayList2.size()];
while (true) {
ArrayList arrayList3 = p0.f205m;
if (i10 >= arrayList3.size()) {
break;
}
bVarArr[i10] = (b) arrayList3.get(i10);
i10++;
}
o0o00Var.E(aVar, bVarArr);
}
} catch (Throwable th) {
throw th;
}
}
} else {
b[] bVarArr2 = new b[arrayList.size()];
o0o00Var.J.toArray(bVarArr2);
o0o00Var.E(o0o00Var.H, bVarArr2);
}
o0o00Var.z();
}
}
}
super.onResume();
}
@Override
public final void r(long j7) {
int i10 = (int) (j7 / 1000);
this.K.setText(i10 + "s");
}
@Override
public final void w(String str, String str2, boolean z10) {
ProgressDialog progressDialog = this.N;
if (progressDialog != null) {
progressDialog.dismiss();
}
if (z10) {
K(null);
return;
}
if ("NO_RESPONSE".equals(str)) {
str2 = getString(R$string.liveness_failed_reason_auth_failed);
}
m mVar = new m(this);
g gVar = (g) mVar.f8887c;
gVar.f476f = str2;
int i10 = R$string.liveness_perform;
d.b bVar = new d.b(this, str2);
gVar.f477g = gVar.a.getText(i10);
gVar.f478h = bVar;
mVar.f().show();
}
}