正在查看: moonshot.企业版 v8.14.46 应用的 CaptureActivity.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: moonshot.企业版 v8.14.46 应用的 CaptureActivity.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package com.yzq.zxinglibrary.android;
import android.app.AlertDialog;
import android.content.Context;
import android.content.Intent;
import android.content.pm.FeatureInfo;
import android.content.pm.PackageManager;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.view.SurfaceHolder;
import android.view.SurfaceView;
import android.view.View;
import android.view.Window;
import android.widget.TextView;
import android.widget.Toast;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.AppCompatImageView;
import androidx.appcompat.widget.LinearLayoutCompat;
import c8sKPHc73aST6XPVbBtC.hX79Ew6mJdJrSjlkdwnl.zSFvmU2XOpXZrEfUxlHp.抵蔩麄;
import com.google.zxing.Result;
import com.yzq.zxinglibrary.R;
import com.yzq.zxinglibrary.view.ViewfinderView;
import java.io.IOException;
import kp1AiJpjqJHu1Tcnj96z.jFeM6Xy8JoF5dVaVZLuE.zSFvmU2XOpXZrEfUxlHp.IRnPlw4EC2IclzeuBbCK.C3884;
import kp1AiJpjqJHu1Tcnj96z.jFeM6Xy8JoF5dVaVZLuE.zSFvmU2XOpXZrEfUxlHp.IRnPlw4EC2IclzeuBbCK.C3886;
import kp1AiJpjqJHu1Tcnj96z.jFeM6Xy8JoF5dVaVZLuE.zSFvmU2XOpXZrEfUxlHp.IRnPlw4EC2IclzeuBbCK.InterfaceC3883;
import kp1AiJpjqJHu1Tcnj96z.jFeM6Xy8JoF5dVaVZLuE.zSFvmU2XOpXZrEfUxlHp.c8sKPHc73aST6XPVbBtC.C3889;
import kp1AiJpjqJHu1Tcnj96z.jFeM6Xy8JoF5dVaVZLuE.zSFvmU2XOpXZrEfUxlHp.c8sKPHc73aST6XPVbBtC.C3890;
import kp1AiJpjqJHu1Tcnj96z.jFeM6Xy8JoF5dVaVZLuE.zSFvmU2XOpXZrEfUxlHp.c8sKPHc73aST6XPVbBtC.DialogInterfaceOnClickListenerC3888;
import kp1AiJpjqJHu1Tcnj96z.jFeM6Xy8JoF5dVaVZLuE.zSFvmU2XOpXZrEfUxlHp.c8sKPHc73aST6XPVbBtC.HandlerC3894;
import kp1AiJpjqJHu1Tcnj96z.jFeM6Xy8JoF5dVaVZLuE.zSFvmU2XOpXZrEfUxlHp.hX79Ew6mJdJrSjlkdwnl.C3903;
import kp1AiJpjqJHu1Tcnj96z.jFeM6Xy8JoF5dVaVZLuE.zSFvmU2XOpXZrEfUxlHp.k52vou7xlegBsU3qaLxq.C3905;
import kp1AiJpjqJHu1Tcnj96z.jFeM6Xy8JoF5dVaVZLuE.zSFvmU2XOpXZrEfUxlHp.kp1AiJpjqJHu1Tcnj96z.C3906;
public class CaptureActivity extends AppCompatActivity implements SurfaceHolder.Callback, View.OnClickListener {
private static final String f7661 = CaptureActivity.class.getSimpleName();
private SurfaceHolder f7662;
private C3906 f7663;
private AppCompatImageView f7664;
private LinearLayoutCompat f7665;
private ViewfinderView f7666;
private TextView f7667;
private LinearLayoutCompat f7668;
private AppCompatImageView f7669;
private boolean f7670;
private C3889 f7671;
public C3903 f7672;
private C3890 f7673;
private LinearLayoutCompat f7674;
private HandlerC3894 f7675;
private SurfaceView f7676;
public class C2178 implements InterfaceC3883 {
public C2178() {
}
@Override
public void mo8109() {
Toast.makeText((Context) CaptureActivity.this, R.string.scan_failed_tip, 0).show();
}
@Override
public void mo8110(Result result) {
CaptureActivity.this.m8108(result);
}
}
static {
抵蔩麄.短睍揊拣渨(true);
}
private void m8099(View view, boolean z) {
if (z) {
view.setVisibility(0);
} else {
view.setVisibility(8);
}
}
private void m8100(SurfaceHolder surfaceHolder) {
if (surfaceHolder == null) {
throw new IllegalStateException("No SurfaceHolder provided");
}
if (this.f7663.m10730()) {
return;
}
try {
this.f7663.m10733(surfaceHolder);
if (this.f7675 == null) {
this.f7675 = new HandlerC3894(this, this.f7663);
}
} catch (IOException unused) {
m8103();
} catch (RuntimeException unused2) {
m8103();
}
}
public static boolean m8101(PackageManager packageManager) {
FeatureInfo[] systemAvailableFeatures;
if (packageManager != null && (systemAvailableFeatures = packageManager.getSystemAvailableFeatures()) != null) {
for (FeatureInfo featureInfo : systemAvailableFeatures) {
if (featureInfo != null && "android.hardware.camera.flash".equals(featureInfo.name)) {
return true;
}
}
}
return false;
}
private void m8102() {
SurfaceView surfaceView = (SurfaceView) findViewById(R.id.preview_view);
this.f7676 = surfaceView;
surfaceView.setOnClickListener(this);
ViewfinderView viewfinderView = (ViewfinderView) findViewById(R.id.viewfinder_view);
this.f7666 = viewfinderView;
viewfinderView.setZxingConfig(this.f7672);
AppCompatImageView findViewById = findViewById(R.id.backIv);
this.f7664 = findViewById;
findViewById.setOnClickListener(this);
this.f7669 = findViewById(R.id.flashLightIv);
this.f7667 = (TextView) findViewById(R.id.flashLightTv);
LinearLayoutCompat findViewById2 = findViewById(R.id.flashLightLayout);
this.f7668 = findViewById2;
findViewById2.setOnClickListener(this);
LinearLayoutCompat findViewById3 = findViewById(R.id.albumLayout);
this.f7674 = findViewById3;
findViewById3.setOnClickListener(this);
LinearLayoutCompat findViewById4 = findViewById(R.id.bottomLayout);
this.f7665 = findViewById4;
m8099(findViewById4, this.f7672.m10705());
m8099(this.f7668, this.f7672.m10722());
m8099(this.f7674, this.f7672.m10706());
if (m8101(getPackageManager())) {
this.f7668.setVisibility(0);
} else {
this.f7668.setVisibility(8);
}
}
private void m8103() {
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setTitle("扫一扫");
builder.setMessage(getString(R.string.msg_camera_framework_bug));
builder.setPositiveButton(R.string.button_ok, new DialogInterfaceOnClickListenerC3888(this));
builder.setOnCancelListener(new DialogInterfaceOnClickListenerC3888(this));
builder.show();
}
public Handler getHandler() {
return this.f7675;
}
public void onActivityResult(int i, int i2, Intent intent) {
super/*androidx.fragment.app.FragmentActivity*/.onActivityResult(i, i2, intent);
if (i == 10 && i2 == -1) {
new C3886(C3884.m10682(this, intent.getData()), new C2178()).run();
}
}
@Override
public void onClick(View view) {
int id = view.getId();
if (id == R.id.flashLightLayout) {
this.f7663.m10738(this.f7675);
return;
}
if (id != R.id.albumLayout) {
if (id == R.id.backIv) {
finish();
}
} else {
Intent intent = new Intent();
intent.setAction("android.intent.action.PICK");
intent.setType("image/*");
startActivityForResult(intent, 10);
}
}
public void onCreate(Bundle bundle) {
super/*androidx.fragment.app.FragmentActivity*/.onCreate(bundle);
Window window = getWindow();
window.addFlags(128);
if (Build.VERSION.SDK_INT >= 21) {
window.setStatusBarColor(-16777216);
}
try {
this.f7672 = (C3903) getIntent().getExtras().get(C3905.f12811);
} catch (Exception e) {
e.toString();
}
if (this.f7672 == null) {
this.f7672 = new C3903();
}
setContentView(R.layout.activity_capture);
m8102();
this.f7670 = false;
this.f7673 = new C3890(this);
C3889 c3889 = new C3889(this);
this.f7671 = c3889;
c3889.m10691(this.f7672.m10710());
this.f7671.m10692(this.f7672.m10718());
}
public void onDestroy() {
this.f7673.m10699();
this.f7666.m8121();
super.onDestroy();
}
public void onPause() {
HandlerC3894 handlerC3894 = this.f7675;
if (handlerC3894 != null) {
handlerC3894.m10703();
this.f7675 = null;
}
this.f7673.m10700();
this.f7671.close();
this.f7663.m10734();
if (!this.f7670) {
this.f7662.removeCallback(this);
}
super/*androidx.fragment.app.FragmentActivity*/.onPause();
}
public void onResume() {
super/*androidx.fragment.app.FragmentActivity*/.onResume();
C3906 c3906 = new C3906(getApplication(), this.f7672);
this.f7663 = c3906;
this.f7666.setCameraManager(c3906);
this.f7675 = null;
SurfaceHolder holder = this.f7676.getHolder();
this.f7662 = holder;
if (this.f7670) {
m8100(holder);
} else {
holder.addCallback(this);
}
this.f7671.m10694();
this.f7673.m10701();
}
@Override
public void surfaceChanged(SurfaceHolder surfaceHolder, int i, int i2, int i3) {
}
@Override
public void surfaceCreated(SurfaceHolder surfaceHolder) {
if (this.f7670) {
return;
}
this.f7670 = true;
m8100(surfaceHolder);
}
@Override
public void surfaceDestroyed(SurfaceHolder surfaceHolder) {
this.f7670 = false;
}
public C3906 m8104() {
return this.f7663;
}
public void m8105() {
this.f7666.m8122();
}
public void m8106(int i) {
if (i == 8) {
this.f7669.setImageResource(R.drawable.ic_open);
this.f7667.setText(R.string.close_flash);
} else {
this.f7669.setImageResource(R.drawable.ic_close);
this.f7667.setText(R.string.open_flash);
}
}
public ViewfinderView m8107() {
return this.f7666;
}
public void m8108(Result result) {
this.f7673.m10702();
this.f7671.m10693();
Intent intent = getIntent();
intent.putExtra(C3905.f12804, result.getText());
setResult(-1, intent);
finish();
}
}