994 lines
26 KiB
Smali
994 lines
26 KiB
Smali
.class public Lcom/facebook/webpsupport/WebpBitmapFactoryImpl;
|
|
.super Ljava/lang/Object;
|
|
.source "WebpBitmapFactoryImpl.java"
|
|
|
|
# interfaces
|
|
.implements Lf/g/d/m/b;
|
|
|
|
|
|
# annotations
|
|
.annotation build Lf/g/d/d/c;
|
|
.end annotation
|
|
|
|
|
|
# static fields
|
|
.field public static a:Lf/g/d/m/b$a;
|
|
|
|
.field public static b:Lf/g/d/m/a;
|
|
|
|
|
|
# direct methods
|
|
.method public constructor <init>()V
|
|
.locals 0
|
|
|
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public static c(Ljava/io/InputStream;Landroid/graphics/BitmapFactory$Options;)[B
|
|
.locals 2
|
|
|
|
const/16 v0, 0x14
|
|
|
|
invoke-virtual {p0, v0}, Ljava/io/InputStream;->mark(I)V
|
|
|
|
if-eqz p1, :cond_0
|
|
|
|
iget-object p1, p1, Landroid/graphics/BitmapFactory$Options;->inTempStorage:[B
|
|
|
|
if-eqz p1, :cond_0
|
|
|
|
array-length v1, p1
|
|
|
|
if-lt v1, v0, :cond_0
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
new-array p1, v0, [B
|
|
|
|
:goto_0
|
|
const/4 v1, 0x0
|
|
|
|
:try_start_0
|
|
invoke-virtual {p0, p1, v1, v0}, Ljava/io/InputStream;->read([BII)I
|
|
|
|
invoke-virtual {p0}, Ljava/io/InputStream;->reset()V
|
|
:try_end_0
|
|
.catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_0
|
|
|
|
return-object p1
|
|
|
|
:catch_0
|
|
const/4 p0, 0x0
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
.method public static createBitmap(IILandroid/graphics/BitmapFactory$Options;)Landroid/graphics/Bitmap;
|
|
.locals 6
|
|
.annotation build Lf/g/d/d/c;
|
|
.end annotation
|
|
|
|
if-eqz p2, :cond_0
|
|
|
|
iget-object v0, p2, Landroid/graphics/BitmapFactory$Options;->inBitmap:Landroid/graphics/Bitmap;
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
invoke-virtual {v0}, Landroid/graphics/Bitmap;->isMutable()Z
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
iget-object p0, p2, Landroid/graphics/BitmapFactory$Options;->inBitmap:Landroid/graphics/Bitmap;
|
|
|
|
return-object p0
|
|
|
|
:cond_0
|
|
sget-object p2, Lcom/facebook/webpsupport/WebpBitmapFactoryImpl;->b:Lf/g/d/m/a;
|
|
|
|
sget-object v0, Landroid/graphics/Bitmap$Config;->ARGB_8888:Landroid/graphics/Bitmap$Config;
|
|
|
|
check-cast p2, Lf/g/j/b/c;
|
|
|
|
iget-object v1, p2, Lf/g/j/b/c;->a:Lf/g/j/b/b;
|
|
|
|
int-to-short p0, p0
|
|
|
|
int-to-short p1, p1
|
|
|
|
invoke-virtual {v1, p0, p1}, Lf/g/j/b/b;->a(SS)Lcom/facebook/common/references/CloseableReference;
|
|
|
|
move-result-object p0
|
|
|
|
const/4 p1, 0x0
|
|
|
|
:try_start_0
|
|
new-instance v1, Lcom/facebook/imagepipeline/image/EncodedImage;
|
|
|
|
invoke-direct {v1, p0}, Lcom/facebook/imagepipeline/image/EncodedImage;-><init>(Lcom/facebook/common/references/CloseableReference;)V
|
|
:try_end_0
|
|
.catchall {:try_start_0 .. :try_end_0} :catchall_1
|
|
|
|
:try_start_1
|
|
sget-object v2, Lf/g/i/b;->a:Lf/g/i/c;
|
|
|
|
iput-object v2, v1, Lcom/facebook/imagepipeline/image/EncodedImage;->f:Lf/g/i/c;
|
|
|
|
iget v2, v1, Lcom/facebook/imagepipeline/image/EncodedImage;->k:I
|
|
|
|
new-instance v3, Landroid/graphics/BitmapFactory$Options;
|
|
|
|
invoke-direct {v3}, Landroid/graphics/BitmapFactory$Options;-><init>()V
|
|
|
|
const/4 v4, 0x1
|
|
|
|
iput-boolean v4, v3, Landroid/graphics/BitmapFactory$Options;->inDither:Z
|
|
|
|
iput-object v0, v3, Landroid/graphics/BitmapFactory$Options;->inPreferredConfig:Landroid/graphics/Bitmap$Config;
|
|
|
|
iput-boolean v4, v3, Landroid/graphics/BitmapFactory$Options;->inPurgeable:Z
|
|
|
|
iput-boolean v4, v3, Landroid/graphics/BitmapFactory$Options;->inInputShareable:Z
|
|
|
|
iput v2, v3, Landroid/graphics/BitmapFactory$Options;->inSampleSize:I
|
|
|
|
iput-boolean v4, v3, Landroid/graphics/BitmapFactory$Options;->inMutable:Z
|
|
|
|
invoke-virtual {p0}, Lcom/facebook/common/references/CloseableReference;->i()Ljava/lang/Object;
|
|
|
|
move-result-object v0
|
|
|
|
check-cast v0, Lcom/facebook/common/memory/PooledByteBuffer;
|
|
|
|
invoke-interface {v0}, Lcom/facebook/common/memory/PooledByteBuffer;->size()I
|
|
|
|
move-result v0
|
|
|
|
invoke-virtual {p0}, Lcom/facebook/common/references/CloseableReference;->i()Ljava/lang/Object;
|
|
|
|
move-result-object v2
|
|
|
|
check-cast v2, Lcom/facebook/common/memory/PooledByteBuffer;
|
|
|
|
iget-object p2, p2, Lf/g/j/b/c;->b:Lf/g/j/l/n;
|
|
|
|
add-int/lit8 v5, v0, 0x2
|
|
|
|
invoke-virtual {p2, v5}, Lf/g/j/l/n;->a(I)Lcom/facebook/common/references/CloseableReference;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-virtual {p1}, Lcom/facebook/common/references/CloseableReference;->i()Ljava/lang/Object;
|
|
|
|
move-result-object p2
|
|
|
|
check-cast p2, [B
|
|
|
|
const/4 v5, 0x0
|
|
|
|
invoke-interface {v2, v5, p2, v5, v0}, Lcom/facebook/common/memory/PooledByteBuffer;->l(I[BII)I
|
|
|
|
invoke-static {p2, v5, v0, v3}, Landroid/graphics/BitmapFactory;->decodeByteArray([BIILandroid/graphics/BitmapFactory$Options;)Landroid/graphics/Bitmap;
|
|
|
|
move-result-object p2
|
|
|
|
invoke-virtual {p2, v4}, Landroid/graphics/Bitmap;->setHasAlpha(Z)V
|
|
|
|
invoke-virtual {p2, v5}, Landroid/graphics/Bitmap;->eraseColor(I)V
|
|
:try_end_1
|
|
.catchall {:try_start_1 .. :try_end_1} :catchall_0
|
|
|
|
invoke-virtual {p1}, Lcom/facebook/common/references/CloseableReference;->close()V
|
|
|
|
invoke-virtual {v1}, Lcom/facebook/imagepipeline/image/EncodedImage;->close()V
|
|
|
|
invoke-virtual {p0}, Lcom/facebook/common/references/CloseableReference;->close()V
|
|
|
|
return-object p2
|
|
|
|
:catchall_0
|
|
move-exception p2
|
|
|
|
goto :goto_0
|
|
|
|
:catchall_1
|
|
move-exception p2
|
|
|
|
move-object v1, p1
|
|
|
|
:goto_0
|
|
if-eqz p1, :cond_1
|
|
|
|
invoke-virtual {p1}, Lcom/facebook/common/references/CloseableReference;->close()V
|
|
|
|
:cond_1
|
|
if-eqz v1, :cond_2
|
|
|
|
invoke-virtual {v1}, Lcom/facebook/imagepipeline/image/EncodedImage;->close()V
|
|
|
|
:cond_2
|
|
if-eqz p0, :cond_3
|
|
|
|
invoke-virtual {p0}, Lcom/facebook/common/references/CloseableReference;->close()V
|
|
|
|
:cond_3
|
|
throw p2
|
|
.end method
|
|
|
|
.method public static d(Ljava/lang/String;)V
|
|
.locals 2
|
|
|
|
sget-object v0, Lcom/facebook/webpsupport/WebpBitmapFactoryImpl;->a:Lf/g/d/m/b$a;
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
const-string v1, "decoding_failure"
|
|
|
|
invoke-interface {v0, p0, v1}, Lf/g/d/m/b$a;->a(Ljava/lang/String;Ljava/lang/String;)V
|
|
|
|
:cond_0
|
|
return-void
|
|
.end method
|
|
|
|
.method public static getInTempStorageFromOptions(Landroid/graphics/BitmapFactory$Options;)[B
|
|
.locals 0
|
|
.annotation build Lf/g/d/d/c;
|
|
.end annotation
|
|
|
|
if-eqz p0, :cond_0
|
|
|
|
iget-object p0, p0, Landroid/graphics/BitmapFactory$Options;->inTempStorage:[B
|
|
|
|
if-eqz p0, :cond_0
|
|
|
|
return-object p0
|
|
|
|
:cond_0
|
|
const/16 p0, 0x2000
|
|
|
|
new-array p0, p0, [B
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
.method public static getScaleFromOptions(Landroid/graphics/BitmapFactory$Options;)F
|
|
.locals 3
|
|
.annotation build Lf/g/d/d/c;
|
|
.end annotation
|
|
|
|
const/high16 v0, 0x3f800000 # 1.0f
|
|
|
|
if-eqz p0, :cond_1
|
|
|
|
iget v1, p0, Landroid/graphics/BitmapFactory$Options;->inSampleSize:I
|
|
|
|
const/4 v2, 0x1
|
|
|
|
if-le v1, v2, :cond_0
|
|
|
|
int-to-float v1, v1
|
|
|
|
div-float/2addr v0, v1
|
|
|
|
:cond_0
|
|
iget-boolean v1, p0, Landroid/graphics/BitmapFactory$Options;->inScaled:Z
|
|
|
|
if-eqz v1, :cond_1
|
|
|
|
iget v1, p0, Landroid/graphics/BitmapFactory$Options;->inDensity:I
|
|
|
|
iget v2, p0, Landroid/graphics/BitmapFactory$Options;->inTargetDensity:I
|
|
|
|
iget p0, p0, Landroid/graphics/BitmapFactory$Options;->inScreenDensity:I
|
|
|
|
if-eqz v1, :cond_1
|
|
|
|
if-eqz v2, :cond_1
|
|
|
|
if-eq v1, p0, :cond_1
|
|
|
|
int-to-float p0, v2
|
|
|
|
int-to-float v0, v1
|
|
|
|
div-float v0, p0, v0
|
|
|
|
:cond_1
|
|
return v0
|
|
.end method
|
|
|
|
.method public static hookDecodeByteArray([BII)Landroid/graphics/Bitmap;
|
|
.locals 1
|
|
.annotation build Lf/g/d/d/c;
|
|
.end annotation
|
|
|
|
const/4 v0, 0x0
|
|
|
|
invoke-static {p0, p1, p2, v0}, Lcom/facebook/webpsupport/WebpBitmapFactoryImpl;->hookDecodeByteArray([BIILandroid/graphics/BitmapFactory$Options;)Landroid/graphics/Bitmap;
|
|
|
|
move-result-object p0
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
.method public static hookDecodeByteArray([BIILandroid/graphics/BitmapFactory$Options;)Landroid/graphics/Bitmap;
|
|
.locals 1
|
|
.annotation build Lf/g/d/d/c;
|
|
.end annotation
|
|
|
|
invoke-static {}, Lf/g/j/m/c;->a()V
|
|
|
|
sget-boolean v0, Lf/g/d/m/c;->a:Z
|
|
|
|
invoke-static {p0, p1, p2, p3}, Lcom/facebook/webpsupport/WebpBitmapFactoryImpl;->originalDecodeByteArray([BIILandroid/graphics/BitmapFactory$Options;)Landroid/graphics/Bitmap;
|
|
|
|
move-result-object p0
|
|
|
|
if-nez p0, :cond_0
|
|
|
|
const-string p1, "webp_direct_decode_array_failed_on_no_webp"
|
|
|
|
invoke-static {p1}, Lcom/facebook/webpsupport/WebpBitmapFactoryImpl;->d(Ljava/lang/String;)V
|
|
|
|
:cond_0
|
|
return-object p0
|
|
.end method
|
|
|
|
.method public static hookDecodeFile(Ljava/lang/String;)Landroid/graphics/Bitmap;
|
|
.locals 1
|
|
.annotation build Lf/g/d/d/c;
|
|
.end annotation
|
|
|
|
const/4 v0, 0x0
|
|
|
|
invoke-static {p0, v0}, Lcom/facebook/webpsupport/WebpBitmapFactoryImpl;->hookDecodeFile(Ljava/lang/String;Landroid/graphics/BitmapFactory$Options;)Landroid/graphics/Bitmap;
|
|
|
|
move-result-object p0
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
.method public static hookDecodeFile(Ljava/lang/String;Landroid/graphics/BitmapFactory$Options;)Landroid/graphics/Bitmap;
|
|
.locals 2
|
|
.annotation build Lf/g/d/d/c;
|
|
.end annotation
|
|
|
|
const/4 v0, 0x0
|
|
|
|
:try_start_0
|
|
new-instance v1, Ljava/io/FileInputStream;
|
|
|
|
invoke-direct {v1, p0}, Ljava/io/FileInputStream;-><init>(Ljava/lang/String;)V
|
|
:try_end_0
|
|
.catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0
|
|
|
|
:try_start_1
|
|
invoke-static {v1, v0, p1}, Lcom/facebook/webpsupport/WebpBitmapFactoryImpl;->hookDecodeStream(Ljava/io/InputStream;Landroid/graphics/Rect;Landroid/graphics/BitmapFactory$Options;)Landroid/graphics/Bitmap;
|
|
|
|
move-result-object v0
|
|
:try_end_1
|
|
.catchall {:try_start_1 .. :try_end_1} :catchall_0
|
|
|
|
:try_start_2
|
|
invoke-virtual {v1}, Ljava/io/InputStream;->close()V
|
|
:try_end_2
|
|
.catch Ljava/lang/Exception; {:try_start_2 .. :try_end_2} :catch_0
|
|
|
|
goto :goto_1
|
|
|
|
:catchall_0
|
|
move-exception p0
|
|
|
|
:try_start_3
|
|
throw p0
|
|
:try_end_3
|
|
.catchall {:try_start_3 .. :try_end_3} :catchall_1
|
|
|
|
:catchall_1
|
|
move-exception p1
|
|
|
|
:try_start_4
|
|
invoke-virtual {v1}, Ljava/io/InputStream;->close()V
|
|
:try_end_4
|
|
.catchall {:try_start_4 .. :try_end_4} :catchall_2
|
|
|
|
goto :goto_0
|
|
|
|
:catchall_2
|
|
move-exception v1
|
|
|
|
:try_start_5
|
|
invoke-virtual {p0, v1}, Ljava/lang/Throwable;->addSuppressed(Ljava/lang/Throwable;)V
|
|
|
|
:goto_0
|
|
throw p1
|
|
:try_end_5
|
|
.catch Ljava/lang/Exception; {:try_start_5 .. :try_end_5} :catch_0
|
|
|
|
:catch_0
|
|
:goto_1
|
|
return-object v0
|
|
.end method
|
|
|
|
.method public static hookDecodeFileDescriptor(Ljava/io/FileDescriptor;)Landroid/graphics/Bitmap;
|
|
.locals 1
|
|
.annotation build Lf/g/d/d/c;
|
|
.end annotation
|
|
|
|
const/4 v0, 0x0
|
|
|
|
invoke-static {p0, v0, v0}, Lcom/facebook/webpsupport/WebpBitmapFactoryImpl;->hookDecodeFileDescriptor(Ljava/io/FileDescriptor;Landroid/graphics/Rect;Landroid/graphics/BitmapFactory$Options;)Landroid/graphics/Bitmap;
|
|
|
|
move-result-object p0
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
.method public static hookDecodeFileDescriptor(Ljava/io/FileDescriptor;Landroid/graphics/Rect;Landroid/graphics/BitmapFactory$Options;)Landroid/graphics/Bitmap;
|
|
.locals 5
|
|
.annotation build Lf/g/d/d/c;
|
|
.end annotation
|
|
|
|
invoke-static {}, Lf/g/j/m/c;->a()V
|
|
|
|
const-wide/16 v0, 0x0
|
|
|
|
const/4 v2, 0x0
|
|
|
|
invoke-static {p0, v0, v1, v2}, Lcom/facebook/webpsupport/WebpBitmapFactoryImpl;->nativeSeek(Ljava/io/FileDescriptor;JZ)J
|
|
|
|
move-result-wide v0
|
|
|
|
const-wide/16 v2, -0x1
|
|
|
|
cmp-long v4, v0, v2
|
|
|
|
if-eqz v4, :cond_2
|
|
|
|
new-instance v2, Ljava/io/FileInputStream;
|
|
|
|
invoke-direct {v2, p0}, Ljava/io/FileInputStream;-><init>(Ljava/io/FileDescriptor;)V
|
|
|
|
invoke-virtual {v2}, Ljava/io/InputStream;->markSupported()Z
|
|
|
|
move-result v3
|
|
|
|
if-nez v3, :cond_0
|
|
|
|
new-instance v3, Ljava/io/BufferedInputStream;
|
|
|
|
const/16 v4, 0x14
|
|
|
|
invoke-direct {v3, v2, v4}, Ljava/io/BufferedInputStream;-><init>(Ljava/io/InputStream;I)V
|
|
|
|
move-object v2, v3
|
|
|
|
:cond_0
|
|
:try_start_0
|
|
invoke-static {v2, p2}, Lcom/facebook/webpsupport/WebpBitmapFactoryImpl;->c(Ljava/io/InputStream;Landroid/graphics/BitmapFactory$Options;)[B
|
|
|
|
sget-boolean v3, Lf/g/d/m/c;->a:Z
|
|
|
|
const/4 v3, 0x1
|
|
|
|
invoke-static {p0, v0, v1, v3}, Lcom/facebook/webpsupport/WebpBitmapFactoryImpl;->nativeSeek(Ljava/io/FileDescriptor;JZ)J
|
|
|
|
invoke-static {p0, p1, p2}, Lcom/facebook/webpsupport/WebpBitmapFactoryImpl;->originalDecodeFileDescriptor(Ljava/io/FileDescriptor;Landroid/graphics/Rect;Landroid/graphics/BitmapFactory$Options;)Landroid/graphics/Bitmap;
|
|
|
|
move-result-object p0
|
|
|
|
if-nez p0, :cond_1
|
|
|
|
const-string p1, "webp_direct_decode_fd_failed_on_no_webp"
|
|
|
|
invoke-static {p1}, Lcom/facebook/webpsupport/WebpBitmapFactoryImpl;->d(Ljava/lang/String;)V
|
|
:try_end_0
|
|
.catchall {:try_start_0 .. :try_end_0} :catchall_0
|
|
|
|
:cond_1
|
|
:try_start_1
|
|
invoke-virtual {v2}, Ljava/io/InputStream;->close()V
|
|
:try_end_1
|
|
.catchall {:try_start_1 .. :try_end_1} :catchall_2
|
|
|
|
goto :goto_0
|
|
|
|
:catchall_0
|
|
move-exception p0
|
|
|
|
:try_start_2
|
|
invoke-virtual {v2}, Ljava/io/InputStream;->close()V
|
|
:try_end_2
|
|
.catchall {:try_start_2 .. :try_end_2} :catchall_1
|
|
|
|
:catchall_1
|
|
throw p0
|
|
|
|
:cond_2
|
|
new-instance v0, Ljava/io/FileInputStream;
|
|
|
|
invoke-direct {v0, p0}, Ljava/io/FileInputStream;-><init>(Ljava/io/FileDescriptor;)V
|
|
|
|
invoke-static {v0, p1, p2}, Lcom/facebook/webpsupport/WebpBitmapFactoryImpl;->hookDecodeStream(Ljava/io/InputStream;Landroid/graphics/Rect;Landroid/graphics/BitmapFactory$Options;)Landroid/graphics/Bitmap;
|
|
|
|
move-result-object p0
|
|
|
|
invoke-static {p1}, Lcom/facebook/webpsupport/WebpBitmapFactoryImpl;->setPaddingDefaultValues(Landroid/graphics/Rect;)V
|
|
|
|
:catchall_2
|
|
:goto_0
|
|
return-object p0
|
|
.end method
|
|
|
|
.method public static hookDecodeResource(Landroid/content/res/Resources;I)Landroid/graphics/Bitmap;
|
|
.locals 1
|
|
.annotation build Lf/g/d/d/c;
|
|
.end annotation
|
|
|
|
const/4 v0, 0x0
|
|
|
|
invoke-static {p0, p1, v0}, Lcom/facebook/webpsupport/WebpBitmapFactoryImpl;->hookDecodeResource(Landroid/content/res/Resources;ILandroid/graphics/BitmapFactory$Options;)Landroid/graphics/Bitmap;
|
|
|
|
move-result-object p0
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
.method public static hookDecodeResource(Landroid/content/res/Resources;ILandroid/graphics/BitmapFactory$Options;)Landroid/graphics/Bitmap;
|
|
.locals 2
|
|
.annotation build Lf/g/d/d/c;
|
|
.end annotation
|
|
|
|
new-instance v0, Landroid/util/TypedValue;
|
|
|
|
invoke-direct {v0}, Landroid/util/TypedValue;-><init>()V
|
|
|
|
const/4 v1, 0x0
|
|
|
|
:try_start_0
|
|
invoke-virtual {p0, p1, v0}, Landroid/content/res/Resources;->openRawResource(ILandroid/util/TypedValue;)Ljava/io/InputStream;
|
|
|
|
move-result-object p1
|
|
:try_end_0
|
|
.catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0
|
|
|
|
:try_start_1
|
|
invoke-static {p0, v0, p1, v1, p2}, Lcom/facebook/webpsupport/WebpBitmapFactoryImpl;->hookDecodeResourceStream(Landroid/content/res/Resources;Landroid/util/TypedValue;Ljava/io/InputStream;Landroid/graphics/Rect;Landroid/graphics/BitmapFactory$Options;)Landroid/graphics/Bitmap;
|
|
|
|
move-result-object v1
|
|
:try_end_1
|
|
.catchall {:try_start_1 .. :try_end_1} :catchall_0
|
|
|
|
if-eqz p1, :cond_1
|
|
|
|
:try_start_2
|
|
invoke-virtual {p1}, Ljava/io/InputStream;->close()V
|
|
:try_end_2
|
|
.catch Ljava/lang/Exception; {:try_start_2 .. :try_end_2} :catch_0
|
|
|
|
goto :goto_1
|
|
|
|
:catchall_0
|
|
move-exception p0
|
|
|
|
:try_start_3
|
|
throw p0
|
|
:try_end_3
|
|
.catchall {:try_start_3 .. :try_end_3} :catchall_1
|
|
|
|
:catchall_1
|
|
move-exception v0
|
|
|
|
if-eqz p1, :cond_0
|
|
|
|
:try_start_4
|
|
invoke-virtual {p1}, Ljava/io/InputStream;->close()V
|
|
:try_end_4
|
|
.catchall {:try_start_4 .. :try_end_4} :catchall_2
|
|
|
|
goto :goto_0
|
|
|
|
:catchall_2
|
|
move-exception p1
|
|
|
|
:try_start_5
|
|
invoke-virtual {p0, p1}, Ljava/lang/Throwable;->addSuppressed(Ljava/lang/Throwable;)V
|
|
|
|
:cond_0
|
|
:goto_0
|
|
throw v0
|
|
:try_end_5
|
|
.catch Ljava/lang/Exception; {:try_start_5 .. :try_end_5} :catch_0
|
|
|
|
:catch_0
|
|
:cond_1
|
|
:goto_1
|
|
if-nez v1, :cond_3
|
|
|
|
if-eqz p2, :cond_3
|
|
|
|
iget-object p0, p2, Landroid/graphics/BitmapFactory$Options;->inBitmap:Landroid/graphics/Bitmap;
|
|
|
|
if-nez p0, :cond_2
|
|
|
|
goto :goto_2
|
|
|
|
:cond_2
|
|
new-instance p0, Ljava/lang/IllegalArgumentException;
|
|
|
|
const-string p1, "Problem decoding into existing bitmap"
|
|
|
|
invoke-direct {p0, p1}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw p0
|
|
|
|
:cond_3
|
|
:goto_2
|
|
return-object v1
|
|
.end method
|
|
|
|
.method public static hookDecodeResourceStream(Landroid/content/res/Resources;Landroid/util/TypedValue;Ljava/io/InputStream;Landroid/graphics/Rect;Landroid/graphics/BitmapFactory$Options;)Landroid/graphics/Bitmap;
|
|
.locals 1
|
|
.annotation build Lf/g/d/d/c;
|
|
.end annotation
|
|
|
|
if-nez p4, :cond_0
|
|
|
|
new-instance p4, Landroid/graphics/BitmapFactory$Options;
|
|
|
|
invoke-direct {p4}, Landroid/graphics/BitmapFactory$Options;-><init>()V
|
|
|
|
:cond_0
|
|
iget v0, p4, Landroid/graphics/BitmapFactory$Options;->inDensity:I
|
|
|
|
if-nez v0, :cond_2
|
|
|
|
if-eqz p1, :cond_2
|
|
|
|
iget p1, p1, Landroid/util/TypedValue;->density:I
|
|
|
|
if-nez p1, :cond_1
|
|
|
|
const/16 p1, 0xa0
|
|
|
|
iput p1, p4, Landroid/graphics/BitmapFactory$Options;->inDensity:I
|
|
|
|
goto :goto_0
|
|
|
|
:cond_1
|
|
const v0, 0xffff
|
|
|
|
if-eq p1, v0, :cond_2
|
|
|
|
iput p1, p4, Landroid/graphics/BitmapFactory$Options;->inDensity:I
|
|
|
|
:cond_2
|
|
:goto_0
|
|
iget p1, p4, Landroid/graphics/BitmapFactory$Options;->inTargetDensity:I
|
|
|
|
if-nez p1, :cond_3
|
|
|
|
if-eqz p0, :cond_3
|
|
|
|
invoke-virtual {p0}, Landroid/content/res/Resources;->getDisplayMetrics()Landroid/util/DisplayMetrics;
|
|
|
|
move-result-object p0
|
|
|
|
iget p0, p0, Landroid/util/DisplayMetrics;->densityDpi:I
|
|
|
|
iput p0, p4, Landroid/graphics/BitmapFactory$Options;->inTargetDensity:I
|
|
|
|
:cond_3
|
|
invoke-static {p2, p3, p4}, Lcom/facebook/webpsupport/WebpBitmapFactoryImpl;->hookDecodeStream(Ljava/io/InputStream;Landroid/graphics/Rect;Landroid/graphics/BitmapFactory$Options;)Landroid/graphics/Bitmap;
|
|
|
|
move-result-object p0
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
.method public static hookDecodeStream(Ljava/io/InputStream;)Landroid/graphics/Bitmap;
|
|
.locals 1
|
|
.annotation build Lf/g/d/d/c;
|
|
.end annotation
|
|
|
|
const/4 v0, 0x0
|
|
|
|
invoke-static {p0, v0, v0}, Lcom/facebook/webpsupport/WebpBitmapFactoryImpl;->hookDecodeStream(Ljava/io/InputStream;Landroid/graphics/Rect;Landroid/graphics/BitmapFactory$Options;)Landroid/graphics/Bitmap;
|
|
|
|
move-result-object p0
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
.method public static hookDecodeStream(Ljava/io/InputStream;Landroid/graphics/Rect;Landroid/graphics/BitmapFactory$Options;)Landroid/graphics/Bitmap;
|
|
.locals 2
|
|
.annotation build Lf/g/d/d/c;
|
|
.end annotation
|
|
|
|
invoke-static {}, Lf/g/j/m/c;->a()V
|
|
|
|
invoke-virtual {p0}, Ljava/io/InputStream;->markSupported()Z
|
|
|
|
move-result v0
|
|
|
|
if-nez v0, :cond_0
|
|
|
|
new-instance v0, Ljava/io/BufferedInputStream;
|
|
|
|
const/16 v1, 0x14
|
|
|
|
invoke-direct {v0, p0, v1}, Ljava/io/BufferedInputStream;-><init>(Ljava/io/InputStream;I)V
|
|
|
|
move-object p0, v0
|
|
|
|
:cond_0
|
|
invoke-static {p0, p2}, Lcom/facebook/webpsupport/WebpBitmapFactoryImpl;->c(Ljava/io/InputStream;Landroid/graphics/BitmapFactory$Options;)[B
|
|
|
|
sget-boolean v0, Lf/g/d/m/c;->a:Z
|
|
|
|
invoke-static {p0, p1, p2}, Lcom/facebook/webpsupport/WebpBitmapFactoryImpl;->originalDecodeStream(Ljava/io/InputStream;Landroid/graphics/Rect;Landroid/graphics/BitmapFactory$Options;)Landroid/graphics/Bitmap;
|
|
|
|
move-result-object p0
|
|
|
|
if-nez p0, :cond_1
|
|
|
|
const-string p1, "webp_direct_decode_stream_failed_on_no_webp"
|
|
|
|
invoke-static {p1}, Lcom/facebook/webpsupport/WebpBitmapFactoryImpl;->d(Ljava/lang/String;)V
|
|
|
|
:cond_1
|
|
return-object p0
|
|
.end method
|
|
|
|
.method public static native nativeDecodeByteArray([BIILandroid/graphics/BitmapFactory$Options;F[B)Landroid/graphics/Bitmap;
|
|
.annotation build Lf/g/d/d/c;
|
|
.end annotation
|
|
.end method
|
|
|
|
.method public static native nativeDecodeStream(Ljava/io/InputStream;Landroid/graphics/BitmapFactory$Options;F[B)Landroid/graphics/Bitmap;
|
|
.annotation build Lf/g/d/d/c;
|
|
.end annotation
|
|
.end method
|
|
|
|
.method public static native nativeSeek(Ljava/io/FileDescriptor;JZ)J
|
|
.annotation build Lf/g/d/d/c;
|
|
.end annotation
|
|
.end method
|
|
|
|
.method public static originalDecodeByteArray([BII)Landroid/graphics/Bitmap;
|
|
.locals 0
|
|
.annotation build Lf/g/d/d/c;
|
|
.end annotation
|
|
|
|
invoke-static {p0, p1, p2}, Landroid/graphics/BitmapFactory;->decodeByteArray([BII)Landroid/graphics/Bitmap;
|
|
|
|
move-result-object p0
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
.method public static originalDecodeByteArray([BIILandroid/graphics/BitmapFactory$Options;)Landroid/graphics/Bitmap;
|
|
.locals 0
|
|
.annotation build Lf/g/d/d/c;
|
|
.end annotation
|
|
|
|
invoke-static {p0, p1, p2, p3}, Landroid/graphics/BitmapFactory;->decodeByteArray([BIILandroid/graphics/BitmapFactory$Options;)Landroid/graphics/Bitmap;
|
|
|
|
move-result-object p0
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
.method public static originalDecodeFile(Ljava/lang/String;)Landroid/graphics/Bitmap;
|
|
.locals 0
|
|
.annotation build Lf/g/d/d/c;
|
|
.end annotation
|
|
|
|
invoke-static {p0}, Landroid/graphics/BitmapFactory;->decodeFile(Ljava/lang/String;)Landroid/graphics/Bitmap;
|
|
|
|
move-result-object p0
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
.method public static originalDecodeFile(Ljava/lang/String;Landroid/graphics/BitmapFactory$Options;)Landroid/graphics/Bitmap;
|
|
.locals 0
|
|
.annotation build Lf/g/d/d/c;
|
|
.end annotation
|
|
|
|
invoke-static {p0, p1}, Landroid/graphics/BitmapFactory;->decodeFile(Ljava/lang/String;Landroid/graphics/BitmapFactory$Options;)Landroid/graphics/Bitmap;
|
|
|
|
move-result-object p0
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
.method public static originalDecodeFileDescriptor(Ljava/io/FileDescriptor;)Landroid/graphics/Bitmap;
|
|
.locals 0
|
|
.annotation build Lf/g/d/d/c;
|
|
.end annotation
|
|
|
|
invoke-static {p0}, Landroid/graphics/BitmapFactory;->decodeFileDescriptor(Ljava/io/FileDescriptor;)Landroid/graphics/Bitmap;
|
|
|
|
move-result-object p0
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
.method public static originalDecodeFileDescriptor(Ljava/io/FileDescriptor;Landroid/graphics/Rect;Landroid/graphics/BitmapFactory$Options;)Landroid/graphics/Bitmap;
|
|
.locals 0
|
|
.annotation build Lf/g/d/d/c;
|
|
.end annotation
|
|
|
|
invoke-static {p0, p1, p2}, Landroid/graphics/BitmapFactory;->decodeFileDescriptor(Ljava/io/FileDescriptor;Landroid/graphics/Rect;Landroid/graphics/BitmapFactory$Options;)Landroid/graphics/Bitmap;
|
|
|
|
move-result-object p0
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
.method public static originalDecodeResource(Landroid/content/res/Resources;I)Landroid/graphics/Bitmap;
|
|
.locals 0
|
|
.annotation build Lf/g/d/d/c;
|
|
.end annotation
|
|
|
|
invoke-static {p0, p1}, Landroid/graphics/BitmapFactory;->decodeResource(Landroid/content/res/Resources;I)Landroid/graphics/Bitmap;
|
|
|
|
move-result-object p0
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
.method public static originalDecodeResource(Landroid/content/res/Resources;ILandroid/graphics/BitmapFactory$Options;)Landroid/graphics/Bitmap;
|
|
.locals 0
|
|
.annotation build Lf/g/d/d/c;
|
|
.end annotation
|
|
|
|
invoke-static {p0, p1, p2}, Landroid/graphics/BitmapFactory;->decodeResource(Landroid/content/res/Resources;ILandroid/graphics/BitmapFactory$Options;)Landroid/graphics/Bitmap;
|
|
|
|
move-result-object p0
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
.method public static originalDecodeResourceStream(Landroid/content/res/Resources;Landroid/util/TypedValue;Ljava/io/InputStream;Landroid/graphics/Rect;Landroid/graphics/BitmapFactory$Options;)Landroid/graphics/Bitmap;
|
|
.locals 0
|
|
.annotation build Lf/g/d/d/c;
|
|
.end annotation
|
|
|
|
invoke-static {p0, p1, p2, p3, p4}, Landroid/graphics/BitmapFactory;->decodeResourceStream(Landroid/content/res/Resources;Landroid/util/TypedValue;Ljava/io/InputStream;Landroid/graphics/Rect;Landroid/graphics/BitmapFactory$Options;)Landroid/graphics/Bitmap;
|
|
|
|
move-result-object p0
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
.method public static originalDecodeStream(Ljava/io/InputStream;)Landroid/graphics/Bitmap;
|
|
.locals 0
|
|
.annotation build Lf/g/d/d/c;
|
|
.end annotation
|
|
|
|
invoke-static {p0}, Landroid/graphics/BitmapFactory;->decodeStream(Ljava/io/InputStream;)Landroid/graphics/Bitmap;
|
|
|
|
move-result-object p0
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
.method public static originalDecodeStream(Ljava/io/InputStream;Landroid/graphics/Rect;Landroid/graphics/BitmapFactory$Options;)Landroid/graphics/Bitmap;
|
|
.locals 0
|
|
.annotation build Lf/g/d/d/c;
|
|
.end annotation
|
|
|
|
invoke-static {p0, p1, p2}, Landroid/graphics/BitmapFactory;->decodeStream(Ljava/io/InputStream;Landroid/graphics/Rect;Landroid/graphics/BitmapFactory$Options;)Landroid/graphics/Bitmap;
|
|
|
|
move-result-object p0
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
.method public static setBitmapSize(Landroid/graphics/BitmapFactory$Options;II)V
|
|
.locals 0
|
|
.annotation build Lf/g/d/d/c;
|
|
.end annotation
|
|
|
|
if-eqz p0, :cond_0
|
|
|
|
iput p1, p0, Landroid/graphics/BitmapFactory$Options;->outWidth:I
|
|
|
|
iput p2, p0, Landroid/graphics/BitmapFactory$Options;->outHeight:I
|
|
|
|
:cond_0
|
|
return-void
|
|
.end method
|
|
|
|
.method public static setOutDimensions(Landroid/graphics/BitmapFactory$Options;II)Z
|
|
.locals 1
|
|
.annotation build Lf/g/d/d/c;
|
|
.end annotation
|
|
|
|
if-eqz p0, :cond_0
|
|
|
|
iget-boolean v0, p0, Landroid/graphics/BitmapFactory$Options;->inJustDecodeBounds:Z
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
iput p1, p0, Landroid/graphics/BitmapFactory$Options;->outWidth:I
|
|
|
|
iput p2, p0, Landroid/graphics/BitmapFactory$Options;->outHeight:I
|
|
|
|
const/4 p0, 0x1
|
|
|
|
return p0
|
|
|
|
:cond_0
|
|
const/4 p0, 0x0
|
|
|
|
return p0
|
|
.end method
|
|
|
|
.method public static setPaddingDefaultValues(Landroid/graphics/Rect;)V
|
|
.locals 1
|
|
.annotation build Lf/g/d/d/c;
|
|
.end annotation
|
|
|
|
if-eqz p0, :cond_0
|
|
|
|
const/4 v0, -0x1
|
|
|
|
iput v0, p0, Landroid/graphics/Rect;->top:I
|
|
|
|
iput v0, p0, Landroid/graphics/Rect;->left:I
|
|
|
|
iput v0, p0, Landroid/graphics/Rect;->bottom:I
|
|
|
|
iput v0, p0, Landroid/graphics/Rect;->right:I
|
|
|
|
:cond_0
|
|
return-void
|
|
.end method
|
|
|
|
.method public static shouldPremultiply(Landroid/graphics/BitmapFactory$Options;)Z
|
|
.locals 0
|
|
.annotation build Landroid/annotation/SuppressLint;
|
|
value = {
|
|
"NewApi"
|
|
}
|
|
.end annotation
|
|
|
|
.annotation build Lf/g/d/d/c;
|
|
.end annotation
|
|
|
|
if-eqz p0, :cond_0
|
|
|
|
iget-boolean p0, p0, Landroid/graphics/BitmapFactory$Options;->inPremultiplied:Z
|
|
|
|
return p0
|
|
|
|
:cond_0
|
|
const/4 p0, 0x1
|
|
|
|
return p0
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public a(Lf/g/d/m/a;)V
|
|
.locals 0
|
|
|
|
sput-object p1, Lcom/facebook/webpsupport/WebpBitmapFactoryImpl;->b:Lf/g/d/m/a;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public b(Lf/g/d/m/b$a;)V
|
|
.locals 0
|
|
|
|
sput-object p1, Lcom/facebook/webpsupport/WebpBitmapFactoryImpl;->a:Lf/g/d/m/b$a;
|
|
|
|
return-void
|
|
.end method
|