apkfuckery/com.discord/smali/androidx/print/PrintHelper$1.smali

424 lines
13 KiB
Smali
Raw Normal View History

2019-12-06 03:29:40 +00:00
.class public Landroidx/print/PrintHelper$1;
2019-07-24 11:27:29 +00:00
.super Landroid/os/AsyncTask;
.source "PrintHelper.java"
# annotations
.annotation system Ldalvik/annotation/EnclosingMethod;
value = Landroidx/print/PrintHelper;->writeBitmap(Landroid/print/PrintAttributes;ILandroid/graphics/Bitmap;Landroid/os/ParcelFileDescriptor;Landroid/os/CancellationSignal;Landroid/print/PrintDocumentAdapter$WriteResultCallback;)V
.end annotation
.annotation system Ldalvik/annotation/InnerClass;
2019-12-06 03:29:40 +00:00
accessFlags = 0x1
2019-07-24 11:27:29 +00:00
name = null
.end annotation
.annotation system Ldalvik/annotation/Signature;
value = {
"Landroid/os/AsyncTask<",
"Ljava/lang/Void;",
"Ljava/lang/Void;",
"Ljava/lang/Throwable;",
">;"
}
.end annotation
# instance fields
2019-12-06 03:29:40 +00:00
.field public final synthetic this$0:Landroidx/print/PrintHelper;
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
.field public final synthetic val$attributes:Landroid/print/PrintAttributes;
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
.field public final synthetic val$bitmap:Landroid/graphics/Bitmap;
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
.field public final synthetic val$cancellationSignal:Landroid/os/CancellationSignal;
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
.field public final synthetic val$fileDescriptor:Landroid/os/ParcelFileDescriptor;
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
.field public final synthetic val$fittingMode:I
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
.field public final synthetic val$pdfAttributes:Landroid/print/PrintAttributes;
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
.field public final synthetic val$writeResultCallback:Landroid/print/PrintDocumentAdapter$WriteResultCallback;
2019-07-24 11:27:29 +00:00
# direct methods
2019-12-06 03:29:40 +00:00
.method public constructor <init>(Landroidx/print/PrintHelper;Landroid/os/CancellationSignal;Landroid/print/PrintAttributes;Landroid/graphics/Bitmap;Landroid/print/PrintAttributes;ILandroid/os/ParcelFileDescriptor;Landroid/print/PrintDocumentAdapter$WriteResultCallback;)V
2019-07-24 11:27:29 +00:00
.locals 0
iput-object p1, p0, Landroidx/print/PrintHelper$1;->this$0:Landroidx/print/PrintHelper;
iput-object p2, p0, Landroidx/print/PrintHelper$1;->val$cancellationSignal:Landroid/os/CancellationSignal;
iput-object p3, p0, Landroidx/print/PrintHelper$1;->val$pdfAttributes:Landroid/print/PrintAttributes;
iput-object p4, p0, Landroidx/print/PrintHelper$1;->val$bitmap:Landroid/graphics/Bitmap;
iput-object p5, p0, Landroidx/print/PrintHelper$1;->val$attributes:Landroid/print/PrintAttributes;
iput p6, p0, Landroidx/print/PrintHelper$1;->val$fittingMode:I
iput-object p7, p0, Landroidx/print/PrintHelper$1;->val$fileDescriptor:Landroid/os/ParcelFileDescriptor;
iput-object p8, p0, Landroidx/print/PrintHelper$1;->val$writeResultCallback:Landroid/print/PrintDocumentAdapter$WriteResultCallback;
invoke-direct {p0}, Landroid/os/AsyncTask;-><init>()V
return-void
.end method
# virtual methods
2019-12-06 03:29:40 +00:00
.method public bridge synthetic doInBackground([Ljava/lang/Object;)Ljava/lang/Object;
2019-07-24 11:27:29 +00:00
.locals 0
check-cast p1, [Ljava/lang/Void;
invoke-virtual {p0, p1}, Landroidx/print/PrintHelper$1;->doInBackground([Ljava/lang/Void;)Ljava/lang/Throwable;
move-result-object p1
return-object p1
.end method
2019-12-06 03:29:40 +00:00
.method public varargs doInBackground([Ljava/lang/Void;)Ljava/lang/Throwable;
2019-07-24 11:27:29 +00:00
.locals 7
:try_start_0
iget-object p1, p0, Landroidx/print/PrintHelper$1;->val$cancellationSignal:Landroid/os/CancellationSignal;
invoke-virtual {p1}, Landroid/os/CancellationSignal;->isCanceled()Z
move-result p1
const/4 v0, 0x0
if-eqz p1, :cond_0
return-object v0
:cond_0
new-instance p1, Landroid/print/pdf/PrintedPdfDocument;
iget-object v1, p0, Landroidx/print/PrintHelper$1;->this$0:Landroidx/print/PrintHelper;
iget-object v1, v1, Landroidx/print/PrintHelper;->mContext:Landroid/content/Context;
iget-object v2, p0, Landroidx/print/PrintHelper$1;->val$pdfAttributes:Landroid/print/PrintAttributes;
invoke-direct {p1, v1, v2}, Landroid/print/pdf/PrintedPdfDocument;-><init>(Landroid/content/Context;Landroid/print/PrintAttributes;)V
iget-object v1, p0, Landroidx/print/PrintHelper$1;->val$bitmap:Landroid/graphics/Bitmap;
iget-object v2, p0, Landroidx/print/PrintHelper$1;->val$pdfAttributes:Landroid/print/PrintAttributes;
invoke-virtual {v2}, Landroid/print/PrintAttributes;->getColorMode()I
move-result v2
invoke-static {v1, v2}, Landroidx/print/PrintHelper;->convertBitmapForColorMode(Landroid/graphics/Bitmap;I)Landroid/graphics/Bitmap;
move-result-object v1
iget-object v2, p0, Landroidx/print/PrintHelper$1;->val$cancellationSignal:Landroid/os/CancellationSignal;
invoke-virtual {v2}, Landroid/os/CancellationSignal;->isCanceled()Z
move-result v2
:try_end_0
2019-08-30 20:04:20 +00:00
.catchall {:try_start_0 .. :try_end_0} :catchall_1
2019-07-24 11:27:29 +00:00
if-eqz v2, :cond_1
return-object v0
:cond_1
const/4 v2, 0x1
:try_start_1
invoke-virtual {p1, v2}, Landroid/print/pdf/PrintedPdfDocument;->startPage(I)Landroid/graphics/pdf/PdfDocument$Page;
move-result-object v3
sget-boolean v4, Landroidx/print/PrintHelper;->IS_MIN_MARGINS_HANDLING_CORRECT:Z
if-eqz v4, :cond_2
new-instance v2, Landroid/graphics/RectF;
invoke-virtual {v3}, Landroid/graphics/pdf/PdfDocument$Page;->getInfo()Landroid/graphics/pdf/PdfDocument$PageInfo;
move-result-object v4
invoke-virtual {v4}, Landroid/graphics/pdf/PdfDocument$PageInfo;->getContentRect()Landroid/graphics/Rect;
move-result-object v4
invoke-direct {v2, v4}, Landroid/graphics/RectF;-><init>(Landroid/graphics/Rect;)V
goto :goto_0
:cond_2
new-instance v4, Landroid/print/pdf/PrintedPdfDocument;
iget-object v5, p0, Landroidx/print/PrintHelper$1;->this$0:Landroidx/print/PrintHelper;
iget-object v5, v5, Landroidx/print/PrintHelper;->mContext:Landroid/content/Context;
iget-object v6, p0, Landroidx/print/PrintHelper$1;->val$attributes:Landroid/print/PrintAttributes;
invoke-direct {v4, v5, v6}, Landroid/print/pdf/PrintedPdfDocument;-><init>(Landroid/content/Context;Landroid/print/PrintAttributes;)V
invoke-virtual {v4, v2}, Landroid/print/pdf/PrintedPdfDocument;->startPage(I)Landroid/graphics/pdf/PdfDocument$Page;
move-result-object v2
new-instance v5, Landroid/graphics/RectF;
invoke-virtual {v2}, Landroid/graphics/pdf/PdfDocument$Page;->getInfo()Landroid/graphics/pdf/PdfDocument$PageInfo;
move-result-object v6
invoke-virtual {v6}, Landroid/graphics/pdf/PdfDocument$PageInfo;->getContentRect()Landroid/graphics/Rect;
move-result-object v6
invoke-direct {v5, v6}, Landroid/graphics/RectF;-><init>(Landroid/graphics/Rect;)V
invoke-virtual {v4, v2}, Landroid/print/pdf/PrintedPdfDocument;->finishPage(Landroid/graphics/pdf/PdfDocument$Page;)V
invoke-virtual {v4}, Landroid/print/pdf/PrintedPdfDocument;->close()V
move-object v2, v5
:goto_0
invoke-virtual {v1}, Landroid/graphics/Bitmap;->getWidth()I
move-result v4
invoke-virtual {v1}, Landroid/graphics/Bitmap;->getHeight()I
move-result v5
iget v6, p0, Landroidx/print/PrintHelper$1;->val$fittingMode:I
invoke-static {v4, v5, v2, v6}, Landroidx/print/PrintHelper;->getMatrix(IILandroid/graphics/RectF;I)Landroid/graphics/Matrix;
move-result-object v4
sget-boolean v5, Landroidx/print/PrintHelper;->IS_MIN_MARGINS_HANDLING_CORRECT:Z
2019-12-06 03:29:40 +00:00
if-eqz v5, :cond_3
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
goto :goto_1
:cond_3
2019-07-24 11:27:29 +00:00
iget v5, v2, Landroid/graphics/RectF;->left:F
iget v6, v2, Landroid/graphics/RectF;->top:F
invoke-virtual {v4, v5, v6}, Landroid/graphics/Matrix;->postTranslate(FF)Z
invoke-virtual {v3}, Landroid/graphics/pdf/PdfDocument$Page;->getCanvas()Landroid/graphics/Canvas;
move-result-object v5
invoke-virtual {v5, v2}, Landroid/graphics/Canvas;->clipRect(Landroid/graphics/RectF;)Z
2019-12-06 03:29:40 +00:00
:goto_1
2019-07-24 11:27:29 +00:00
invoke-virtual {v3}, Landroid/graphics/pdf/PdfDocument$Page;->getCanvas()Landroid/graphics/Canvas;
move-result-object v2
invoke-virtual {v2, v1, v4, v0}, Landroid/graphics/Canvas;->drawBitmap(Landroid/graphics/Bitmap;Landroid/graphics/Matrix;Landroid/graphics/Paint;)V
invoke-virtual {p1, v3}, Landroid/print/pdf/PrintedPdfDocument;->finishPage(Landroid/graphics/pdf/PdfDocument$Page;)V
iget-object v2, p0, Landroidx/print/PrintHelper$1;->val$cancellationSignal:Landroid/os/CancellationSignal;
invoke-virtual {v2}, Landroid/os/CancellationSignal;->isCanceled()Z
move-result v2
:try_end_1
.catchall {:try_start_1 .. :try_end_1} :catchall_0
if-eqz v2, :cond_6
:try_start_2
invoke-virtual {p1}, Landroid/print/pdf/PrintedPdfDocument;->close()V
iget-object p1, p0, Landroidx/print/PrintHelper$1;->val$fileDescriptor:Landroid/os/ParcelFileDescriptor;
:try_end_2
2019-08-30 20:04:20 +00:00
.catchall {:try_start_2 .. :try_end_2} :catchall_1
2019-07-24 11:27:29 +00:00
if-eqz p1, :cond_4
:try_start_3
iget-object p1, p0, Landroidx/print/PrintHelper$1;->val$fileDescriptor:Landroid/os/ParcelFileDescriptor;
invoke-virtual {p1}, Landroid/os/ParcelFileDescriptor;->close()V
:try_end_3
.catch Ljava/io/IOException; {:try_start_3 .. :try_end_3} :catch_0
2019-08-30 20:04:20 +00:00
.catchall {:try_start_3 .. :try_end_3} :catchall_1
2019-07-24 11:27:29 +00:00
:catch_0
:cond_4
:try_start_4
iget-object p1, p0, Landroidx/print/PrintHelper$1;->val$bitmap:Landroid/graphics/Bitmap;
if-eq v1, p1, :cond_5
invoke-virtual {v1}, Landroid/graphics/Bitmap;->recycle()V
:try_end_4
2019-08-30 20:04:20 +00:00
.catchall {:try_start_4 .. :try_end_4} :catchall_1
2019-07-24 11:27:29 +00:00
:cond_5
return-object v0
:cond_6
:try_start_5
new-instance v2, Ljava/io/FileOutputStream;
iget-object v3, p0, Landroidx/print/PrintHelper$1;->val$fileDescriptor:Landroid/os/ParcelFileDescriptor;
invoke-virtual {v3}, Landroid/os/ParcelFileDescriptor;->getFileDescriptor()Ljava/io/FileDescriptor;
move-result-object v3
invoke-direct {v2, v3}, Ljava/io/FileOutputStream;-><init>(Ljava/io/FileDescriptor;)V
invoke-virtual {p1, v2}, Landroid/print/pdf/PrintedPdfDocument;->writeTo(Ljava/io/OutputStream;)V
:try_end_5
.catchall {:try_start_5 .. :try_end_5} :catchall_0
:try_start_6
invoke-virtual {p1}, Landroid/print/pdf/PrintedPdfDocument;->close()V
iget-object p1, p0, Landroidx/print/PrintHelper$1;->val$fileDescriptor:Landroid/os/ParcelFileDescriptor;
:try_end_6
2019-08-30 20:04:20 +00:00
.catchall {:try_start_6 .. :try_end_6} :catchall_1
2019-07-24 11:27:29 +00:00
if-eqz p1, :cond_7
:try_start_7
iget-object p1, p0, Landroidx/print/PrintHelper$1;->val$fileDescriptor:Landroid/os/ParcelFileDescriptor;
invoke-virtual {p1}, Landroid/os/ParcelFileDescriptor;->close()V
:try_end_7
.catch Ljava/io/IOException; {:try_start_7 .. :try_end_7} :catch_1
2019-08-30 20:04:20 +00:00
.catchall {:try_start_7 .. :try_end_7} :catchall_1
2019-07-24 11:27:29 +00:00
:catch_1
:cond_7
:try_start_8
iget-object p1, p0, Landroidx/print/PrintHelper$1;->val$bitmap:Landroid/graphics/Bitmap;
if-eq v1, p1, :cond_8
invoke-virtual {v1}, Landroid/graphics/Bitmap;->recycle()V
:cond_8
return-object v0
:catchall_0
move-exception v0
invoke-virtual {p1}, Landroid/print/pdf/PrintedPdfDocument;->close()V
iget-object p1, p0, Landroidx/print/PrintHelper$1;->val$fileDescriptor:Landroid/os/ParcelFileDescriptor;
:try_end_8
2019-08-30 20:04:20 +00:00
.catchall {:try_start_8 .. :try_end_8} :catchall_1
2019-07-24 11:27:29 +00:00
if-eqz p1, :cond_9
:try_start_9
iget-object p1, p0, Landroidx/print/PrintHelper$1;->val$fileDescriptor:Landroid/os/ParcelFileDescriptor;
invoke-virtual {p1}, Landroid/os/ParcelFileDescriptor;->close()V
:try_end_9
.catch Ljava/io/IOException; {:try_start_9 .. :try_end_9} :catch_2
2019-08-30 20:04:20 +00:00
.catchall {:try_start_9 .. :try_end_9} :catchall_1
2019-07-24 11:27:29 +00:00
:catch_2
:cond_9
:try_start_a
iget-object p1, p0, Landroidx/print/PrintHelper$1;->val$bitmap:Landroid/graphics/Bitmap;
if-eq v1, p1, :cond_a
invoke-virtual {v1}, Landroid/graphics/Bitmap;->recycle()V
:cond_a
throw v0
:try_end_a
2019-08-30 20:04:20 +00:00
.catchall {:try_start_a .. :try_end_a} :catchall_1
2019-07-24 11:27:29 +00:00
2019-08-30 20:04:20 +00:00
:catchall_1
2019-07-24 11:27:29 +00:00
move-exception p1
return-object p1
.end method
2019-12-06 03:29:40 +00:00
.method public bridge synthetic onPostExecute(Ljava/lang/Object;)V
2019-07-24 11:27:29 +00:00
.locals 0
check-cast p1, Ljava/lang/Throwable;
invoke-virtual {p0, p1}, Landroidx/print/PrintHelper$1;->onPostExecute(Ljava/lang/Throwable;)V
return-void
.end method
2019-12-06 03:29:40 +00:00
.method public onPostExecute(Ljava/lang/Throwable;)V
2019-07-24 11:27:29 +00:00
.locals 3
iget-object v0, p0, Landroidx/print/PrintHelper$1;->val$cancellationSignal:Landroid/os/CancellationSignal;
invoke-virtual {v0}, Landroid/os/CancellationSignal;->isCanceled()Z
move-result v0
if-eqz v0, :cond_0
iget-object p1, p0, Landroidx/print/PrintHelper$1;->val$writeResultCallback:Landroid/print/PrintDocumentAdapter$WriteResultCallback;
invoke-virtual {p1}, Landroid/print/PrintDocumentAdapter$WriteResultCallback;->onWriteCancelled()V
2019-12-06 03:29:40 +00:00
goto :goto_0
2019-07-24 11:27:29 +00:00
:cond_0
if-nez p1, :cond_1
iget-object p1, p0, Landroidx/print/PrintHelper$1;->val$writeResultCallback:Landroid/print/PrintDocumentAdapter$WriteResultCallback;
const/4 v0, 0x1
new-array v0, v0, [Landroid/print/PageRange;
const/4 v1, 0x0
sget-object v2, Landroid/print/PageRange;->ALL_PAGES:Landroid/print/PageRange;
aput-object v2, v0, v1
invoke-virtual {p1, v0}, Landroid/print/PrintDocumentAdapter$WriteResultCallback;->onWriteFinished([Landroid/print/PageRange;)V
2019-12-06 03:29:40 +00:00
goto :goto_0
2019-07-24 11:27:29 +00:00
:cond_1
const-string v0, "PrintHelper"
const-string v1, "Error writing printed content"
invoke-static {v0, v1, p1}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I
iget-object p1, p0, Landroidx/print/PrintHelper$1;->val$writeResultCallback:Landroid/print/PrintDocumentAdapter$WriteResultCallback;
const/4 v0, 0x0
invoke-virtual {p1, v0}, Landroid/print/PrintDocumentAdapter$WriteResultCallback;->onWriteFailed(Ljava/lang/CharSequence;)V
2019-12-06 03:29:40 +00:00
:goto_0
2019-07-24 11:27:29 +00:00
return-void
.end method