what-the-bank/sources/o/PNi.java

216 lines
7.6 KiB
Java
Raw Normal View History

2024-07-27 18:17:47 +07:00
package o;
import android.content.Context;
import android.graphics.Point;
import android.graphics.pdf.PdfRenderer;
import android.net.Uri;
import android.os.ParcelFileDescriptor;
import com.pdfview.PDFView;
import java.io.File;
/* loaded from: classes3.dex */
public final class PNi implements InterfaceC14459ftc {
private int a;
private int b;
private ParcelFileDescriptor c;
private final int d;
private final File e;
private final float h;
private final PDFView i;
private PdfRenderer j;
public /* synthetic */ PNi(PDFView pDFView, File file, float f) {
this(pDFView, file, f, (byte) 0);
}
private PNi(PDFView pDFView, File file, float f, byte b) {
C14957gcv.e(pDFView, "");
C14957gcv.e(file, "");
this.i = pDFView;
this.e = file;
this.h = f;
this.d = -1;
}
@Override // o.InterfaceC14459ftc
public final Point Pv_(Context context, Uri uri) throws Exception {
C14957gcv.e(context, "");
C14957gcv.e(uri, "");
ParcelFileDescriptor open = ParcelFileDescriptor.open(this.e, 268435456);
C14957gcv.c(open, "");
this.c = open;
if (open != null) {
PdfRenderer pdfRenderer = new PdfRenderer(open);
this.j = pdfRenderer;
PdfRenderer.Page openPage = pdfRenderer.openPage(0);
this.a = (int) (openPage.getWidth() * this.h);
this.b = (int) (openPage.getHeight() * this.h);
PdfRenderer pdfRenderer2 = this.j;
if (pdfRenderer2 != null) {
if (pdfRenderer2.getPageCount() > 15) {
this.i.setHasBaseLayerTiles(false);
} else {
PdfRenderer pdfRenderer3 = this.j;
if (pdfRenderer3 != null) {
if (pdfRenderer3.getPageCount() == 1) {
this.i.setMinimumScaleType(1);
}
} else {
C14957gcv.a("");
throw null;
}
}
openPage.close();
int i = this.a;
int i2 = this.b;
PdfRenderer pdfRenderer4 = this.j;
if (pdfRenderer4 != null) {
return new Point(i, i2 * pdfRenderer4.getPageCount());
}
C14957gcv.a("");
throw null;
}
C14957gcv.a("");
throw null;
}
C14957gcv.a("");
throw null;
}
/* JADX WARN: Code restructure failed: missing block: B:16:0x008a, code lost:
o.C14957gcv.a("");
*/
/* JADX WARN: Code restructure failed: missing block: B:17:0x008f, code lost:
throw null;
*/
@Override // o.InterfaceC14459ftc
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct add '--show-bad-code' argument
*/
public final android.graphics.Bitmap Pu_(android.graphics.Rect r18, int r19) {
/*
r17 = this;
r1 = r17
r0 = r18
r2 = r19
java.lang.String r3 = ""
o.C14957gcv.e(r0, r3)
int r3 = r0.top
double r3 = (double) r3
int r5 = r1.b
double r5 = (double) r5
double r3 = r3 / r5
double r3 = java.lang.Math.floor(r3)
int r3 = (int) r3
int r4 = r0.bottom
double r4 = (double) r4
int r6 = r1.b
double r6 = (double) r6
double r4 = r4 / r6
double r4 = java.lang.Math.ceil(r4)
int r4 = (int) r4
r5 = 1
int r4 = r4 - r5
int r6 = r18.width()
int r6 = r6 / r2
int r7 = r18.height()
int r7 = r7 / r2
android.graphics.Bitmap$Config r8 = android.graphics.Bitmap.Config.ARGB_8888
android.graphics.Bitmap r6 = android.graphics.Bitmap.createBitmap(r6, r7, r8)
android.graphics.Canvas r7 = new android.graphics.Canvas
r7.<init>(r6)
int r8 = r1.d
r7.drawColor(r8)
r8 = 0
r9 = 0
r7.drawBitmap(r6, r8, r8, r9)
if (r3 > r4) goto L99
r7 = 0
r8 = r3
L48:
android.graphics.pdf.PdfRenderer r10 = r1.j
if (r10 == 0) goto L93
monitor-enter(r10)
android.graphics.pdf.PdfRenderer r11 = r1.j // Catch: java.lang.Throwable -> L90
if (r11 == 0) goto L8a
android.graphics.pdf.PdfRenderer$Page r11 = r11.openPage(r8) // Catch: java.lang.Throwable -> L90
android.graphics.Matrix r12 = new android.graphics.Matrix // Catch: java.lang.Throwable -> L90
r12.<init>() // Catch: java.lang.Throwable -> L90
float r13 = r1.h // Catch: java.lang.Throwable -> L90
float r14 = (float) r2 // Catch: java.lang.Throwable -> L90
float r13 = r13 / r14
r12.setScale(r13, r13) // Catch: java.lang.Throwable -> L90
int r13 = r0.left // Catch: java.lang.Throwable -> L90
int r13 = -r13
int r13 = r13 / r2
float r13 = (float) r13 // Catch: java.lang.Throwable -> L90
int r15 = r0.top // Catch: java.lang.Throwable -> L90
int r5 = r1.b // Catch: java.lang.Throwable -> L90
int r16 = r5 * r3
int r15 = r15 - r16
int r15 = r15 / r2
float r15 = (float) r15 // Catch: java.lang.Throwable -> L90
float r15 = -r15
float r5 = (float) r5 // Catch: java.lang.Throwable -> L90
float r5 = r5 / r14
float r14 = (float) r7 // Catch: java.lang.Throwable -> L90
float r5 = r5 * r14
float r15 = r15 + r5
r12.postTranslate(r13, r15) // Catch: java.lang.Throwable -> L90
r5 = 1
r11.render(r6, r9, r12, r5) // Catch: java.lang.Throwable -> L90
r11.close() // Catch: java.lang.Throwable -> L90
o.gag r11 = o.C14866gag.c // Catch: java.lang.Throwable -> L90
monitor-exit(r10)
if (r8 == r4) goto L99
int r7 = r7 + 1
int r8 = r8 + 1
goto L48
L8a:
java.lang.String r0 = ""
o.C14957gcv.a(r0) // Catch: java.lang.Throwable -> L90
throw r9 // Catch: java.lang.Throwable -> L90
L90:
r0 = move-exception
monitor-exit(r10)
throw r0
L93:
java.lang.String r0 = ""
o.C14957gcv.a(r0)
throw r9
L99:
java.lang.String r0 = ""
o.C14957gcv.c(r6, r0)
return r6
*/
throw new UnsupportedOperationException("Method not decompiled: o.PNi.Pu_(android.graphics.Rect, int):android.graphics.Bitmap");
}
@Override // o.InterfaceC14459ftc
public final void c() {
PdfRenderer pdfRenderer = this.j;
if (pdfRenderer != null) {
pdfRenderer.close();
ParcelFileDescriptor parcelFileDescriptor = this.c;
if (parcelFileDescriptor == null) {
C14957gcv.a("");
throw null;
}
parcelFileDescriptor.close();
this.a = 0;
this.b = 0;
return;
}
C14957gcv.a("");
throw null;
}
@Override // o.InterfaceC14459ftc
public final boolean a() {
return this.a > 0 && this.b > 0;
}
}