导航菜单

页面标题

页面副标题

Credmex v3.12.2 - CaptureActivity.java 源代码

正在查看: Credmex v3.12.2 应用的 CaptureActivity.java JAVA 源代码文件

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


package com.credmex.activity;

import android.annotation.SuppressLint;
import android.os.Bundle;
import android.view.MotionEvent;
import android.view.SurfaceView;
import android.view.View;
import androidx.annotation.LayoutRes;
import androidx.annotation.NonNull;
import androidx.core.content.ContextCompat;
import com.credmex.commom.CommonActivity;
import com.king.zxing.CaptureHelper;
import com.king.zxing.OnCaptureCallback;
import com.king.zxing.ViewfinderView;
import com.king.zxing.camera.CameraManager;
import com.veda.supertoolkit.lifecycle.LifecycleEvent;
import io.reactivex.disposables.Disposable;
import kotlin.Deprecated;
import kotlin.Metadata;
import kotlin.jvm.internal.Intrinsics;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

@Metadata
public class CaptureActivity extends CommonActivity implements OnCaptureCallback {
    private SurfaceView D;

    @Nullable
    private ViewfinderView E;

    @Nullable
    private View F;
    public CaptureHelper mCaptureHelper;

    public final void b0() {
        setResult(2002);
        finish();
    }

    private final void d0() {
        if (ContextCompat.checkSelfPermission(this, "android.permission.CAMERA") != 0) {
            requestCameraPermission(new CommonActivity.CameraPermissionCallback() {
                @Override
                public void a() {
                    CaptureActivity.this.b0();
                }

                @Override
                public void b() {
                    CaptureActivity.this.b0();
                }

                @Override
                public void c() {
                    CaptureActivity.this.c0();
                }
            });
        }
    }

    @Deprecated
    @Nullable
    public final CameraManager getCameraManager() {
        return getMCaptureHelper().j();
    }

    @Nullable
    public final CaptureHelper getCaptureHelper() {
        return getMCaptureHelper();
    }

    public int getIvTorchId() {
        return 0;
    }

    @Override
    public int getLayoutID() {
        return 2131558798;
    }

    @NotNull
    public final CaptureHelper getMCaptureHelper() {
        CaptureHelper captureHelper = this.mCaptureHelper;
        if (captureHelper != null) {
            return captureHelper;
        }
        Intrinsics.r("mCaptureHelper");
        return null;
    }

    public int getSurfaceViewId() {
        return 2131362893;
    }

    public int getViewfinderViewId() {
        return 2131363289;
    }

    public final void initCaptureHelper() {
        SurfaceView surfaceView = this.D;
        if (surfaceView == null) {
            Intrinsics.r("surfaceView");
            surfaceView = null;
        }
        setMCaptureHelper(new CaptureHelper(this, surfaceView, this.E, this.F));
        getMCaptureHelper().B(this);
    }

    public final void initUI() {
        View findViewById = findViewById(getSurfaceViewId());
        Intrinsics.checkNotNullExpressionValue(findViewById, "findViewById(getSurfaceViewId())");
        this.D = (SurfaceView) findViewById;
        int viewfinderViewId = getViewfinderViewId();
        if (viewfinderViewId != 0) {
            this.E = findViewById(viewfinderViewId);
        }
        int ivTorchId = getIvTorchId();
        if (ivTorchId != 0) {
            View findViewById2 = findViewById(ivTorchId);
            this.F = findViewById2;
            if (findViewById2 != null) {
                findViewById2.setVisibility(4);
            }
        }
        initCaptureHelper();
    }

    public boolean isContentView(@LayoutRes int i2) {
        return true;
    }

    @Override
    protected void onCreate(@Nullable Bundle bundle) {
        super.onCreate(bundle);
        int layoutID = getLayoutID();
        if (isContentView(layoutID)) {
            setContentView(layoutID);
        }
        d0();
        initUI();
        getMCaptureHelper().s();
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        getMCaptureHelper().t();
    }

    @Override
    protected void onPause() {
        super.onPause();
        getMCaptureHelper().u();
    }

    public boolean onResultCallback(@Nullable String str) {
        return false;
    }

    @Override
    protected void onResume() {
        super.onResume();
        getMCaptureHelper().x();
    }

    public boolean onTouchEvent(@Nullable MotionEvent motionEvent) {
        getMCaptureHelper().y(motionEvent);
        return super/*com.veda.android.bananalibrary.infrastructure.BaseActivity*/.onTouchEvent(motionEvent);
    }

    @Override
    @SuppressLint({"CheckResult"})
    public Disposable runOnCreated(@NonNull Runnable runnable) {
        return com.veda.supertoolkit.lifecycle.i.a(this, runnable);
    }

    @Override
    @SuppressLint({"CheckResult"})
    public Disposable runOnDestroy(@NonNull Runnable runnable) {
        return com.veda.supertoolkit.lifecycle.i.b(this, runnable);
    }

    @Override
    @SuppressLint({"CheckResult"})
    public Disposable runOnEvent(@NonNull LifecycleEvent lifecycleEvent, @androidx.annotation.Nullable Runnable runnable) {
        return com.veda.supertoolkit.lifecycle.i.c(this, lifecycleEvent, runnable);
    }

    public final void setMCaptureHelper(@NotNull CaptureHelper captureHelper) {
        Intrinsics.checkNotNullParameter(captureHelper, "<set-?>");
        this.mCaptureHelper = captureHelper;
    }

    public final void c0() {
    }
}