正在查看: 远离手机 v4.9.11 应用的 CaptureActivity.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: 远离手机 v4.9.11 应用的 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.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.Il1IlII1;
import androidx.appcompat.app.lIIl1I1I;
import androidx.appcompat.widget.AppCompatImageView;
import androidx.appcompat.widget.LinearLayoutCompat;
import com.lijianqiang12.silent.I11I11I1I1I;
import com.lijianqiang12.silent.I1I1IllIllllI;
import com.lijianqiang12.silent.I1Il1lI1llII;
import com.lijianqiang12.silent.III11Il11IIl;
import com.lijianqiang12.silent.IllI111lll11;
import com.lijianqiang12.silent.l1I1111lII11;
import com.lijianqiang12.silent.l1lllll1ll1;
import com.lijianqiang12.silent.lIII1lIlI11I1;
import com.lijianqiang12.silent.lIIlI11lIlIl1;
import com.lijianqiang12.silent.lIIlllI1IlIl;
import com.lijianqiang12.silent.lIllIlI1I1I;
import com.lijianqiang12.silent.lIllllI1I1Il;
import com.tencent.connect.share.QQShare;
import com.yzq.zxinglibrary.view.ViewfinderView;
import java.io.IOException;
public class CaptureActivity extends lIIl1I1I implements SurfaceHolder.Callback, View.OnClickListener {
private static final String l1IlI1lI = "CaptureActivity";
private SurfaceView I1II1ll1lI1;
private l1lllll1ll1 I1IlIl1llII;
private AppCompatImageView IIl1ll1ll1l;
public lIIlI11lIlIl1 Il11lIlllll1;
private boolean IlIII1l1l111;
private LinearLayoutCompat Ill1l11ll11l;
private LinearLayoutCompat IllII1lIII;
private ViewfinderView l11l1l11I1;
private LinearLayoutCompat l11llI1Ill1;
private TextView l1I11II1llI1I;
private I11I11I1I1I lI11lI1l1;
private AppCompatImageView lI11lI1llIl11;
private SurfaceHolder ll1I1I1IIIl1I;
private I1Il1lI1llII lllIl1ll1l1I;
private lIII1lIlI11I1 llll11l11l1;
class IIllIl1llII implements I1I1IllIllllI {
IIllIl1llII() {
}
@Override
public void IIllIl1llII() {
Toast.makeText((Context) CaptureActivity.this, (CharSequence) "抱歉,解析失败,换个图片试试.", 0).show();
}
@Override
public void IlllIll1I1I(IllI111lll11 illI111lll11) {
CaptureActivity.this.llll11l11l1(illI111lll11);
}
}
static {
Il1IlII1.lIlI1IIllI1(true);
}
public static boolean I1IlIl1llII(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 IIl1ll1ll1l() {
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setTitle("扫一扫");
builder.setMessage(getString(lIIlllI1IlIl.lII1lI1Illl.Il11lI1III1));
builder.setPositiveButton(lIIlllI1IlIl.lII1lI1Illl.IlllIll1I1I, new III11Il11IIl(this));
builder.setOnCancelListener(new III11Il11IIl(this));
builder.show();
}
private void l1IlI1lI(View view, boolean z) {
if (z) {
view.setVisibility(0);
} else {
view.setVisibility(8);
}
}
private void lI11lI1l1(SurfaceHolder surfaceHolder) {
if (surfaceHolder == null) {
throw new IllegalStateException("No SurfaceHolder provided");
}
if (this.lllIl1ll1l1I.lI11111lI1()) {
return;
}
try {
this.lllIl1ll1l1I.lII1lI1Illl(surfaceHolder);
if (this.I1IlIl1llII == null) {
this.I1IlIl1llII = new l1lllll1ll1(this, this.lllIl1ll1l1I);
}
} catch (IOException unused) {
IIl1ll1ll1l();
} catch (RuntimeException unused2) {
IIl1ll1ll1l();
}
}
private void lllIl1ll1l1I() {
SurfaceView surfaceView = (SurfaceView) findViewById(lIIlllI1IlIl.lIIl1I1I.Ill1llIIlIlll);
this.I1II1ll1lI1 = surfaceView;
surfaceView.setOnClickListener(this);
ViewfinderView viewfinderView = (ViewfinderView) findViewById(lIIlllI1IlIl.lIIl1I1I.IIll11IllI1l);
this.l11l1l11I1 = viewfinderView;
viewfinderView.setZxingConfig(this.Il11lIlllll1);
AppCompatImageView findViewById = findViewById(lIIlllI1IlIl.lIIl1I1I.Il11lI1III1);
this.IIl1ll1ll1l = findViewById;
findViewById.setOnClickListener(this);
this.lI11lI1llIl11 = findViewById(lIIlllI1IlIl.lIIl1I1I.Il1IlII1);
this.l1I11II1llI1I = (TextView) findViewById(lIIlllI1IlIl.lIIl1I1I.lII1lI1Illl);
LinearLayoutCompat findViewById2 = findViewById(lIIlllI1IlIl.lIIl1I1I.lI11111lI1);
this.l11llI1Ill1 = findViewById2;
findViewById2.setOnClickListener(this);
LinearLayoutCompat findViewById3 = findViewById(lIIlllI1IlIl.lIIl1I1I.IlllIll1I1I);
this.Ill1l11ll11l = findViewById3;
findViewById3.setOnClickListener(this);
LinearLayoutCompat findViewById4 = findViewById(lIIlllI1IlIl.lIIl1I1I.lIIl1I1I);
this.IllII1lIII = findViewById4;
l1IlI1lI(findViewById4, this.Il11lIlllll1.IIll11IllI1l());
l1IlI1lI(this.l11llI1Ill1, this.Il11lIlllll1.Ill1llIIlIlll());
l1IlI1lI(this.Ill1l11ll11l, this.Il11lIlllll1.lI111l1I1llIl());
if (I1IlIl1llII(getPackageManager())) {
this.l11llI1Ill1.setVisibility(0);
} else {
this.l11llI1Ill1.setVisibility(8);
}
}
public ViewfinderView IlIII1l1l111() {
return this.l11l1l11I1;
}
public I1Il1lI1llII Ill1l11ll11l() {
return this.lllIl1ll1l1I;
}
public Handler IllII1lIII() {
return this.I1IlIl1llII;
}
public void l11llI1Ill1() {
this.l11l1l11I1.Ill1llIIlIlll();
}
public void ll1I1I1IIIl1I(int i) {
if (i == 8) {
this.lI11lI1llIl11.setImageResource(lIIlllI1IlIl.Il11lI1III1.Il11lI1III1);
this.l1I11II1llI1I.setText("关闭闪光灯");
} else {
this.lI11lI1llIl11.setImageResource(lIIlllI1IlIl.Il11lI1III1.IlllIll1I1I);
this.l1I11II1llI1I.setText("打开闪光灯");
}
}
public void llll11l11l1(IllI111lll11 illI111lll11) {
this.llll11l11l1.Il1IlII1();
this.lI11lI1l1.IlllIll1I1I();
Intent intent = getIntent();
intent.putExtra(l1I1111lII11.I1Il11llllIl, illI111lll11.lII1lI1Illl());
setResult(-1, intent);
finish();
}
protected void onActivityResult(int i, int i2, Intent intent) {
super/*androidx.fragment.app.IllIlI1l1I*/.onActivityResult(i, i2, intent);
if (i == 10 && i2 == -1) {
new lIllIlI1I1I(lIllllI1I1Il.IlllIll1I1I(this, intent.getData()), new IIllIl1llII()).run();
}
}
@Override
public void onClick(View view) {
int id = view.getId();
if (id == lIIlllI1IlIl.lIIl1I1I.lI11111lI1) {
this.lllIl1ll1l1I.IllIlI1l1I(this.I1IlIl1llII);
return;
}
if (id != lIIlllI1IlIl.lIIl1I1I.IlllIll1I1I) {
if (id == lIIlllI1IlIl.lIIl1I1I.Il11lI1III1) {
finish();
}
} else {
Intent intent = new Intent();
intent.setAction("android.intent.action.PICK");
intent.setType("image/*");
startActivityForResult(intent, 10);
}
}
protected void onCreate(Bundle bundle) {
super/*androidx.fragment.app.IllIlI1l1I*/.onCreate(bundle);
Window window = getWindow();
window.addFlags(QQShare.QQ_SHARE_TITLE_MAX_LENGTH);
window.setStatusBarColor(-16777216);
try {
this.Il11lIlllll1 = (lIIlI11lIlIl1) getIntent().getExtras().get(l1I1111lII11.IllIlI1l1I);
} catch (Exception e) {
e.toString();
}
if (this.Il11lIlllll1 == null) {
this.Il11lIlllll1 = new lIIlI11lIlIl1();
}
setContentView(lIIlllI1IlIl.Il1IlII1.IIllIl1llII);
lllIl1ll1l1I();
this.IlIII1l1l111 = false;
this.llll11l11l1 = new lIII1lIlI11I1(this);
I11I11I1I1I i11i11i1i1i = new I11I11I1I1I(this);
this.lI11lI1l1 = i11i11i1i1i;
i11i11i1i1i.Il11lI1III1(this.Il11lIlllll1.lI11111lI1());
this.lI11lI1l1.lIIl1I1I(this.Il11lIlllll1.lII1lI1Illl());
}
protected void onDestroy() {
this.llll11l11l1.lI111l1I1llIl();
super.onDestroy();
}
protected void onPause() {
l1lllll1ll1 l1lllll1ll1Var = this.I1IlIl1llII;
if (l1lllll1ll1Var != null) {
l1lllll1ll1Var.IIllIl1llII();
this.I1IlIl1llII = null;
}
this.llll11l11l1.lI11111lI1();
this.lI11lI1l1.close();
this.lllIl1ll1l1I.IlllIll1I1I();
if (!this.IlIII1l1l111) {
this.ll1I1I1IIIl1I.removeCallback(this);
}
super/*androidx.fragment.app.IllIlI1l1I*/.onPause();
}
protected void onResume() {
super/*androidx.fragment.app.IllIlI1l1I*/.onResume();
I1Il1lI1llII i1Il1lI1llII = new I1Il1lI1llII(getApplication(), this.Il11lIlllll1);
this.lllIl1ll1l1I = i1Il1lI1llII;
this.l11l1l11I1.setCameraManager(i1Il1lI1llII);
this.I1IlIl1llII = null;
SurfaceHolder holder = this.I1II1ll1lI1.getHolder();
this.ll1I1I1IIIl1I = holder;
if (this.IlIII1l1l111) {
lI11lI1l1(holder);
} else {
holder.addCallback(this);
}
this.lI11lI1l1.lII1lI1Illl();
this.llll11l11l1.lII1lI1Illl();
}
@Override
public void surfaceChanged(SurfaceHolder surfaceHolder, int i, int i2, int i3) {
}
@Override
public void surfaceCreated(SurfaceHolder surfaceHolder) {
if (this.IlIII1l1l111) {
return;
}
this.IlIII1l1l111 = true;
lI11lI1l1(surfaceHolder);
}
@Override
public void surfaceDestroyed(SurfaceHolder surfaceHolder) {
this.IlIII1l1l111 = false;
}
}