正在查看: PrestaMax v1.0.9 应用的 TakeCardActivity.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: PrestaMax v1.0.9 应用的 TakeCardActivity.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package com.prestamx.max.activity;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Matrix;
import android.graphics.Rect;
import android.media.ExifInterface;
import android.os.Bundle;
import android.util.Size;
import android.view.MotionEvent;
import android.view.View;
import androidx.camera.core.ImageCaptureException;
import androidx.camera.core.ogbxud;
import androidx.camera.core.vehppha;
import androidx.camera.core.wiuidnyon;
import androidx.camera.view.PreviewView;
import com.prestamx.max.R$id;
import com.prestamx.max.R$layout;
import com.prestamx.max.java_calss.ActivityUtil;
import com.prestamx.max.java_calss.AppUtil;
import com.prestamx.max.room.PointEnum;
import com.prestamx.max.transfer_view.TransferImageview;
import com.prestamx.max.transfer_view.TransferMaterialToolbar;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.HashMap;
import kitld.gdlglvuk;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;
public class TakeCardActivity extends MaxActivity {
public androidx.camera.lifecycle.slyvsmo f13599ksocihbb;
public kitld.aiyptt f13600vikxvh;
public androidx.camera.core.wiuidnyon f13601wavzltwms;
public class emazevgh implements gdlglvuk.mwowwskti {
public emazevgh() {
}
@Override
public void emazevgh(kitld.gdlglvuk gdlglvukVar) {
gdlglvukVar.dismiss();
momzvk.emazevgh.wdmirpab(TakeCardActivity.this, AppUtil.emazevgh(), 1000);
}
@Override
public void mwowwskti(kitld.gdlglvuk gdlglvukVar) {
gdlglvukVar.dismiss();
TakeCardActivity.this.finish();
}
}
public class mwowwskti implements Callback {
public mwowwskti() {
}
public void onFailure(Call call, Throwable th) {
TakeCardActivity.this.f13600vikxvh.dismiss();
momzvk.emazevgh.wdmirpab(TakeCardActivity.this, AppUtil.emazevgh(), 1000);
}
public void onResponse(Call call, Response response) {
TakeCardActivity.this.f13600vikxvh.dismiss();
momzvk.emazevgh.wdmirpab(TakeCardActivity.this, AppUtil.emazevgh(), 1000);
}
}
public class zwfgajm implements wiuidnyon.sjdatecqy {
public final File f13604emazevgh;
public final TransferImageview f13605mwowwskti;
public final PreviewView f13606nmqbnjf;
public final File f13608zwfgajm;
public zwfgajm(TransferImageview transferImageview, File file, File file2, PreviewView previewView) {
this.f13605mwowwskti = transferImageview;
this.f13604emazevgh = file;
this.f13608zwfgajm = file2;
this.f13606nmqbnjf = previewView;
}
@Override
public void emazevgh(ImageCaptureException imageCaptureException) {
TakeCardActivity.this.f13600vikxvh.dismiss();
AppUtil.slyvsmo(TakeCardActivity.this);
TakeCardActivity.this.finish();
}
@Override
public void mwowwskti(wiuidnyon.nqymzx nqymzxVar) {
try {
TakeCardActivity.this.f13599ksocihbb.sjdatecqy();
if (nqymzxVar.mwowwskti() == null) {
TakeCardActivity.this.f13600vikxvh.dismiss();
AppUtil.slyvsmo(TakeCardActivity.this);
TakeCardActivity.this.finish();
return;
}
if (!TakeCardActivity.this.osroeap(this.f13604emazevgh.getAbsolutePath(), this.f13608zwfgajm.getAbsolutePath(), new Rect(this.f13605mwowwskti.getLeft(), this.f13605mwowwskti.getTop(), this.f13605mwowwskti.getRight(), this.f13605mwowwskti.getBottom()), this.f13606nmqbnjf)) {
AppUtil.slyvsmo(TakeCardActivity.this);
TakeCardActivity.this.finish();
return;
}
this.f13604emazevgh.delete();
TakeCardActivity.this.f13600vikxvh.dismiss();
Intent intent = new Intent();
intent.putExtra("knsljbe", this.f13608zwfgajm.getAbsolutePath());
TakeCardActivity.this.setResult(-1, intent);
TakeCardActivity.this.finish();
} catch (Exception e) {
e.printStackTrace();
TakeCardActivity.this.f13600vikxvh.dismiss();
AppUtil.slyvsmo(TakeCardActivity.this);
TakeCardActivity.this.finish();
}
}
}
public void kamfujg(com.google.common.util.concurrent.vpqvb vpqvbVar, PreviewView previewView, TransferImageview transferImageview) {
try {
this.f13599ksocihbb = (androidx.camera.lifecycle.slyvsmo) vpqvbVar.get();
int hiqobdks2 = hiqobdks(previewView);
this.f13601wavzltwms = mmzqqpyl(hiqobdks2);
this.f13599ksocihbb.sjdatecqy();
androidx.camera.core.ogbxud kbpjcqc2 = kbpjcqc();
androidx.camera.core.vehppha hebzbk2 = hebzbk(hiqobdks2);
this.f13599ksocihbb.slyvsmo(this, kbpjcqc2, hebzbk2, this.f13601wavzltwms);
hebzbk2.mmzqqpyl(previewView.getSurfaceProvider());
transferImageview.setEnabled(true);
} catch (Exception e) {
e.printStackTrace();
}
}
public void mhpint(TransferImageview transferImageview, PreviewView previewView, View view) {
try {
this.f13600vikxvh.show();
AppUtil.zwfgajm(this, 15);
if (this.f13601wavzltwms == null) {
return;
}
String absolutePath = getCacheDir().getAbsolutePath();
String zppskyagv2 = com.prestamx.max.java_calss.yyqsz.zppskyagv("g+LZjwkKqmsn/pICAcjC8A==");
String zppskyagv3 = com.prestamx.max.java_calss.yyqsz.zppskyagv("/C6tZy7Jt0440K0fgD8sZA==");
String zppskyagv4 = com.prestamx.max.java_calss.yyqsz.zppskyagv("dN7QHTyzCBhFw1462LQjKQ==");
File file = new File(absolutePath, zppskyagv2 + zppskyagv4);
this.f13601wavzltwms.ptyq(new wiuidnyon.jzzsan.mwowwskti(file).mwowwskti(), rubjtuopd.mwowwskti.zybqm(this), new zwfgajm(transferImageview, file, new File(absolutePath, zppskyagv2 + zppskyagv3 + zppskyagv4), previewView));
} catch (Exception e) {
this.f13600vikxvh.dismiss();
e.printStackTrace();
AppUtil.slyvsmo(this);
finish();
}
}
public void wiuidnyon(View view) {
getOnBackPressedDispatcher().onBackPressed();
}
@Override
public boolean dispatchTouchEvent(MotionEvent motionEvent) {
qpcdhxz.nmqbnjf.vikxvh(PointEnum.POINT_AUTH, motionEvent);
return super.dispatchTouchEvent(motionEvent);
}
public final boolean ejsu(Bitmap bitmap, String str) {
try {
File file = new File(str);
File parentFile = file.getParentFile();
if (parentFile != null && !parentFile.exists()) {
parentFile.mkdirs();
}
FileOutputStream fileOutputStream = new FileOutputStream(file);
boolean compress = bitmap.compress(Bitmap.CompressFormat.JPEG, 100, fileOutputStream);
fileOutputStream.flush();
fileOutputStream.close();
return compress;
} catch (FileNotFoundException e) {
e.printStackTrace();
return false;
} catch (IOException e2) {
e2.printStackTrace();
return false;
}
}
public final androidx.camera.core.vehppha hebzbk(int i) {
return new vehppha.mwowwskti().ksocihbb(i).zwfgajm();
}
public final int hiqobdks(PreviewView previewView) {
if (previewView.getDisplay() != null) {
return (int) previewView.getRotation();
}
return 0;
}
public final androidx.camera.core.ogbxud kbpjcqc() {
return new ogbxud.mwowwskti().nmqbnjf(1).emazevgh();
}
public final androidx.camera.core.wiuidnyon mmzqqpyl(int i) {
return new wiuidnyon.etol().vpqvb(i).wavzltwms(new Size(1080, 1440)).zppskyagv(1).zwfgajm();
}
@Override
public void onCreate(Bundle bundle) {
super.onCreate(bundle);
setContentView(R$layout.activity_take_card);
((TransferMaterialToolbar) findViewById(R$id.toolbar)).setNavigationOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
TakeCardActivity.this.wiuidnyon(view);
}
});
kitld.aiyptt aiypttVar = new kitld.aiyptt(this);
this.f13600vikxvh = aiypttVar;
aiypttVar.show();
com.prestamx.max.java_calss.vikxvh.zppskyagv().pzetpkg(com.prestamx.max.java_calss.vikxvh.mwowwskti(this, new HashMap())).enqueue(new mwowwskti());
AppUtil.zwfgajm(this, 14);
ActivityUtil.wdmirpab(this, 18);
}
@Override
public void onRequestPermissionsResult(int i, String[] strArr, int[] iArr) {
super.onRequestPermissionsResult(i, strArr, iArr);
StringBuilder sb = new StringBuilder();
for (String str : AppUtil.emazevgh()) {
if (rubjtuopd.mwowwskti.mwowwskti(this, str) != 0) {
if (sb.length() > 0) {
sb.append("\n");
}
sb.append(str.replace(com.prestamx.max.java_calss.yyqsz.zppskyagv("WHH4uAcHAlvtzJFdtixvPzjO2JFid8clyDaAwXJyzcw="), ""));
}
}
if (sb.length() == 0) {
ufluaas();
} else {
new kitld.gdlglvuk(this).nqymzx(new emazevgh()).qwppmv(sb.toString()).show();
}
}
public final boolean osroeap(String str, String str2, Rect rect, PreviewView previewView) {
Bitmap createBitmap;
float height;
float width;
float width2;
int min;
int min2;
try {
Matrix wcewpl2 = wcewpl(str);
BitmapFactory.Options options = new BitmapFactory.Options();
options.inMutable = true;
Bitmap decodeFile = BitmapFactory.decodeFile(str, options);
createBitmap = Bitmap.createBitmap(decodeFile, 0, 0, decodeFile.getWidth(), decodeFile.getHeight(), wcewpl2, true);
float width3 = createBitmap.getWidth() / 2.0f;
float height2 = createBitmap.getHeight() / 2.0f;
height = rect.height() / 2.0f;
width = width3 / (previewView.getWidth() / 2.0f);
width2 = (rect.width() / 2.0f) * width;
min = Math.min(Math.max((int) (width3 - width2), 0), createBitmap.getWidth());
min2 = Math.min(Math.max((int) (height2 - (((previewView.getHeight() / 2.0f) - rect.top) * width)), 0), createBitmap.getHeight());
} catch (Error e) {
e = e;
} catch (Exception e2) {
e = e2;
}
try {
return ejsu(Bitmap.createBitmap(createBitmap, min, min2, Math.min(Math.max((int) (width2 * 2.0f), 0), createBitmap.getWidth() - min), Math.min(Math.max((int) (height * width * 2.0f), 0), createBitmap.getHeight() - min2), (Matrix) null, true), str2);
} catch (Error e3) {
e = e3;
e.printStackTrace();
return false;
} catch (Exception e4) {
e = e4;
e.printStackTrace();
return false;
}
}
public final void ufluaas() {
final TransferImageview transferImageview = (TransferImageview) findViewById(R$id.cardView);
final TransferImageview transferImageview2 = (TransferImageview) findViewById(R$id.takeView);
final PreviewView previewView = (PreviewView) findViewById(R$id.preView);
final com.google.common.util.concurrent.vpqvb zppskyagv2 = androidx.camera.lifecycle.slyvsmo.zppskyagv(this);
zppskyagv2.addListener(new Runnable() {
@Override
public final void run() {
TakeCardActivity.this.kamfujg(zppskyagv2, previewView, transferImageview2);
}
}, rubjtuopd.mwowwskti.zybqm(this));
transferImageview2.setEnabled(false);
transferImageview2.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
TakeCardActivity.this.mhpint(transferImageview, previewView, view);
}
});
}
public final Matrix wcewpl(String str) {
Matrix matrix = new Matrix();
int attributeInt = new ExifInterface(str).getAttributeInt("Orientation", -1);
if (attributeInt == 6) {
matrix.postRotate(90.0f);
return matrix;
}
if (attributeInt == 3) {
matrix.postRotate(180.0f);
return matrix;
}
if (attributeInt == 8) {
matrix.postRotate(270.0f);
return matrix;
}
matrix.postRotate(0.0f);
return matrix;
}
}