正在查看: Easycash v3.75.13 应用的 LiveCheckPreviewActivity.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: Easycash v3.75.13 应用的 LiveCheckPreviewActivity.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package com.fintopia.lender.module.livecheck;
import android.annotation.SuppressLint;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.View;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import butterknife.BindView;
import com.fintopia.lender.R;
import com.fintopia.lender.module.baseui.LenderCommonActivity;
import com.fintopia.lender.module.launch.AppGeneralConfigUtils;
import com.fintopia.lender.module.livecheck.adapter.AuthStepTipsAdapter;
import com.fintopia.lender.module.livecheck.model.AuthStepTipsInfo;
import com.fintopia.lender.module.network.ILenderApiRoutes;
import com.fintopia.lender.module.utils.AuthStepRationale;
import com.fintopia.livenessdetection.LivenessDetectionManager;
import com.fintopia.livenessdetection.facev5.FaceV5Manager;
import com.fintopia.livenessdetection.facev5.models.LiveDetectionArgs;
import com.fintopia.livenessdetection.models.LivenessConfig;
import com.lingyue.idnbaselib.framework.lifecycle.LifecycleEvent;
import com.lingyue.idnbaselib.framework.lifecycle.m;
import com.lingyue.idnbaselib.model.IdnObserver;
import com.lingyue.idnbaselib.model.live.FaceIdCard;
import com.lingyue.idnbaselib.model.live.LiveDetectionEvent;
import com.lingyue.idnbaselib.model.live.LivingActionNumber;
import com.lingyue.idnbaselib.model.live.VerifyLivenessMethodResponse;
import com.lingyue.supertoolkit.permissiontools.permission.PermissionDenied;
import com.lingyue.supertoolkit.permissiontools.permission.PermissionGranted;
import com.lingyue.supertoolkit.permissiontools.permission.PermissionHelper;
import com.lingyue.supertoolkit.widgets.BaseUtils;
import com.sensorsdata.analytics.android.autotrack.aop.SensorsDataAutoTrackHelper;
import com.sensorsdata.analytics.android.sdk.SensorsDataInstrumented;
import com.veda.android.bananalibrary.infrastructure.BaseActivity;
import com.yangqianguan.statistics.AutoTrackHelper;
import io.reactivex.Observable;
import io.reactivex.disposables.Disposable;
import java.util.ArrayList;
import org.greenrobot.eventbus.Subscribe;
import org.greenrobot.eventbus.ThreadMode;
@AuthStepRationale
public class LiveCheckPreviewActivity extends LenderCommonActivity {
@BindView(5370)
RecyclerView rvStep;
private PermissionHelper f82u = new PermissionHelper();
private LiveDetectionArgs f83v;
private AuthStepTipsAdapter f84w;
ArrayList<AuthStepTipsInfo> f85x;
private int O() {
LivingActionNumber k = AppGeneralConfigUtils.o().k();
int i = this.f83v.purpose;
return (i == 0 || 5 == i || 6 == i) ? k.auth : k.others;
}
private void P() {
if (this.f85x == null) {
this.f85x = new ArrayList<>(4);
}
this.f85x.clear();
this.f85x.add(new AuthStepTipsInfo(getResources().getString(R.string.ec_live_no_hat), R.drawable.base_ic_no_hat));
this.f85x.add(new AuthStepTipsInfo(getResources().getString(R.string.ec_live_no_glasses), R.drawable.base_ic_no_glasses));
this.f85x.add(new AuthStepTipsInfo(getResources().getString(R.string.ec_live_no_dark), R.drawable.base_ic_no_dark));
this.f85x.add(new AuthStepTipsInfo(getResources().getString(R.string.ec_live_hold_phone_vertical), R.drawable.base_ic_vertical));
}
private boolean Q() {
return this.f83v.purpose == 0;
}
@SensorsDataInstrumented
public void R(View view) {
if (BaseUtils.l()) {
SensorsDataAutoTrackHelper.trackViewOnClick(view);
AutoTrackHelper.trackViewOnClick(view);
} else {
this.f82u.requestPermissions(this, new String[]{"android.permission.CAMERA"});
SensorsDataAutoTrackHelper.trackViewOnClick(view);
AutoTrackHelper.trackViewOnClick(view);
}
}
public Observable S() {
return ((ILenderApiRoutes) this.apiHelper.a()).g(this.f83v.mobilePhone);
}
public void T(VerifyLivenessMethodResponse verifyLivenessMethodResponse) {
dismissLoadingDialog();
LivenessDetectionManager.b(this, new LivenessConfig.Builder().n(verifyLivenessMethodResponse.body.source).j(O()).p(verifyLivenessMethodResponse.body.timeout).l(new FaceV5Manager.FaceV5ManagerApi() {
@Override
public final Observable a() {
Observable S;
S = LiveCheckPreviewActivity.this.S();
return S;
}
}).i(), new LivenessDetectionManager.LivenessDetectionManagerListener() {
@Override
public void b(@NonNull FaceIdCard faceIdCard) {
?? r0 = LiveCheckPreviewActivity.this;
LiveRecognitionResultActivity.startRecognitionResultActivity(r0, faceIdCard, ((LiveCheckPreviewActivity) r0).f83v);
}
@Override
public void a(String str, String str2, String str3) {
}
});
}
private void U() {
showLoadingDialog();
((ILenderApiRoutes) this.apiHelper.a()).Y0(this.f83v.mobilePhone, Q()).a(new IdnObserver<VerifyLivenessMethodResponse>(this) {
public void onSuccess(VerifyLivenessMethodResponse verifyLivenessMethodResponse) {
LiveCheckPreviewActivity.this.T(verifyLivenessMethodResponse);
}
});
}
@PermissionDenied("android.permission.CAMERA")
private void cameraPermissionDenied() {
BaseUtils.p(this, getResources().getString(R.string.lender_permission_denied_camera));
}
@PermissionGranted({"android.permission.CAMERA"})
private void cameraPermissionGranted() {
U();
}
public static void startECLiveCheckPreviewActivity(@NonNull Activity activity, @NonNull LiveDetectionArgs liveDetectionArgs) {
if (TextUtils.isEmpty(liveDetectionArgs.mobilePhone)) {
return;
}
Intent intent = new Intent(activity, (Class<?>) LiveCheckPreviewActivity.class);
intent.putExtra(LiveDetectionArgs.TAG, liveDetectionArgs);
activity.startActivity(intent);
}
@Override
protected void A() {
((BaseActivity) this).f.setBackgroundColor(0);
findViewById(R.id.btn_start_recognition).setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
LiveCheckPreviewActivity.this.R(view);
}
});
P();
this.f84w = new AuthStepTipsAdapter(this, this.f85x);
this.rvStep.setLayoutManager(new LinearLayoutManager(this));
this.rvStep.setAdapter(this.f84w);
}
@Override
protected void G(@NonNull Bundle bundle) {
super.G(bundle);
bundle.putParcelable(LiveDetectionArgs.TAG, this.f83v);
}
@Override
public int getLayoutID() {
return R.layout.layout_lender_liveness_recognition_preview;
}
@Override
protected void onActivityResult(int i, int i2, Intent intent) {
super.onActivityResult(i, i2, intent);
LivenessDetectionManager.a(this, i, i2, intent, new LivenessDetectionManager.LivenessDetectionManagerListener() {
@Override
public void b(@NonNull FaceIdCard faceIdCard) {
?? r0 = LiveCheckPreviewActivity.this;
LiveRecognitionResultActivity.startRecognitionResultActivity(r0, faceIdCard, ((LiveCheckPreviewActivity) r0).f83v);
}
@Override
public void a(String str, String str2, String str3) {
}
});
}
@Subscribe(threadMode = ThreadMode.MAIN)
public void onUploadEvent(LiveDetectionEvent liveDetectionEvent) {
finish();
}
@Override
public Disposable runOnActiveEvent(Runnable runnable) {
return m.a(this, runnable);
}
@Override
@SuppressLint({"CheckResult"})
public Disposable runOnCreated(@NonNull Runnable runnable) {
return m.b(this, runnable);
}
@Override
@SuppressLint({"CheckResult"})
public Disposable runOnDestroy(@NonNull Runnable runnable) {
return m.c(this, runnable);
}
@Override
@SuppressLint({"CheckResult"})
public Disposable runOnEvent(@NonNull LifecycleEvent lifecycleEvent, @Nullable Runnable runnable) {
return m.d(this, lifecycleEvent, runnable);
}
@Override
public Disposable runOnEvents(@NonNull LifecycleEvent[] lifecycleEventArr, @Nullable Runnable runnable) {
return m.e(this, lifecycleEventArr, runnable);
}
@Override
protected void y(@NonNull Bundle bundle) {
super.y(bundle);
this.f83v = (LiveDetectionArgs) bundle.getParcelable(LiveDetectionArgs.TAG);
}
}