b.smali
.class public Lcom/cmcm/ad/ui/util/b;
.super Ljava/lang/Object;
.source "BitmapUtil.java"
# direct methods
.method public static a(Ljava/lang/String;)Landroid/graphics/Bitmap;
.registers 3
.prologue
.line 31
new-instance v0, Ljava/io/File;
invoke-direct {v0, p0}, Ljava/io/File;-><init>(Ljava/lang/String;)V
.line 32
invoke-virtual {v0}, Ljava/io/File;->exists()Z
move-result v1
if-eqz v1, :cond_23
invoke-virtual {v0}, Ljava/io/File;->isFile()Z
move-result v1
if-eqz v1, :cond_23
invoke-virtual {v0}, Ljava/io/File;->canRead()Z
move-result v0
if-eqz v0, :cond_23
.line 33
invoke-static {p0}, Landroid/graphics/BitmapFactory;->decodeFile(Ljava/lang/String;)Landroid/graphics/Bitmap;
move-result-object v0
.line 34
if-eqz v0, :cond_23
.line 35
const/16 v1, 0x140
invoke-virtual {v0, v1}, Landroid/graphics/Bitmap;->setDensity(I)V
.line 39
:goto_22
return-object v0
:cond_23
const/4 v0, 0x0
goto :goto_22
.end method
.method public static b(Ljava/lang/String;)Landroid/graphics/Bitmap;
.registers 5
.prologue
const/4 v0, 0x0
.line 43
invoke-static {p0}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z
move-result v1
if-eqz v1, :cond_8
.line 62
:goto_7
return-object v0
.line 47
:cond_8
new-instance v1, Landroid/media/MediaMetadataRetriever;
invoke-direct {v1}, Landroid/media/MediaMetadataRetriever;-><init>()V
.line 49
:try_start_d
invoke-virtual {v1, p0}, Landroid/media/MediaMetadataRetriever;->setDataSource(Ljava/lang/String;)V
.line 50
const-wide/16 v2, -0x1
invoke-virtual {v1, v2, v3}, Landroid/media/MediaMetadataRetriever;->getFrameAtTime(J)Landroid/graphics/Bitmap;
:try_end_15
.catch Ljava/lang/IllegalArgumentException; {:try_start_d .. :try_end_15} :catch_1c
.catch Ljava/lang/RuntimeException; {:try_start_d .. :try_end_15} :catch_23
.catchall {:try_start_d .. :try_end_15} :catchall_2a
move-result-object v0
.line 57
:try_start_16
invoke-virtual {v1}, Landroid/media/MediaMetadataRetriever;->release()V
:try_end_19
.catch Ljava/lang/RuntimeException; {:try_start_16 .. :try_end_19} :catch_1a
goto :goto_7
.line 58
:catch_1a
move-exception v1
goto :goto_7
.line 51
:catch_1c
move-exception v2
.line 57
:try_start_1d
invoke-virtual {v1}, Landroid/media/MediaMetadataRetriever;->release()V
:try_end_20
.catch Ljava/lang/RuntimeException; {:try_start_1d .. :try_end_20} :catch_21
goto :goto_7
.line 58
:catch_21
move-exception v1
goto :goto_7
.line 53
:catch_23
move-exception v2
.line 57
:try_start_24
invoke-virtual {v1}, Landroid/media/MediaMetadataRetriever;->release()V
:try_end_27
.catch Ljava/lang/RuntimeException; {:try_start_24 .. :try_end_27} :catch_28
goto :goto_7
.line 58
:catch_28
move-exception v1
goto :goto_7
.line 56
:catchall_2a
move-exception v0
.line 57
:try_start_2b
invoke-virtual {v1}, Landroid/media/MediaMetadataRetriever;->release()V
:try_end_2e
.catch Ljava/lang/RuntimeException; {:try_start_2b .. :try_end_2e} :catch_2f
.line 60
:goto_2e
throw v0
.line 58
:catch_2f
move-exception v1
goto :goto_2e
.end method