You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
2994 lines
64 KiB
2994 lines
64 KiB
2 years ago
|
.class public Lcom/viatech/gallery/GalleryUtil;
|
||
|
.super Ljava/lang/Object;
|
||
|
.source "GalleryUtil.java"
|
||
|
|
||
|
|
||
|
# static fields
|
||
|
.field public static final LIST_AIR:I = 0x8
|
||
|
|
||
|
.field public static final LIST_ALL:I = 0x0
|
||
|
|
||
|
.field public static final LIST_APK:I = 0x4
|
||
|
|
||
|
.field public static final LIST_APP:I = 0x6
|
||
|
|
||
|
.field public static final LIST_AUDIO:I = 0x3
|
||
|
|
||
|
.field public static final LIST_DOCUMENT:I = 0x5
|
||
|
|
||
|
.field public static final LIST_IMAGE:I = 0x1
|
||
|
|
||
|
.field public static final LIST_VIDEO:I = 0x2
|
||
|
|
||
|
.field public static final LIST_WIFI:I = 0x7
|
||
|
|
||
|
.field public static final ROOT_PATH:Ljava/lang/String; = "/"
|
||
|
|
||
|
.field private static final TAG:Ljava/lang/String; = "Vpai_Util"
|
||
|
|
||
|
.field public static final THUMB_BASE_WH:I = 0x60
|
||
|
|
||
|
.field public static THUMB_WH:I
|
||
|
|
||
|
.field public static sNullBitmap:Landroid/graphics/Bitmap;
|
||
|
|
||
|
|
||
|
# direct methods
|
||
|
.method static constructor <clinit>()V
|
||
|
.locals 2
|
||
|
|
||
|
.prologue
|
||
|
const/4 v1, 0x1
|
||
|
|
||
|
.line 52
|
||
|
const/16 v0, 0x60
|
||
|
|
||
|
sput v0, Lcom/viatech/gallery/GalleryUtil;->THUMB_WH:I
|
||
|
|
||
|
.line 53
|
||
|
sget-object v0, Landroid/graphics/Bitmap$Config;->RGB_565:Landroid/graphics/Bitmap$Config;
|
||
|
|
||
|
invoke-static {v1, v1, v0}, Landroid/graphics/Bitmap;->createBitmap(IILandroid/graphics/Bitmap$Config;)Landroid/graphics/Bitmap;
|
||
|
|
||
|
move-result-object v0
|
||
|
|
||
|
sput-object v0, Lcom/viatech/gallery/GalleryUtil;->sNullBitmap:Landroid/graphics/Bitmap;
|
||
|
|
||
|
return-void
|
||
|
.end method
|
||
|
|
||
|
.method public constructor <init>()V
|
||
|
.locals 0
|
||
|
|
||
|
.prologue
|
||
|
.line 38
|
||
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
||
|
|
||
|
return-void
|
||
|
.end method
|
||
|
|
||
|
.method public static clipBitmap(Landroid/graphics/Bitmap;II)Landroid/graphics/Bitmap;
|
||
|
.locals 7
|
||
|
|
||
|
.prologue
|
||
|
const/4 v1, 0x0
|
||
|
|
||
|
.line 330
|
||
|
const/4 v5, 0x0
|
||
|
|
||
|
move-object v0, p0
|
||
|
|
||
|
move v2, v1
|
||
|
|
||
|
move v3, p1
|
||
|
|
||
|
move v4, p2
|
||
|
|
||
|
move v6, v1
|
||
|
|
||
|
invoke-static/range {v0 .. v6}, Landroid/graphics/Bitmap;->createBitmap(Landroid/graphics/Bitmap;IIIILandroid/graphics/Matrix;Z)Landroid/graphics/Bitmap;
|
||
|
|
||
|
move-result-object v0
|
||
|
|
||
|
.line 333
|
||
|
return-object v0
|
||
|
.end method
|
||
|
|
||
|
.method private static computeInitialSampleSize(Landroid/graphics/BitmapFactory$Options;II)I
|
||
|
.locals 11
|
||
|
|
||
|
.prologue
|
||
|
const/4 v1, 0x1
|
||
|
|
||
|
const/4 v10, -0x1
|
||
|
|
||
|
.line 304
|
||
|
iget v0, p0, Landroid/graphics/BitmapFactory$Options;->outWidth:I
|
||
|
|
||
|
int-to-double v2, v0
|
||
|
|
||
|
.line 305
|
||
|
iget v0, p0, Landroid/graphics/BitmapFactory$Options;->outHeight:I
|
||
|
|
||
|
int-to-double v4, v0
|
||
|
|
||
|
.line 307
|
||
|
if-ne p2, v10, :cond_1
|
||
|
|
||
|
move v0, v1
|
||
|
|
||
|
.line 309
|
||
|
:goto_0
|
||
|
if-ne p1, v10, :cond_2
|
||
|
|
||
|
const/16 v2, 0x80
|
||
|
|
||
|
.line 313
|
||
|
:goto_1
|
||
|
if-ge v2, v0, :cond_3
|
||
|
|
||
|
.line 324
|
||
|
:cond_0
|
||
|
:goto_2
|
||
|
return v0
|
||
|
|
||
|
.line 307
|
||
|
:cond_1
|
||
|
mul-double v6, v2, v4
|
||
|
|
||
|
int-to-double v8, p2
|
||
|
|
||
|
div-double/2addr v6, v8
|
||
|
|
||
|
.line 308
|
||
|
invoke-static {v6, v7}, Ljava/lang/Math;->sqrt(D)D
|
||
|
|
||
|
move-result-wide v6
|
||
|
|
||
|
invoke-static {v6, v7}, Ljava/lang/Math;->ceil(D)D
|
||
|
|
||
|
move-result-wide v6
|
||
|
|
||
|
double-to-int v0, v6
|
||
|
|
||
|
goto :goto_0
|
||
|
|
||
|
.line 309
|
||
|
:cond_2
|
||
|
int-to-double v6, p1
|
||
|
|
||
|
div-double/2addr v2, v6
|
||
|
|
||
|
.line 310
|
||
|
invoke-static {v2, v3}, Ljava/lang/Math;->floor(D)D
|
||
|
|
||
|
move-result-wide v2
|
||
|
|
||
|
int-to-double v6, p1
|
||
|
|
||
|
div-double/2addr v4, v6
|
||
|
|
||
|
.line 311
|
||
|
invoke-static {v4, v5}, Ljava/lang/Math;->floor(D)D
|
||
|
|
||
|
move-result-wide v4
|
||
|
|
||
|
.line 310
|
||
|
invoke-static {v2, v3, v4, v5}, Ljava/lang/Math;->min(DD)D
|
||
|
|
||
|
move-result-wide v2
|
||
|
|
||
|
double-to-int v2, v2
|
||
|
|
||
|
goto :goto_1
|
||
|
|
||
|
.line 318
|
||
|
:cond_3
|
||
|
if-ne p2, v10, :cond_4
|
||
|
|
||
|
if-ne p1, v10, :cond_4
|
||
|
|
||
|
move v0, v1
|
||
|
|
||
|
.line 320
|
||
|
goto :goto_2
|
||
|
|
||
|
.line 321
|
||
|
:cond_4
|
||
|
if-eq p1, v10, :cond_0
|
||
|
|
||
|
move v0, v2
|
||
|
|
||
|
.line 324
|
||
|
goto :goto_2
|
||
|
.end method
|
||
|
|
||
|
.method public static computeSampleSize(Landroid/graphics/BitmapFactory$Options;II)I
|
||
|
.locals 2
|
||
|
|
||
|
.prologue
|
||
|
.line 286
|
||
|
invoke-static {p0, p1, p2}, Lcom/viatech/gallery/GalleryUtil;->computeInitialSampleSize(Landroid/graphics/BitmapFactory$Options;II)I
|
||
|
|
||
|
move-result v1
|
||
|
|
||
|
.line 290
|
||
|
const/16 v0, 0x8
|
||
|
|
||
|
if-gt v1, v0, :cond_0
|
||
|
|
||
|
.line 291
|
||
|
const/4 v0, 0x1
|
||
|
|
||
|
.line 292
|
||
|
:goto_0
|
||
|
if-ge v0, v1, :cond_1
|
||
|
|
||
|
.line 293
|
||
|
shl-int/lit8 v0, v0, 0x1
|
||
|
|
||
|
goto :goto_0
|
||
|
|
||
|
.line 296
|
||
|
:cond_0
|
||
|
add-int/lit8 v0, v1, 0x7
|
||
|
|
||
|
div-int/lit8 v0, v0, 0x8
|
||
|
|
||
|
mul-int/lit8 v0, v0, 0x8
|
||
|
|
||
|
.line 299
|
||
|
:cond_1
|
||
|
return v0
|
||
|
.end method
|
||
|
|
||
|
.method public static createVideoThumbnail(Ljava/lang/String;)Landroid/graphics/Bitmap;
|
||
|
.locals 4
|
||
|
|
||
|
.prologue
|
||
|
.line 598
|
||
|
const/4 v0, 0x0
|
||
|
|
||
|
.line 599
|
||
|
new-instance v1, Landroid/media/MediaMetadataRetriever;
|
||
|
|
||
|
invoke-direct {v1}, Landroid/media/MediaMetadataRetriever;-><init>()V
|
||
|
|
||
|
.line 602
|
||
|
:try_start_0
|
||
|
sget v2, Landroid/os/Build$VERSION;->SDK_INT:I
|
||
|
|
||
|
const/16 v3, 0xe
|
||
|
|
||
|
if-lt v2, v3, :cond_0
|
||
|
|
||
|
.line 603
|
||
|
new-instance v2, Ljava/util/HashMap;
|
||
|
|
||
|
invoke-direct {v2}, Ljava/util/HashMap;-><init>()V
|
||
|
|
||
|
invoke-virtual {v1, p0, v2}, Landroid/media/MediaMetadataRetriever;->setDataSource(Ljava/lang/String;Ljava/util/Map;)V
|
||
|
|
||
|
.line 607
|
||
|
:goto_0
|
||
|
invoke-virtual {v1}, Landroid/media/MediaMetadataRetriever;->getFrameAtTime()Landroid/graphics/Bitmap;
|
||
|
:try_end_0
|
||
|
.catch Ljava/lang/IllegalArgumentException; {:try_start_0 .. :try_end_0} :catch_0
|
||
|
.catch Ljava/lang/RuntimeException; {:try_start_0 .. :try_end_0} :catch_2
|
||
|
.catchall {:try_start_0 .. :try_end_0} :catchall_0
|
||
|
|
||
|
move-result-object v0
|
||
|
|
||
|
.line 614
|
||
|
:try_start_1
|
||
|
invoke-virtual {v1}, Landroid/media/MediaMetadataRetriever;->release()V
|
||
|
:try_end_1
|
||
|
.catch Ljava/lang/RuntimeException; {:try_start_1 .. :try_end_1} :catch_4
|
||
|
|
||
|
.line 623
|
||
|
:goto_1
|
||
|
return-object v0
|
||
|
|
||
|
.line 605
|
||
|
:cond_0
|
||
|
:try_start_2
|
||
|
invoke-virtual {v1, p0}, Landroid/media/MediaMetadataRetriever;->setDataSource(Ljava/lang/String;)V
|
||
|
:try_end_2
|
||
|
.catch Ljava/lang/IllegalArgumentException; {:try_start_2 .. :try_end_2} :catch_0
|
||
|
.catch Ljava/lang/RuntimeException; {:try_start_2 .. :try_end_2} :catch_2
|
||
|
.catchall {:try_start_2 .. :try_end_2} :catchall_0
|
||
|
|
||
|
goto :goto_0
|
||
|
|
||
|
.line 608
|
||
|
:catch_0
|
||
|
move-exception v2
|
||
|
|
||
|
.line 614
|
||
|
:try_start_3
|
||
|
invoke-virtual {v1}, Landroid/media/MediaMetadataRetriever;->release()V
|
||
|
:try_end_3
|
||
|
.catch Ljava/lang/RuntimeException; {:try_start_3 .. :try_end_3} :catch_1
|
||
|
|
||
|
goto :goto_1
|
||
|
|
||
|
.line 615
|
||
|
:catch_1
|
||
|
move-exception v1
|
||
|
|
||
|
goto :goto_1
|
||
|
|
||
|
.line 610
|
||
|
:catch_2
|
||
|
move-exception v2
|
||
|
|
||
|
.line 614
|
||
|
:try_start_4
|
||
|
invoke-virtual {v1}, Landroid/media/MediaMetadataRetriever;->release()V
|
||
|
:try_end_4
|
||
|
.catch Ljava/lang/RuntimeException; {:try_start_4 .. :try_end_4} :catch_3
|
||
|
|
||
|
goto :goto_1
|
||
|
|
||
|
.line 615
|
||
|
:catch_3
|
||
|
move-exception v1
|
||
|
|
||
|
goto :goto_1
|
||
|
|
||
|
.line 613
|
||
|
:catchall_0
|
||
|
move-exception v0
|
||
|
|
||
|
.line 614
|
||
|
:try_start_5
|
||
|
invoke-virtual {v1}, Landroid/media/MediaMetadataRetriever;->release()V
|
||
|
:try_end_5
|
||
|
.catch Ljava/lang/RuntimeException; {:try_start_5 .. :try_end_5} :catch_5
|
||
|
|
||
|
.line 618
|
||
|
:goto_2
|
||
|
throw v0
|
||
|
|
||
|
.line 615
|
||
|
:catch_4
|
||
|
move-exception v1
|
||
|
|
||
|
goto :goto_1
|
||
|
|
||
|
:catch_5
|
||
|
move-exception v1
|
||
|
|
||
|
goto :goto_2
|
||
|
.end method
|
||
|
|
||
|
.method public static dip2px(Landroid/content/Context;F)I
|
||
|
.locals 2
|
||
|
|
||
|
.prologue
|
||
|
.line 56
|
||
|
invoke-virtual {p0}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;
|
||
|
|
||
|
move-result-object v0
|
||
|
|
||
|
invoke-virtual {v0}, Landroid/content/res/Resources;->getDisplayMetrics()Landroid/util/DisplayMetrics;
|
||
|
|
||
|
move-result-object v0
|
||
|
|
||
|
iget v0, v0, Landroid/util/DisplayMetrics;->density:F
|
||
|
|
||
|
.line 57
|
||
|
mul-float/2addr v0, p1
|
||
|
|
||
|
const/high16 v1, 0x3f000000 # 0.5f
|
||
|
|
||
|
add-float/2addr v0, v1
|
||
|
|
||
|
float-to-int v0, v0
|
||
|
|
||
|
return v0
|
||
|
.end method
|
||
|
|
||
|
.method public static fileSizeMsg(J)Ljava/lang/String;
|
||
|
.locals 6
|
||
|
|
||
|
.prologue
|
||
|
const-wide/16 v2, 0x0
|
||
|
|
||
|
const/4 v5, 0x1
|
||
|
|
||
|
const/4 v4, 0x0
|
||
|
|
||
|
.line 575
|
||
|
const-string v0, ""
|
||
|
|
||
|
.line 577
|
||
|
const/16 v0, 0x1e
|
||
|
|
||
|
shr-long v0, p0, v0
|
||
|
|
||
|
.line 578
|
||
|
cmp-long v0, v0, v2
|
||
|
|
||
|
if-gtz v0, :cond_0
|
||
|
|
||
|
cmp-long v0, p0, v2
|
||
|
|
||
|
if-gez v0, :cond_2
|
||
|
|
||
|
.line 579
|
||
|
:cond_0
|
||
|
cmp-long v0, p0, v2
|
||
|
|
||
|
if-gez v0, :cond_1
|
||
|
|
||
|
.line 580
|
||
|
const-wide/32 v0, 0x7fffffff
|
||
|
|
||
|
and-long/2addr v0, p0
|
||
|
|
||
|
.line 581
|
||
|
const-wide v2, 0x80000000L
|
||
|
|
||
|
or-long p0, v0, v2
|
||
|
|
||
|
.line 583
|
||
|
:cond_1
|
||
|
long-to-float v0, p0
|
||
|
|
||
|
const/high16 v1, 0x4e800000
|
||
|
|
||
|
div-float v1, v0, v1
|
||
|
|
||
|
.line 584
|
||
|
const-string v0, "%.1fGB"
|
||
|
|
||
|
new-array v2, v5, [Ljava/lang/Object;
|
||
|
|
||
|
invoke-static {v1}, Ljava/lang/Float;->valueOf(F)Ljava/lang/Float;
|
||
|
|
||
|
move-result-object v3
|
||
|
|
||
|
aput-object v3, v2, v4
|
||
|
|
||
|
invoke-static {v0, v2}, Ljava/lang/String;->format(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;
|
||
|
|
||
|
move-result-object v0
|
||
|
|
||
|
.line 585
|
||
|
const-string v2, "Vpai_Util"
|
||
|
|
||
|
new-instance v3, Ljava/lang/StringBuilder;
|
||
|
|
||
|
invoke-direct {v3}, Ljava/lang/StringBuilder;-><init>()V
|
||
|
|
||
|
const-string v4, "lsize="
|
||
|
|
||
|
invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
||
|
|
||
|
move-result-object v3
|
||
|
|
||
|
invoke-virtual {v3, p0, p1}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;
|
||
|
|
||
|
move-result-object v3
|
||
|
|
||
|
const-string v4, ", fsize="
|
||
|
|
||
|
invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
||
|
|
||
|
move-result-object v3
|
||
|
|
||
|
invoke-virtual {v3, v1}, Ljava/lang/StringBuilder;->append(F)Ljava/lang/StringBuilder;
|
||
|
|
||
|
move-result-object v1
|
||
|
|
||
|
invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
||
|
|
||
|
move-result-object v1
|
||
|
|
||
|
invoke-static {v2, v1}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I
|
||
|
|
||
|
.line 593
|
||
|
:goto_0
|
||
|
return-object v0
|
||
|
|
||
|
.line 586
|
||
|
:cond_2
|
||
|
const-wide/32 v0, 0x100000
|
||
|
|
||
|
cmp-long v0, p0, v0
|
||
|
|
||
|
if-ltz v0, :cond_3
|
||
|
|
||
|
.line 587
|
||
|
long-to-float v0, p0
|
||
|
|
||
|
const/high16 v1, 0x49800000 # 1048576.0f
|
||
|
|
||
|
div-float/2addr v0, v1
|
||
|
|
||
|
.line 588
|
||
|
const-string v1, "%.1fMB"
|
||
|
|
||
|
new-array v2, v5, [Ljava/lang/Object;
|
||
|
|
||
|
invoke-static {v0}, Ljava/lang/Float;->valueOf(F)Ljava/lang/Float;
|
||
|
|
||
|
move-result-object v0
|
||
|
|
||
|
aput-object v0, v2, v4
|
||
|
|
||
|
invoke-static {v1, v2}, Ljava/lang/String;->format(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;
|
||
|
|
||
|
move-result-object v0
|
||
|
|
||
|
goto :goto_0
|
||
|
|
||
|
.line 590
|
||
|
:cond_3
|
||
|
long-to-float v0, p0
|
||
|
|
||
|
const/high16 v1, 0x44800000 # 1024.0f
|
||
|
|
||
|
div-float/2addr v0, v1
|
||
|
|
||
|
.line 591
|
||
|
const-string v1, "%.1fKB"
|
||
|
|
||
|
new-array v2, v5, [Ljava/lang/Object;
|
||
|
|
||
|
invoke-static {v0}, Ljava/lang/Float;->valueOf(F)Ljava/lang/Float;
|
||
|
|
||
|
move-result-object v0
|
||
|
|
||
|
aput-object v0, v2, v4
|
||
|
|
||
|
invoke-static {v1, v2}, Ljava/lang/String;->format(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;
|
||
|
|
||
|
move-result-object v0
|
||
|
|
||
|
goto :goto_0
|
||
|
.end method
|
||
|
|
||
|
.method public static fileSizeMsg(Ljava/lang/String;)Ljava/lang/String;
|
||
|
.locals 12
|
||
|
|
||
|
.prologue
|
||
|
const-wide/16 v10, 0x400
|
||
|
|
||
|
const/high16 v9, 0x4e800000
|
||
|
|
||
|
const/high16 v8, 0x49800000 # 1048576.0f
|
||
|
|
||
|
const/high16 v7, 0x44800000 # 1024.0f
|
||
|
|
||
|
const/4 v6, 0x0
|
||
|
|
||
|
.line 79
|
||
|
new-instance v1, Ljava/io/File;
|
||
|
|
||
|
invoke-direct {v1, p0}, Ljava/io/File;-><init>(Ljava/lang/String;)V
|
||
|
|
||
|
.line 81
|
||
|
const-string v0, ""
|
||
|
|
||
|
.line 82
|
||
|
if-eqz v1, :cond_0
|
||
|
|
||
|
invoke-virtual {v1}, Ljava/io/File;->isFile()Z
|
||
|
|
||
|
move-result v2
|
||
|
|
||
|
if-eqz v2, :cond_0
|
||
|
|
||
|
.line 83
|
||
|
invoke-virtual {v1}, Ljava/io/File;->length()J
|
||
|
|
||
|
move-result-wide v2
|
||
|
|
||
|
.line 84
|
||
|
const-wide/32 v4, 0x40000000
|
||
|
|
||
|
cmp-long v1, v2, v4
|
||
|
|
||
|
if-ltz v1, :cond_1
|
||
|
|
||
|
.line 85
|
||
|
long-to-float v0, v2
|
||
|
|
||
|
div-float/2addr v0, v9
|
||
|
|
||
|
invoke-static {v0}, Ljava/lang/String;->valueOf(F)Ljava/lang/String;
|
||
|
|
||
|
move-result-object v0
|
||
|
|
||
|
const-string v1, "."
|
||
|
|
||
|
.line 86
|
||
|
invoke-virtual {v0, v1}, Ljava/lang/String;->indexOf(Ljava/lang/String;)I
|
||
|
|
||
|
move-result v0
|
||
|
|
||
|
.line 87
|
||
|
new-instance v1, Ljava/lang/StringBuilder;
|
||
|
|
||
|
invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V
|
||
|
|
||
|
new-instance v4, Ljava/lang/StringBuilder;
|
||
|
|
||
|
invoke-direct {v4}, Ljava/lang/StringBuilder;-><init>()V
|
||
|
|
||
|
long-to-float v2, v2
|
||
|
|
||
|
div-float/2addr v2, v9
|
||
|
|
||
|
invoke-virtual {v4, v2}, Ljava/lang/StringBuilder;->append(F)Ljava/lang/StringBuilder;
|
||
|
|
||
|
move-result-object v2
|
||
|
|
||
|
const-string v3, "000"
|
||
|
|
||
|
invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
||
|
|
||
|
move-result-object v2
|
||
|
|
||
|
invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
||
|
|
||
|
move-result-object v2
|
||
|
|
||
|
add-int/lit8 v0, v0, 0x2
|
||
|
|
||
|
invoke-virtual {v2, v6, v0}, Ljava/lang/String;->substring(II)Ljava/lang/String;
|
||
|
|
||
|
move-result-object v0
|
||
|
|
||
|
invoke-virtual {v1, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
||
|
|
||
|
move-result-object v0
|
||
|
|
||
|
const-string v1, "GB"
|
||
|
|
||
|
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
||
|
|
||
|
move-result-object v0
|
||
|
|
||
|
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
||
|
|
||
|
move-result-object v0
|
||
|
|
||
|
.line 103
|
||
|
:cond_0
|
||
|
:goto_0
|
||
|
return-object v0
|
||
|
|
||
|
.line 89
|
||
|
:cond_1
|
||
|
const-wide/32 v4, 0x100000
|
||
|
|
||
|
cmp-long v1, v2, v4
|
||
|
|
||
|
if-ltz v1, :cond_2
|
||
|
|
||
|
.line 90
|
||
|
long-to-float v0, v2
|
||
|
|
||
|
div-float/2addr v0, v8
|
||
|
|
||
|
invoke-static {v0}, Ljava/lang/String;->valueOf(F)Ljava/lang/String;
|
||
|
|
||
|
move-result-object v0
|
||
|
|
||
|
const-string v1, "."
|
||
|
|
||
|
.line 91
|
||
|
invoke-virtual {v0, v1}, Ljava/lang/String;->indexOf(Ljava/lang/String;)I
|
||
|
|
||
|
move-result v0
|
||
|
|
||
|
.line 92
|
||
|
new-instance v1, Ljava/lang/StringBuilder;
|
||
|
|
||
|
invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V
|
||
|
|
||
|
new-instance v4, Ljava/lang/StringBuilder;
|
||
|
|
||
|
invoke-direct {v4}, Ljava/lang/StringBuilder;-><init>()V
|
||
|
|
||
|
long-to-float v2, v2
|
||
|
|
||
|
div-float/2addr v2, v8
|
||
|
|
||
|
invoke-virtual {v4, v2}, Ljava/lang/StringBuilder;->append(F)Ljava/lang/StringBuilder;
|
||
|
|
||
|
move-result-object v2
|
||
|
|
||
|
const-string v3, "000"
|
||
|
|
||
|
invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
||
|
|
||
|
move-result-object v2
|
||
|
|
||
|
invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
||
|
|
||
|
move-result-object v2
|
||
|
|
||
|
add-int/lit8 v0, v0, 0x2
|
||
|
|
||
|
invoke-virtual {v2, v6, v0}, Ljava/lang/String;->substring(II)Ljava/lang/String;
|
||
|
|
||
|
move-result-object v0
|
||
|
|
||
|
invoke-virtual {v1, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
||
|
|
||
|
move-result-object v0
|
||
|
|
||
|
const-string v1, "MB"
|
||
|
|
||
|
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
||
|
|
||
|
move-result-object v0
|
||
|
|
||
|
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
||
|
|
||
|
move-result-object v0
|
||
|
|
||
|
goto :goto_0
|
||
|
|
||
|
.line 94
|
||
|
:cond_2
|
||
|
cmp-long v1, v2, v10
|
||
|
|
||
|
if-ltz v1, :cond_3
|
||
|
|
||
|
.line 95
|
||
|
long-to-float v0, v2
|
||
|
|
||
|
div-float/2addr v0, v7
|
||
|
|
||
|
invoke-static {v0}, Ljava/lang/String;->valueOf(F)Ljava/lang/String;
|
||
|
|
||
|
move-result-object v0
|
||
|
|
||
|
const-string v1, "."
|
||
|
|
||
|
.line 96
|
||
|
invoke-virtual {v0, v1}, Ljava/lang/String;->indexOf(Ljava/lang/String;)I
|
||
|
|
||
|
move-result v0
|
||
|
|
||
|
.line 97
|
||
|
new-instance v1, Ljava/lang/StringBuilder;
|
||
|
|
||
|
invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V
|
||
|
|
||
|
new-instance v4, Ljava/lang/StringBuilder;
|
||
|
|
||
|
invoke-direct {v4}, Ljava/lang/StringBuilder;-><init>()V
|
||
|
|
||
|
long-to-float v2, v2
|
||
|
|
||
|
div-float/2addr v2, v7
|
||
|
|
||
|
invoke-virtual {v4, v2}, Ljava/lang/StringBuilder;->append(F)Ljava/lang/StringBuilder;
|
||
|
|
||
|
move-result-object v2
|
||
|
|
||
|
const-string v3, "000"
|
||
|
|
||
|
invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
||
|
|
||
|
move-result-object v2
|
||
|
|
||
|
invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
||
|
|
||
|
move-result-object v2
|
||
|
|
||
|
add-int/lit8 v0, v0, 0x2
|
||
|
|
||
|
invoke-virtual {v2, v6, v0}, Ljava/lang/String;->substring(II)Ljava/lang/String;
|
||
|
|
||
|
move-result-object v0
|
||
|
|
||
|
invoke-virtual {v1, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
||
|
|
||
|
move-result-object v0
|
||
|
|
||
|
const-string v1, "KB"
|
||
|
|
||
|
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
||
|
|
||
|
move-result-object v0
|
||
|
|
||
|
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
||
|
|
||
|
move-result-object v0
|
||
|
|
||
|
goto/16 :goto_0
|
||
|
|
||
|
.line 99
|
||
|
:cond_3
|
||
|
cmp-long v1, v2, v10
|
||
|
|
||
|
if-gez v1, :cond_0
|
||
|
|
||
|
.line 100
|
||
|
new-instance v0, Ljava/lang/StringBuilder;
|
||
|
|
||
|
invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V
|
||
|
|
||
|
invoke-static {v2, v3}, Ljava/lang/String;->valueOf(J)Ljava/lang/String;
|
||
|
|
||
|
move-result-object v1
|
||
|
|
||
|
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
||
|
|
||
|
move-result-object v0
|
||
|
|
||
|
const-string v1, "B"
|
||
|
|
||
|
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
||
|
|
||
|
move-result-object v0
|
||
|
|
||
|
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
||
|
|
||
|
move-result-object v0
|
||
|
|
||
|
goto/16 :goto_0
|
||
|
.end method
|
||
|
|
||
|
.method public static getAudioThumbFromDB(Landroid/content/Context;Ljava/lang/String;)Landroid/graphics/Bitmap;
|
||
|
.locals 8
|
||
|
|
||
|
.prologue
|
||
|
const/4 v6, 0x0
|
||
|
|
||
|
.line 215
|
||
|
.line 216
|
||
|
const/4 v7, -0x1
|
||
|
|
||
|
.line 219
|
||
|
:try_start_0
|
||
|
invoke-virtual {p0}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
|
||
|
|
||
|
move-result-object v0
|
||
|
|
||
|
sget-object v1, Landroid/provider/MediaStore$Audio$Media;->EXTERNAL_CONTENT_URI:Landroid/net/Uri;
|
||
|
|
||
|
const/4 v2, 0x0
|
||
|
|
||
|
const-string v3, "_data=?"
|
||
|
|
||
|
const/4 v4, 0x1
|
||
|
|
||
|
new-array v4, v4, [Ljava/lang/String;
|
||
|
|
||
|
const/4 v5, 0x0
|
||
|
|
||
|
aput-object p1, v4, v5
|
||
|
|
||
|
const/4 v5, 0x0
|
||
|
|
||
|
invoke-virtual/range {v0 .. v5}, Landroid/content/ContentResolver;->query(Landroid/net/Uri;[Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;)Landroid/database/Cursor;
|
||
|
:try_end_0
|
||
|
.catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0
|
||
|
.catchall {:try_start_0 .. :try_end_0} :catchall_0
|
||
|
|
||
|
move-result-object v1
|
||
|
|
||
|
.line 223
|
||
|
if-eqz v1, :cond_8
|
||
|
|
||
|
:try_start_1
|
||
|
invoke-interface {v1}, Landroid/database/Cursor;->getCount()I
|
||
|
|
||
|
move-result v0
|
||
|
|
||
|
if-lez v0, :cond_8
|
||
|
|
||
|
invoke-interface {v1}, Landroid/database/Cursor;->moveToFirst()Z
|
||
|
|
||
|
move-result v0
|
||
|
|
||
|
if-eqz v0, :cond_8
|
||
|
|
||
|
.line 224
|
||
|
const-string v0, "album_id"
|
||
|
|
||
|
invoke-interface {v1, v0}, Landroid/database/Cursor;->getColumnIndexOrThrow(Ljava/lang/String;)I
|
||
|
|
||
|
move-result v0
|
||
|
|
||
|
invoke-interface {v1, v0}, Landroid/database/Cursor;->getInt(I)I
|
||
|
|
||
|
move-result v0
|
||
|
|
||
|
move v3, v0
|
||
|
|
||
|
.line 226
|
||
|
:goto_0
|
||
|
if-eqz v1, :cond_7
|
||
|
|
||
|
.line 227
|
||
|
invoke-interface {v1}, Landroid/database/Cursor;->close()V
|
||
|
:try_end_1
|
||
|
.catch Ljava/lang/Exception; {:try_start_1 .. :try_end_1} :catch_4
|
||
|
.catchall {:try_start_1 .. :try_end_1} :catchall_1
|
||
|
|
||
|
move-object v7, v6
|
||
|
|
||
|
.line 231
|
||
|
:goto_1
|
||
|
if-lez v3, :cond_6
|
||
|
|
||
|
.line 232
|
||
|
:try_start_2
|
||
|
const-string v1, "content://media/external/audio/albums"
|
||
|
|
||
|
.line 233
|
||
|
const/4 v0, 0x1
|
||
|
|
||
|
new-array v2, v0, [Ljava/lang/String;
|
||
|
|
||
|
const/4 v0, 0x0
|
||
|
|
||
|
const-string v4, "album_art"
|
||
|
|
||
|
aput-object v4, v2, v0
|
||
|
|
||
|
.line 234
|
||
|
invoke-virtual {p0}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
|
||
|
|
||
|
move-result-object v0
|
||
|
|
||
|
new-instance v4, Ljava/lang/StringBuilder;
|
||
|
|
||
|
invoke-direct {v4}, Ljava/lang/StringBuilder;-><init>()V
|
||
|
|
||
|
invoke-virtual {v4, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
||
|
|
||
|
move-result-object v1
|
||
|
|
||
|
const-string v4, "/"
|
||
|
|
||
|
invoke-virtual {v1, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
||
|
|
||
|
move-result-object v1
|
||
|
|
||
|
.line 235
|
||
|
invoke-static {v3}, Ljava/lang/Integer;->toString(I)Ljava/lang/String;
|
||
|
|
||
|
move-result-object v3
|
||
|
|
||
|
invoke-virtual {v1, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
||
|
|
||
|
move-result-object v1
|
||
|
|
||
|
invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
||
|
|
||
|
move-result-object v1
|
||
|
|
||
|
invoke-static {v1}, Landroid/net/Uri;->parse(Ljava/lang/String;)Landroid/net/Uri;
|
||
|
|
||
|
move-result-object v1
|
||
|
|
||
|
const/4 v3, 0x0
|
||
|
|
||
|
const/4 v4, 0x0
|
||
|
|
||
|
const/4 v5, 0x0
|
||
|
|
||
|
.line 234
|
||
|
invoke-virtual/range {v0 .. v5}, Landroid/content/ContentResolver;->query(Landroid/net/Uri;[Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;)Landroid/database/Cursor;
|
||
|
:try_end_2
|
||
|
.catch Ljava/lang/Exception; {:try_start_2 .. :try_end_2} :catch_5
|
||
|
.catchall {:try_start_2 .. :try_end_2} :catchall_2
|
||
|
|
||
|
move-result-object v1
|
||
|
|
||
|
.line 238
|
||
|
if-eqz v1, :cond_5
|
||
|
|
||
|
:try_start_3
|
||
|
invoke-interface {v1}, Landroid/database/Cursor;->getCount()I
|
||
|
|
||
|
move-result v0
|
||
|
|
||
|
if-lez v0, :cond_5
|
||
|
|
||
|
invoke-interface {v1}, Landroid/database/Cursor;->moveToFirst()Z
|
||
|
|
||
|
move-result v0
|
||
|
|
||
|
if-eqz v0, :cond_5
|
||
|
|
||
|
.line 239
|
||
|
const/4 v0, 0x0
|
||
|
|
||
|
invoke-interface {v1, v0}, Landroid/database/Cursor;->getString(I)Ljava/lang/String;
|
||
|
|
||
|
move-result-object v0
|
||
|
|
||
|
.line 241
|
||
|
:goto_2
|
||
|
if-eqz v1, :cond_0
|
||
|
|
||
|
.line 242
|
||
|
invoke-interface {v1}, Landroid/database/Cursor;->close()V
|
||
|
|
||
|
move-object v1, v6
|
||
|
|
||
|
.line 245
|
||
|
:cond_0
|
||
|
if-eqz v0, :cond_4
|
||
|
|
||
|
.line 246
|
||
|
invoke-static {v0}, Landroid/graphics/BitmapFactory;->decodeFile(Ljava/lang/String;)Landroid/graphics/Bitmap;
|
||
|
:try_end_3
|
||
|
.catch Ljava/lang/Exception; {:try_start_3 .. :try_end_3} :catch_4
|
||
|
.catchall {:try_start_3 .. :try_end_3} :catchall_1
|
||
|
|
||
|
move-result-object v6
|
||
|
|
||
|
move-object v0, v6
|
||
|
|
||
|
.line 252
|
||
|
:goto_3
|
||
|
if-eqz v1, :cond_1
|
||
|
|
||
|
.line 253
|
||
|
:try_start_4
|
||
|
invoke-interface {v1}, Landroid/database/Cursor;->close()V
|
||
|
:try_end_4
|
||
|
.catch Ljava/lang/Exception; {:try_start_4 .. :try_end_4} :catch_2
|
||
|
|
||
|
.line 260
|
||
|
:cond_1
|
||
|
:goto_4
|
||
|
return-object v0
|
||
|
|
||
|
.line 248
|
||
|
:catch_0
|
||
|
move-exception v0
|
||
|
|
||
|
move-object v1, v6
|
||
|
|
||
|
.line 249
|
||
|
:goto_5
|
||
|
:try_start_5
|
||
|
invoke-virtual {v0}, Ljava/lang/Exception;->printStackTrace()V
|
||
|
:try_end_5
|
||
|
.catchall {:try_start_5 .. :try_end_5} :catchall_1
|
||
|
|
||
|
.line 252
|
||
|
if-eqz v1, :cond_2
|
||
|
|
||
|
.line 253
|
||
|
:try_start_6
|
||
|
invoke-interface {v1}, Landroid/database/Cursor;->close()V
|
||
|
:try_end_6
|
||
|
.catch Ljava/lang/Exception; {:try_start_6 .. :try_end_6} :catch_1
|
||
|
|
||
|
:cond_2
|
||
|
move-object v0, v6
|
||
|
|
||
|
.line 257
|
||
|
goto :goto_4
|
||
|
|
||
|
.line 256
|
||
|
:catch_1
|
||
|
move-exception v0
|
||
|
|
||
|
move-object v0, v6
|
||
|
|
||
|
.line 258
|
||
|
goto :goto_4
|
||
|
|
||
|
.line 251
|
||
|
:catchall_0
|
||
|
move-exception v0
|
||
|
|
||
|
move-object v7, v6
|
||
|
|
||
|
.line 252
|
||
|
:goto_6
|
||
|
if-eqz v7, :cond_3
|
||
|
|
||
|
.line 253
|
||
|
:try_start_7
|
||
|
invoke-interface {v7}, Landroid/database/Cursor;->close()V
|
||
|
:try_end_7
|
||
|
.catch Ljava/lang/Exception; {:try_start_7 .. :try_end_7} :catch_3
|
||
|
|
||
|
.line 258
|
||
|
:cond_3
|
||
|
:goto_7
|
||
|
throw v0
|
||
|
|
||
|
.line 256
|
||
|
:catch_2
|
||
|
move-exception v1
|
||
|
|
||
|
goto :goto_4
|
||
|
|
||
|
:catch_3
|
||
|
move-exception v1
|
||
|
|
||
|
goto :goto_7
|
||
|
|
||
|
.line 251
|
||
|
:catchall_1
|
||
|
move-exception v0
|
||
|
|
||
|
move-object v7, v1
|
||
|
|
||
|
goto :goto_6
|
||
|
|
||
|
:catchall_2
|
||
|
move-exception v0
|
||
|
|
||
|
goto :goto_6
|
||
|
|
||
|
.line 248
|
||
|
:catch_4
|
||
|
move-exception v0
|
||
|
|
||
|
goto :goto_5
|
||
|
|
||
|
:catch_5
|
||
|
move-exception v0
|
||
|
|
||
|
move-object v1, v7
|
||
|
|
||
|
goto :goto_5
|
||
|
|
||
|
:cond_4
|
||
|
move-object v0, v6
|
||
|
|
||
|
goto :goto_3
|
||
|
|
||
|
:cond_5
|
||
|
move-object v0, v6
|
||
|
|
||
|
goto :goto_2
|
||
|
|
||
|
:cond_6
|
||
|
move-object v1, v7
|
||
|
|
||
|
move-object v0, v6
|
||
|
|
||
|
goto :goto_3
|
||
|
|
||
|
:cond_7
|
||
|
move-object v7, v1
|
||
|
|
||
|
goto/16 :goto_1
|
||
|
|
||
|
:cond_8
|
||
|
move v3, v7
|
||
|
|
||
|
goto/16 :goto_0
|
||
|
.end method
|
||
|
|
||
|
.method public static getFileInfoFromUri(Landroid/content/Context;Landroid/net/Uri;)Lcom/viatech/gallery/FileInfo;
|
||
|
.locals 7
|
||
|
|
||
|
.prologue
|
||
|
const/4 v4, 0x0
|
||
|
|
||
|
const/4 v2, 0x0
|
||
|
|
||
|
.line 419
|
||
|
if-eqz p1, :cond_0
|
||
|
|
||
|
if-nez p0, :cond_1
|
||
|
|
||
|
.line 482
|
||
|
:cond_0
|
||
|
:goto_0
|
||
|
return-object v2
|
||
|
|
||
|
.line 425
|
||
|
:cond_1
|
||
|
invoke-virtual {p1}, Landroid/net/Uri;->getScheme()Ljava/lang/String;
|
||
|
|
||
|
move-result-object v0
|
||
|
|
||
|
.line 427
|
||
|
if-eqz v0, :cond_3
|
||
|
|
||
|
const-string v1, "file"
|
||
|
|
||
|
invoke-virtual {p1}, Landroid/net/Uri;->getScheme()Ljava/lang/String;
|
||
|
|
||
|
move-result-object v3
|
||
|
|
||
|
invoke-virtual {v1, v3}, Ljava/lang/String;->startsWith(Ljava/lang/String;)Z
|
||
|
|
||
|
move-result v1
|
||
|
|
||
|
if-eqz v1, :cond_3
|
||
|
|
||
|
.line 428
|
||
|
invoke-virtual {p1}, Landroid/net/Uri;->getPath()Ljava/lang/String;
|
||
|
|
||
|
move-result-object v0
|
||
|
|
||
|
.line 429
|
||
|
new-instance v1, Ljava/io/File;
|
||
|
|
||
|
invoke-direct {v1, v0}, Ljava/io/File;-><init>(Ljava/lang/String;)V
|
||
|
|
||
|
.line 430
|
||
|
new-instance v0, Lcom/viatech/gallery/FileInfo;
|
||
|
|
||
|
invoke-virtual {v1}, Ljava/io/File;->getName()Ljava/lang/String;
|
||
|
|
||
|
move-result-object v2
|
||
|
|
||
|
invoke-virtual {v1}, Ljava/io/File;->isDirectory()Z
|
||
|
|
||
|
move-result v3
|
||
|
|
||
|
invoke-direct {v0, v2, v3}, Lcom/viatech/gallery/FileInfo;-><init>(Ljava/lang/String;Z)V
|
||
|
|
||
|
.line 431
|
||
|
invoke-virtual {v1}, Ljava/io/File;->getParent()Ljava/lang/String;
|
||
|
|
||
|
move-result-object v1
|
||
|
|
||
|
iput-object v1, v0, Lcom/viatech/gallery/FileInfo;->path:Ljava/lang/String;
|
||
|
|
||
|
.line 432
|
||
|
iget-object v1, v0, Lcom/viatech/gallery/FileInfo;->path:Ljava/lang/String;
|
||
|
|
||
|
if-eqz v1, :cond_2
|
||
|
|
||
|
iget-object v1, v0, Lcom/viatech/gallery/FileInfo;->path:Ljava/lang/String;
|
||
|
|
||
|
const-string v2, "/"
|
||
|
|
||
|
invoke-virtual {v1, v2}, Ljava/lang/String;->endsWith(Ljava/lang/String;)Z
|
||
|
|
||
|
move-result v1
|
||
|
|
||
|
if-nez v1, :cond_2
|
||
|
|
||
|
.line 433
|
||
|
new-instance v1, Ljava/lang/StringBuilder;
|
||
|
|
||
|
invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V
|
||
|
|
||
|
iget-object v2, v0, Lcom/viatech/gallery/FileInfo;->path:Ljava/lang/String;
|
||
|
|
||
|
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
||
|
|
||
|
move-result-object v1
|
||
|
|
||
|
const-string v2, "/"
|
||
|
|
||
|
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
||
|
|
||
|
move-result-object v1
|
||
|
|
||
|
invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
||
|
|
||
|
move-result-object v1
|
||
|
|
||
|
iput-object v1, v0, Lcom/viatech/gallery/FileInfo;->path:Ljava/lang/String;
|
||
|
|
||
|
:cond_2
|
||
|
:goto_1
|
||
|
move-object v2, v0
|
||
|
|
||
|
.line 482
|
||
|
goto :goto_0
|
||
|
|
||
|
.line 435
|
||
|
:cond_3
|
||
|
if-eqz v0, :cond_6
|
||
|
|
||
|
const-string v0, "content"
|
||
|
|
||
|
invoke-virtual {p1}, Landroid/net/Uri;->getScheme()Ljava/lang/String;
|
||
|
|
||
|
move-result-object v1
|
||
|
|
||
|
invoke-virtual {v0, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
|
||
|
|
||
|
move-result v0
|
||
|
|
||
|
if-eqz v0, :cond_6
|
||
|
|
||
|
.line 436
|
||
|
invoke-virtual {p0}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
|
||
|
|
||
|
move-result-object v0
|
||
|
|
||
|
move-object v1, p1
|
||
|
|
||
|
move-object v3, v2
|
||
|
|
||
|
move-object v4, v2
|
||
|
|
||
|
move-object v5, v2
|
||
|
|
||
|
.line 437
|
||
|
invoke-virtual/range {v0 .. v5}, Landroid/content/ContentResolver;->query(Landroid/net/Uri;[Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;)Landroid/database/Cursor;
|
||
|
|
||
|
move-result-object v1
|
||
|
|
||
|
.line 439
|
||
|
:try_start_0
|
||
|
invoke-interface {v1}, Landroid/database/Cursor;->moveToFirst()Z
|
||
|
|
||
|
.line 440
|
||
|
const-string v0, "_data"
|
||
|
|
||
|
invoke-interface {v1, v0}, Landroid/database/Cursor;->getColumnIndexOrThrow(Ljava/lang/String;)I
|
||
|
|
||
|
move-result v0
|
||
|
|
||
|
invoke-interface {v1, v0}, Landroid/database/Cursor;->getString(I)Ljava/lang/String;
|
||
|
:try_end_0
|
||
|
.catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0
|
||
|
.catchall {:try_start_0 .. :try_end_0} :catchall_0
|
||
|
|
||
|
move-result-object v0
|
||
|
|
||
|
.line 445
|
||
|
if-eqz v1, :cond_4
|
||
|
|
||
|
.line 446
|
||
|
:try_start_1
|
||
|
invoke-interface {v1}, Landroid/database/Cursor;->close()V
|
||
|
:try_end_1
|
||
|
.catch Ljava/lang/Exception; {:try_start_1 .. :try_end_1} :catch_3
|
||
|
|
||
|
.line 453
|
||
|
:cond_4
|
||
|
:goto_2
|
||
|
new-instance v1, Ljava/io/File;
|
||
|
|
||
|
invoke-direct {v1, v0}, Ljava/io/File;-><init>(Ljava/lang/String;)V
|
||
|
|
||
|
.line 454
|
||
|
new-instance v0, Lcom/viatech/gallery/FileInfo;
|
||
|
|
||
|
invoke-virtual {v1}, Ljava/io/File;->getName()Ljava/lang/String;
|
||
|
|
||
|
move-result-object v2
|
||
|
|
||
|
invoke-virtual {v1}, Ljava/io/File;->isDirectory()Z
|
||
|
|
||
|
move-result v3
|
||
|
|
||
|
invoke-direct {v0, v2, v3}, Lcom/viatech/gallery/FileInfo;-><init>(Ljava/lang/String;Z)V
|
||
|
|
||
|
.line 455
|
||
|
invoke-virtual {v1}, Ljava/io/File;->getParent()Ljava/lang/String;
|
||
|
|
||
|
move-result-object v1
|
||
|
|
||
|
iput-object v1, v0, Lcom/viatech/gallery/FileInfo;->path:Ljava/lang/String;
|
||
|
|
||
|
.line 456
|
||
|
iget-object v1, v0, Lcom/viatech/gallery/FileInfo;->path:Ljava/lang/String;
|
||
|
|
||
|
if-eqz v1, :cond_2
|
||
|
|
||
|
iget-object v1, v0, Lcom/viatech/gallery/FileInfo;->path:Ljava/lang/String;
|
||
|
|
||
|
const-string v2, "/"
|
||
|
|
||
|
invoke-virtual {v1, v2}, Ljava/lang/String;->endsWith(Ljava/lang/String;)Z
|
||
|
|
||
|
move-result v1
|
||
|
|
||
|
if-nez v1, :cond_2
|
||
|
|
||
|
.line 457
|
||
|
new-instance v1, Ljava/lang/StringBuilder;
|
||
|
|
||
|
invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V
|
||
|
|
||
|
iget-object v2, v0, Lcom/viatech/gallery/FileInfo;->path:Ljava/lang/String;
|
||
|
|
||
|
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
||
|
|
||
|
move-result-object v1
|
||
|
|
||
|
const-string v2, "/"
|
||
|
|
||
|
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
||
|
|
||
|
move-result-object v1
|
||
|
|
||
|
invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
||
|
|
||
|
move-result-object v1
|
||
|
|
||
|
iput-object v1, v0, Lcom/viatech/gallery/FileInfo;->path:Ljava/lang/String;
|
||
|
|
||
|
goto :goto_1
|
||
|
|
||
|
.line 441
|
||
|
:catch_0
|
||
|
move-exception v0
|
||
|
|
||
|
.line 445
|
||
|
if-eqz v1, :cond_0
|
||
|
|
||
|
.line 446
|
||
|
:try_start_2
|
||
|
invoke-interface {v1}, Landroid/database/Cursor;->close()V
|
||
|
:try_end_2
|
||
|
.catch Ljava/lang/Exception; {:try_start_2 .. :try_end_2} :catch_1
|
||
|
|
||
|
goto/16 :goto_0
|
||
|
|
||
|
.line 449
|
||
|
:catch_1
|
||
|
move-exception v0
|
||
|
|
||
|
goto/16 :goto_0
|
||
|
|
||
|
.line 444
|
||
|
:catchall_0
|
||
|
move-exception v0
|
||
|
|
||
|
.line 445
|
||
|
if-eqz v1, :cond_5
|
||
|
|
||
|
.line 446
|
||
|
:try_start_3
|
||
|
invoke-interface {v1}, Landroid/database/Cursor;->close()V
|
||
|
:try_end_3
|
||
|
.catch Ljava/lang/Exception; {:try_start_3 .. :try_end_3} :catch_4
|
||
|
|
||
|
.line 451
|
||
|
:cond_5
|
||
|
:goto_3
|
||
|
throw v0
|
||
|
|
||
|
.line 460
|
||
|
:cond_6
|
||
|
invoke-virtual {p1}, Landroid/net/Uri;->toString()Ljava/lang/String;
|
||
|
|
||
|
move-result-object v1
|
||
|
|
||
|
.line 461
|
||
|
const-string v0, "/"
|
||
|
|
||
|
invoke-virtual {v1, v0}, Ljava/lang/String;->lastIndexOf(Ljava/lang/String;)I
|
||
|
|
||
|
move-result v2
|
||
|
|
||
|
.line 465
|
||
|
:try_start_4
|
||
|
invoke-virtual {v1}, Ljava/lang/String;->length()I
|
||
|
|
||
|
move-result v0
|
||
|
|
||
|
if-ge v2, v0, :cond_7
|
||
|
|
||
|
invoke-virtual {v1}, Ljava/lang/String;->length()I
|
||
|
|
||
|
move-result v0
|
||
|
|
||
|
if-lez v0, :cond_7
|
||
|
|
||
|
.line 466
|
||
|
add-int/lit8 v0, v2, 0x1
|
||
|
|
||
|
invoke-virtual {v1, v0}, Ljava/lang/String;->substring(I)Ljava/lang/String;
|
||
|
|
||
|
move-result-object v0
|
||
|
|
||
|
.line 467
|
||
|
const/4 v3, 0x0
|
||
|
|
||
|
add-int/lit8 v2, v2, 0x1
|
||
|
|
||
|
invoke-virtual {v1, v3, v2}, Ljava/lang/String;->substring(II)Ljava/lang/String;
|
||
|
:try_end_4
|
||
|
.catch Ljava/lang/Exception; {:try_start_4 .. :try_end_4} :catch_2
|
||
|
|
||
|
move-result-object v1
|
||
|
|
||
|
.line 477
|
||
|
:goto_4
|
||
|
new-instance v2, Lcom/viatech/gallery/FileInfo;
|
||
|
|
||
|
invoke-direct {v2, v0, v4}, Lcom/viatech/gallery/FileInfo;-><init>(Ljava/lang/String;Z)V
|
||
|
|
||
|
.line 478
|
||
|
iput-object v1, v2, Lcom/viatech/gallery/FileInfo;->path:Ljava/lang/String;
|
||
|
|
||
|
move-object v0, v2
|
||
|
|
||
|
goto/16 :goto_1
|
||
|
|
||
|
.line 469
|
||
|
:cond_7
|
||
|
:try_start_5
|
||
|
const-string v0, ""
|
||
|
:try_end_5
|
||
|
.catch Ljava/lang/Exception; {:try_start_5 .. :try_end_5} :catch_2
|
||
|
|
||
|
goto :goto_4
|
||
|
|
||
|
.line 472
|
||
|
:catch_2
|
||
|
move-exception v0
|
||
|
|
||
|
.line 474
|
||
|
const-string v0, ""
|
||
|
|
||
|
move-object v6, v1
|
||
|
|
||
|
move-object v1, v0
|
||
|
|
||
|
move-object v0, v6
|
||
|
|
||
|
goto :goto_4
|
||
|
|
||
|
.line 449
|
||
|
:catch_3
|
||
|
move-exception v1
|
||
|
|
||
|
goto/16 :goto_2
|
||
|
|
||
|
:catch_4
|
||
|
move-exception v1
|
||
|
|
||
|
goto :goto_3
|
||
|
.end method
|
||
|
|
||
|
.method public static getMainName(Ljava/lang/String;)Ljava/lang/String;
|
||
|
.locals 2
|
||
|
|
||
|
.prologue
|
||
|
.line 70
|
||
|
const-string v0, "."
|
||
|
|
||
|
invoke-virtual {p0, v0}, Ljava/lang/String;->lastIndexOf(Ljava/lang/String;)I
|
||
|
|
||
|
move-result v1
|
||
|
|
||
|
.line 71
|
||
|
const-string v0, "*"
|
||
|
|
||
|
.line 72
|
||
|
if-lez v1, :cond_0
|
||
|
|
||
|
.line 73
|
||
|
const/4 v0, 0x0
|
||
|
|
||
|
invoke-virtual {p0, v0, v1}, Ljava/lang/String;->substring(II)Ljava/lang/String;
|
||
|
|
||
|
move-result-object v0
|
||
|
|
||
|
.line 75
|
||
|
:cond_0
|
||
|
return-object v0
|
||
|
.end method
|
||
|
|
||
|
.method public static getMediaThumb(Landroid/content/Context;Lcom/viatech/gallery/FileInfo;)Landroid/graphics/Bitmap;
|
||
|
.locals 4
|
||
|
|
||
|
.prologue
|
||
|
const/4 v0, 0x0
|
||
|
|
||
|
.line 107
|
||
|
invoke-virtual {p1}, Lcom/viatech/gallery/FileInfo;->getFullPath()Ljava/lang/String;
|
||
|
|
||
|
move-result-object v1
|
||
|
|
||
|
.line 108
|
||
|
if-nez v1, :cond_1
|
||
|
|
||
|
.line 135
|
||
|
:cond_0
|
||
|
:goto_0
|
||
|
return-object v0
|
||
|
|
||
|
.line 112
|
||
|
:cond_1
|
||
|
iget v2, p1, Lcom/viatech/gallery/FileInfo;->fileType:I
|
||
|
|
||
|
.line 113
|
||
|
packed-switch v2, :pswitch_data_0
|
||
|
|
||
|
:pswitch_0
|
||
|
goto :goto_0
|
||
|
|
||
|
.line 122
|
||
|
:pswitch_1
|
||
|
const-string v0, "/"
|
||
|
|
||
|
invoke-virtual {v1, v0}, Ljava/lang/String;->startsWith(Ljava/lang/String;)Z
|
||
|
|
||
|
move-result v0
|
||
|
|
||
|
if-nez v0, :cond_3
|
||
|
|
||
|
.line 123
|
||
|
const/4 v0, -0x1
|
||
|
|
||
|
sget v2, Lcom/viatech/gallery/GalleryUtil;->THUMB_WH:I
|
||
|
|
||
|
sget v3, Lcom/viatech/gallery/GalleryUtil;->THUMB_WH:I
|
||
|
|
||
|
mul-int/2addr v2, v3
|
||
|
|
||
|
invoke-static {v0, v2, v1}, Lcom/viatech/gallery/GalleryUtil;->makeNetBitmap(IILjava/lang/String;)Landroid/graphics/Bitmap;
|
||
|
|
||
|
move-result-object v0
|
||
|
|
||
|
.line 127
|
||
|
:goto_1
|
||
|
if-nez v0, :cond_0
|
||
|
|
||
|
.line 128
|
||
|
sget-object v0, Lcom/viatech/gallery/GalleryUtil;->sNullBitmap:Landroid/graphics/Bitmap;
|
||
|
|
||
|
goto :goto_0
|
||
|
|
||
|
.line 115
|
||
|
:pswitch_2
|
||
|
sget-object v0, Lcom/viatech/gallery/GalleryUtil;->sNullBitmap:Landroid/graphics/Bitmap;
|
||
|
|
||
|
goto :goto_0
|
||
|
|
||
|
.line 117
|
||
|
:pswitch_3
|
||
|
const/4 v0, 0x3
|
||
|
|
||
|
invoke-static {p0, v1, v0}, Lcom/viatech/gallery/GalleryUtil;->getVideoThumb(Landroid/content/Context;Ljava/lang/String;I)Landroid/graphics/Bitmap;
|
||
|
|
||
|
move-result-object v0
|
||
|
|
||
|
.line 118
|
||
|
if-eqz v0, :cond_2
|
||
|
|
||
|
.line 119
|
||
|
sget v1, Lcom/viatech/gallery/GalleryUtil;->THUMB_WH:I
|
||
|
|
||
|
sget v2, Lcom/viatech/gallery/GalleryUtil;->THUMB_WH:I
|
||
|
|
||
|
const/4 v3, 0x0
|
||
|
|
||
|
invoke-static {v0, v1, v2, v3}, Lcom/viatech/gallery/GalleryUtil;->zoomImg(Landroid/graphics/Bitmap;IIZ)Landroid/graphics/Bitmap;
|
||
|
|
||
|
move-result-object v0
|
||
|
|
||
|
goto :goto_0
|
||
|
|
||
|
.line 120
|
||
|
:cond_2
|
||
|
sget-object v0, Lcom/viatech/gallery/GalleryUtil;->sNullBitmap:Landroid/graphics/Bitmap;
|
||
|
|
||
|
goto :goto_0
|
||
|
|
||
|
.line 125
|
||
|
:cond_3
|
||
|
invoke-static {v1}, Lcom/viatech/gallery/GalleryUtil;->getPhotoThumb(Ljava/lang/String;)Landroid/graphics/Bitmap;
|
||
|
|
||
|
move-result-object v0
|
||
|
|
||
|
goto :goto_1
|
||
|
|
||
|
.line 113
|
||
|
nop
|
||
|
|
||
|
:pswitch_data_0
|
||
|
.packed-switch 0x1
|
||
|
:pswitch_1
|
||
|
:pswitch_3
|
||
|
:pswitch_0
|
||
|
:pswitch_2
|
||
|
.end packed-switch
|
||
|
.end method
|
||
|
|
||
|
.method public static getPackageVersion(Landroid/content/Context;)Ljava/lang/String;
|
||
|
.locals 3
|
||
|
|
||
|
.prologue
|
||
|
.line 533
|
||
|
:try_start_0
|
||
|
invoke-virtual {p0}, Landroid/content/Context;->getPackageManager()Landroid/content/pm/PackageManager;
|
||
|
|
||
|
move-result-object v0
|
||
|
|
||
|
invoke-virtual {p0}, Landroid/content/Context;->getPackageName()Ljava/lang/String;
|
||
|
|
||
|
move-result-object v1
|
||
|
|
||
|
const/4 v2, 0x0
|
||
|
|
||
|
invoke-virtual {v0, v1, v2}, Landroid/content/pm/PackageManager;->getPackageInfo(Ljava/lang/String;I)Landroid/content/pm/PackageInfo;
|
||
|
|
||
|
move-result-object v0
|
||
|
|
||
|
.line 534
|
||
|
iget-object v0, v0, Landroid/content/pm/PackageInfo;->versionName:Ljava/lang/String;
|
||
|
:try_end_0
|
||
|
.catch Landroid/content/pm/PackageManager$NameNotFoundException; {:try_start_0 .. :try_end_0} :catch_0
|
||
|
|
||
|
.line 537
|
||
|
:goto_0
|
||
|
return-object v0
|
||
|
|
||
|
.line 535
|
||
|
:catch_0
|
||
|
move-exception v0
|
||
|
|
||
|
.line 536
|
||
|
const-string v1, "Vpai_Util"
|
||
|
|
||
|
const-string v2, "getPackageVersion Error"
|
||
|
|
||
|
invoke-static {v1, v2, v0}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I
|
||
|
|
||
|
.line 537
|
||
|
const-string v0, "unknown"
|
||
|
|
||
|
goto :goto_0
|
||
|
.end method
|
||
|
|
||
|
.method public static getPhotoThumb(Ljava/lang/String;)Landroid/graphics/Bitmap;
|
||
|
.locals 5
|
||
|
|
||
|
.prologue
|
||
|
const/4 v1, 0x0
|
||
|
|
||
|
const/4 v4, 0x0
|
||
|
|
||
|
.line 139
|
||
|
.line 143
|
||
|
:try_start_0
|
||
|
new-instance v0, Landroid/media/ExifInterface;
|
||
|
|
||
|
invoke-direct {v0, p0}, Landroid/media/ExifInterface;-><init>(Ljava/lang/String;)V
|
||
|
|
||
|
.line 144
|
||
|
if-eqz v0, :cond_0
|
||
|
|
||
|
.line 145
|
||
|
invoke-virtual {v0}, Landroid/media/ExifInterface;->getThumbnail()[B
|
||
|
:try_end_0
|
||
|
.catch Ljava/lang/Throwable; {:try_start_0 .. :try_end_0} :catch_0
|
||
|
|
||
|
move-result-object v0
|
||
|
|
||
|
.line 150
|
||
|
:goto_0
|
||
|
if-eqz v0, :cond_1
|
||
|
|
||
|
.line 151
|
||
|
array-length v2, v0
|
||
|
|
||
|
invoke-static {v0, v4, v2}, Landroid/graphics/BitmapFactory;->decodeByteArray([BII)Landroid/graphics/Bitmap;
|
||
|
|
||
|
move-result-object v0
|
||
|
|
||
|
.line 152
|
||
|
if-nez v0, :cond_2
|
||
|
|
||
|
.line 158
|
||
|
:goto_1
|
||
|
return-object v1
|
||
|
|
||
|
.line 147
|
||
|
:catch_0
|
||
|
move-exception v0
|
||
|
|
||
|
.line 148
|
||
|
const-string v2, "Vpai_Util"
|
||
|
|
||
|
const-string v3, "fail to get exif thumb"
|
||
|
|
||
|
invoke-static {v2, v3, v0}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I
|
||
|
|
||
|
:cond_0
|
||
|
move-object v0, v1
|
||
|
|
||
|
goto :goto_0
|
||
|
|
||
|
.line 155
|
||
|
:cond_1
|
||
|
const/4 v0, -0x1
|
||
|
|
||
|
sget v1, Lcom/viatech/gallery/GalleryUtil;->THUMB_WH:I
|
||
|
|
||
|
sget v2, Lcom/viatech/gallery/GalleryUtil;->THUMB_WH:I
|
||
|
|
||
|
mul-int/2addr v1, v2
|
||
|
|
||
|
invoke-static {v0, v1, p0}, Lcom/viatech/gallery/GalleryUtil;->makeBitmap(IILjava/lang/String;)Landroid/graphics/Bitmap;
|
||
|
|
||
|
move-result-object v0
|
||
|
|
||
|
.line 158
|
||
|
:cond_2
|
||
|
sget v1, Lcom/viatech/gallery/GalleryUtil;->THUMB_WH:I
|
||
|
|
||
|
sget v2, Lcom/viatech/gallery/GalleryUtil;->THUMB_WH:I
|
||
|
|
||
|
invoke-static {v0, v1, v2, v4}, Lcom/viatech/gallery/GalleryUtil;->zoomImg(Landroid/graphics/Bitmap;IIZ)Landroid/graphics/Bitmap;
|
||
|
|
||
|
move-result-object v1
|
||
|
|
||
|
goto :goto_1
|
||
|
.end method
|
||
|
|
||
|
.method public static getPostfix(Ljava/lang/String;)Ljava/lang/String;
|
||
|
.locals 2
|
||
|
|
||
|
.prologue
|
||
|
.line 61
|
||
|
const-string v0, "."
|
||
|
|
||
|
invoke-virtual {p0, v0}, Ljava/lang/String;->lastIndexOf(Ljava/lang/String;)I
|
||
|
|
||
|
move-result v1
|
||
|
|
||
|
.line 62
|
||
|
const-string v0, "*"
|
||
|
|
||
|
.line 63
|
||
|
if-lez v1, :cond_0
|
||
|
|
||
|
.line 64
|
||
|
add-int/lit8 v0, v1, 0x1
|
||
|
|
||
|
invoke-virtual {p0}, Ljava/lang/String;->length()I
|
||
|
|
||
|
move-result v1
|
||
|
|
||
|
invoke-virtual {p0, v0, v1}, Ljava/lang/String;->substring(II)Ljava/lang/String;
|
||
|
|
||
|
move-result-object v0
|
||
|
|
||
|
sget-object v1, Ljava/util/Locale;->ENGLISH:Ljava/util/Locale;
|
||
|
|
||
|
invoke-virtual {v0, v1}, Ljava/lang/String;->toLowerCase(Ljava/util/Locale;)Ljava/lang/String;
|
||
|
|
||
|
move-result-object v0
|
||
|
|
||
|
.line 66
|
||
|
:cond_0
|
||
|
return-object v0
|
||
|
.end method
|
||
|
|
||
|
.method public static getShareFilePathList(Landroid/content/Context;Landroid/content/Intent;)Ljava/util/ArrayList;
|
||
|
.locals 4
|
||
|
.annotation system Ldalvik/annotation/Signature;
|
||
|
value = {
|
||
|
"(",
|
||
|
"Landroid/content/Context;",
|
||
|
"Landroid/content/Intent;",
|
||
|
")",
|
||
|
"Ljava/util/ArrayList",
|
||
|
"<",
|
||
|
"Lcom/viatech/gallery/FileInfo;",
|
||
|
">;"
|
||
|
}
|
||
|
.end annotation
|
||
|
|
||
|
.prologue
|
||
|
.line 486
|
||
|
new-instance v1, Ljava/util/ArrayList;
|
||
|
|
||
|
invoke-direct {v1}, Ljava/util/ArrayList;-><init>()V
|
||
|
|
||
|
.line 488
|
||
|
invoke-virtual {p1}, Landroid/content/Intent;->getAction()Ljava/lang/String;
|
||
|
|
||
|
move-result-object v0
|
||
|
|
||
|
.line 491
|
||
|
:try_start_0
|
||
|
const-string v2, "android.intent.action.VIEW"
|
||
|
|
||
|
invoke-virtual {v2, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
|
||
|
|
||
|
move-result v2
|
||
|
|
||
|
if-eqz v2, :cond_1
|
||
|
|
||
|
.line 492
|
||
|
invoke-virtual {p1}, Landroid/content/Intent;->getData()Landroid/net/Uri;
|
||
|
|
||
|
move-result-object v0
|
||
|
|
||
|
.line 493
|
||
|
invoke-static {p0, v0}, Lcom/viatech/gallery/GalleryUtil;->getFileInfoFromUri(Landroid/content/Context;Landroid/net/Uri;)Lcom/viatech/gallery/FileInfo;
|
||
|
|
||
|
move-result-object v0
|
||
|
|
||
|
.line 494
|
||
|
if-eqz v0, :cond_0
|
||
|
|
||
|
.line 495
|
||
|
invoke-virtual {v1, v0}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
|
||
|
|
||
|
.line 527
|
||
|
:cond_0
|
||
|
:goto_0
|
||
|
return-object v1
|
||
|
|
||
|
.line 496
|
||
|
:cond_1
|
||
|
const-string v2, "android.intent.action.SEND"
|
||
|
|
||
|
invoke-virtual {v2, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
|
||
|
|
||
|
move-result v2
|
||
|
|
||
|
if-eqz v2, :cond_3
|
||
|
|
||
|
.line 497
|
||
|
invoke-virtual {p1}, Landroid/content/Intent;->getExtras()Landroid/os/Bundle;
|
||
|
|
||
|
move-result-object v0
|
||
|
|
||
|
.line 498
|
||
|
const-string v2, "android.intent.extra.STREAM"
|
||
|
|
||
|
invoke-virtual {v0, v2}, Landroid/os/Bundle;->containsKey(Ljava/lang/String;)Z
|
||
|
|
||
|
move-result v2
|
||
|
|
||
|
if-eqz v2, :cond_2
|
||
|
|
||
|
.line 499
|
||
|
const-string v2, "android.intent.extra.STREAM"
|
||
|
|
||
|
invoke-virtual {v0, v2}, Landroid/os/Bundle;->getParcelable(Ljava/lang/String;)Landroid/os/Parcelable;
|
||
|
|
||
|
move-result-object v0
|
||
|
|
||
|
check-cast v0, Landroid/net/Uri;
|
||
|
|
||
|
.line 500
|
||
|
invoke-static {p0, v0}, Lcom/viatech/gallery/GalleryUtil;->getFileInfoFromUri(Landroid/content/Context;Landroid/net/Uri;)Lcom/viatech/gallery/FileInfo;
|
||
|
|
||
|
move-result-object v0
|
||
|
|
||
|
.line 501
|
||
|
if-eqz v0, :cond_0
|
||
|
|
||
|
.line 502
|
||
|
invoke-virtual {v1, v0}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
|
||
|
:try_end_0
|
||
|
.catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0
|
||
|
|
||
|
goto :goto_0
|
||
|
|
||
|
.line 523
|
||
|
:catch_0
|
||
|
move-exception v0
|
||
|
|
||
|
.line 524
|
||
|
invoke-virtual {v0}, Ljava/lang/Exception;->printStackTrace()V
|
||
|
|
||
|
goto :goto_0
|
||
|
|
||
|
.line 503
|
||
|
:cond_2
|
||
|
:try_start_1
|
||
|
const-string v2, "android.intent.extra.SUBJECT"
|
||
|
|
||
|
invoke-virtual {v0, v2}, Landroid/os/Bundle;->containsKey(Ljava/lang/String;)Z
|
||
|
|
||
|
move-result v2
|
||
|
|
||
|
if-eqz v2, :cond_0
|
||
|
|
||
|
const-string v2, "android.intent.extra.TEXT"
|
||
|
|
||
|
.line 504
|
||
|
invoke-virtual {v0, v2}, Landroid/os/Bundle;->containsKey(Ljava/lang/String;)Z
|
||
|
|
||
|
move-result v0
|
||
|
|
||
|
if-eqz v0, :cond_0
|
||
|
|
||
|
.line 505
|
||
|
new-instance v0, Lcom/viatech/gallery/FileInfo;
|
||
|
|
||
|
const-string v2, "android.intent.extra.SUBJECT"
|
||
|
|
||
|
.line 506
|
||
|
invoke-virtual {p1, v2}, Landroid/content/Intent;->getStringExtra(Ljava/lang/String;)Ljava/lang/String;
|
||
|
|
||
|
move-result-object v2
|
||
|
|
||
|
const/4 v3, 0x0
|
||
|
|
||
|
invoke-direct {v0, v2, v3}, Lcom/viatech/gallery/FileInfo;-><init>(Ljava/lang/String;Z)V
|
||
|
|
||
|
.line 507
|
||
|
const-string v2, "android.intent.extra.TEXT"
|
||
|
|
||
|
invoke-virtual {p1, v2}, Landroid/content/Intent;->getStringExtra(Ljava/lang/String;)Ljava/lang/String;
|
||
|
|
||
|
move-result-object v2
|
||
|
|
||
|
iput-object v2, v0, Lcom/viatech/gallery/FileInfo;->path:Ljava/lang/String;
|
||
|
|
||
|
.line 509
|
||
|
invoke-virtual {v1, v0}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
|
||
|
|
||
|
goto :goto_0
|
||
|
|
||
|
.line 511
|
||
|
:cond_3
|
||
|
const-string v2, "android.intent.action.SEND_MULTIPLE"
|
||
|
|
||
|
invoke-virtual {v2, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
|
||
|
|
||
|
move-result v0
|
||
|
|
||
|
if-eqz v0, :cond_0
|
||
|
|
||
|
.line 512
|
||
|
invoke-virtual {p1}, Landroid/content/Intent;->getExtras()Landroid/os/Bundle;
|
||
|
|
||
|
move-result-object v0
|
||
|
|
||
|
.line 513
|
||
|
const-string v2, "android.intent.extra.STREAM"
|
||
|
|
||
|
invoke-virtual {v0, v2}, Landroid/os/Bundle;->containsKey(Ljava/lang/String;)Z
|
||
|
|
||
|
move-result v2
|
||
|
|
||
|
if-eqz v2, :cond_0
|
||
|
|
||
|
.line 514
|
||
|
const-string v2, "android.intent.extra.STREAM"
|
||
|
|
||
|
invoke-virtual {v0, v2}, Landroid/os/Bundle;->getParcelableArrayList(Ljava/lang/String;)Ljava/util/ArrayList;
|
||
|
|
||
|
move-result-object v0
|
||
|
|
||
|
.line 515
|
||
|
invoke-virtual {v0}, Ljava/util/ArrayList;->iterator()Ljava/util/Iterator;
|
||
|
|
||
|
move-result-object v2
|
||
|
|
||
|
:cond_4
|
||
|
:goto_1
|
||
|
invoke-interface {v2}, Ljava/util/Iterator;->hasNext()Z
|
||
|
|
||
|
move-result v0
|
||
|
|
||
|
if-eqz v0, :cond_0
|
||
|
|
||
|
invoke-interface {v2}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
||
|
|
||
|
move-result-object v0
|
||
|
|
||
|
check-cast v0, Landroid/os/Parcelable;
|
||
|
|
||
|
.line 516
|
||
|
check-cast v0, Landroid/net/Uri;
|
||
|
|
||
|
.line 517
|
||
|
invoke-static {p0, v0}, Lcom/viatech/gallery/GalleryUtil;->getFileInfoFromUri(Landroid/content/Context;Landroid/net/Uri;)Lcom/viatech/gallery/FileInfo;
|
||
|
|
||
|
move-result-object v0
|
||
|
|
||
|
.line 518
|
||
|
if-eqz v0, :cond_4
|
||
|
|
||
|
.line 519
|
||
|
invoke-virtual {v1, v0}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
|
||
|
:try_end_1
|
||
|
.catch Ljava/lang/Exception; {:try_start_1 .. :try_end_1} :catch_0
|
||
|
|
||
|
goto :goto_1
|
||
|
.end method
|
||
|
|
||
|
.method public static getVideoThumb(Landroid/content/Context;Ljava/lang/String;I)Landroid/graphics/Bitmap;
|
||
|
.locals 3
|
||
|
|
||
|
.prologue
|
||
|
.line 163
|
||
|
.line 164
|
||
|
invoke-static {p0, p1, p2}, Lcom/viatech/gallery/GalleryUtil;->getVideoThumbFromDB(Landroid/content/Context;Ljava/lang/String;I)Landroid/graphics/Bitmap;
|
||
|
|
||
|
move-result-object v0
|
||
|
|
||
|
.line 165
|
||
|
if-nez v0, :cond_0
|
||
|
|
||
|
sget v1, Landroid/os/Build$VERSION;->SDK_INT:I
|
||
|
|
||
|
const/16 v2, 0x8
|
||
|
|
||
|
if-lt v1, v2, :cond_0
|
||
|
|
||
|
.line 167
|
||
|
:try_start_0
|
||
|
invoke-static {p1, p2}, Landroid/media/ThumbnailUtils;->createVideoThumbnail(Ljava/lang/String;I)Landroid/graphics/Bitmap;
|
||
|
:try_end_0
|
||
|
.catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0
|
||
|
|
||
|
move-result-object v0
|
||
|
|
||
|
.line 172
|
||
|
:cond_0
|
||
|
:goto_0
|
||
|
return-object v0
|
||
|
|
||
|
.line 168
|
||
|
:catch_0
|
||
|
move-exception v1
|
||
|
|
||
|
goto :goto_0
|
||
|
.end method
|
||
|
|
||
|
.method public static getVideoThumbFromDB(Landroid/content/Context;Ljava/lang/String;I)Landroid/graphics/Bitmap;
|
||
|
.locals 8
|
||
|
|
||
|
.prologue
|
||
|
const/4 v6, 0x0
|
||
|
|
||
|
.line 176
|
||
|
.line 179
|
||
|
:try_start_0
|
||
|
new-instance v7, Landroid/graphics/BitmapFactory$Options;
|
||
|
|
||
|
invoke-direct {v7}, Landroid/graphics/BitmapFactory$Options;-><init>()V
|
||
|
|
||
|
.line 180
|
||
|
const/4 v0, 0x0
|
||
|
|
||
|
iput-boolean v0, v7, Landroid/graphics/BitmapFactory$Options;->inDither:Z
|
||
|
|
||
|
.line 181
|
||
|
sget-object v0, Landroid/graphics/Bitmap$Config;->ARGB_8888:Landroid/graphics/Bitmap$Config;
|
||
|
|
||
|
iput-object v0, v7, Landroid/graphics/BitmapFactory$Options;->inPreferredConfig:Landroid/graphics/Bitmap$Config;
|
||
|
|
||
|
.line 183
|
||
|
invoke-virtual {p0}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
|
||
|
|
||
|
move-result-object v0
|
||
|
|
||
|
sget-object v1, Landroid/provider/MediaStore$Video$Media;->EXTERNAL_CONTENT_URI:Landroid/net/Uri;
|
||
|
|
||
|
const/4 v2, 0x1
|
||
|
|
||
|
new-array v2, v2, [Ljava/lang/String;
|
||
|
|
||
|
const/4 v3, 0x0
|
||
|
|
||
|
const-string v4, "_id"
|
||
|
|
||
|
aput-object v4, v2, v3
|
||
|
|
||
|
const-string v3, "_data=?"
|
||
|
|
||
|
const/4 v4, 0x1
|
||
|
|
||
|
new-array v4, v4, [Ljava/lang/String;
|
||
|
|
||
|
const/4 v5, 0x0
|
||
|
|
||
|
aput-object p1, v4, v5
|
||
|
|
||
|
const/4 v5, 0x0
|
||
|
|
||
|
invoke-virtual/range {v0 .. v5}, Landroid/content/ContentResolver;->query(Landroid/net/Uri;[Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;)Landroid/database/Cursor;
|
||
|
:try_end_0
|
||
|
.catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_1
|
||
|
.catchall {:try_start_0 .. :try_end_0} :catchall_0
|
||
|
|
||
|
move-result-object v1
|
||
|
|
||
|
.line 186
|
||
|
if-eqz v1, :cond_0
|
||
|
|
||
|
:try_start_1
|
||
|
invoke-interface {v1}, Landroid/database/Cursor;->getCount()I
|
||
|
:try_end_1
|
||
|
.catch Ljava/lang/Exception; {:try_start_1 .. :try_end_1} :catch_6
|
||
|
.catchall {:try_start_1 .. :try_end_1} :catchall_1
|
||
|
|
||
|
move-result v0
|
||
|
|
||
|
if-nez v0, :cond_2
|
||
|
|
||
|
.line 202
|
||
|
:cond_0
|
||
|
if-eqz v1, :cond_1
|
||
|
|
||
|
.line 203
|
||
|
:try_start_2
|
||
|
invoke-interface {v1}, Landroid/database/Cursor;->close()V
|
||
|
:try_end_2
|
||
|
.catch Ljava/lang/Exception; {:try_start_2 .. :try_end_2} :catch_3
|
||
|
|
||
|
.line 210
|
||
|
:cond_1
|
||
|
:goto_0
|
||
|
return-object v6
|
||
|
|
||
|
.line 189
|
||
|
:cond_2
|
||
|
:try_start_3
|
||
|
invoke-interface {v1}, Landroid/database/Cursor;->moveToFirst()Z
|
||
|
|
||
|
.line 191
|
||
|
const-string v0, "_id"
|
||
|
|
||
|
invoke-interface {v1, v0}, Landroid/database/Cursor;->getColumnIndex(Ljava/lang/String;)I
|
||
|
|
||
|
move-result v0
|
||
|
|
||
|
invoke-interface {v1, v0}, Landroid/database/Cursor;->getString(I)Ljava/lang/String;
|
||
|
:try_end_3
|
||
|
.catch Ljava/lang/Exception; {:try_start_3 .. :try_end_3} :catch_6
|
||
|
.catchall {:try_start_3 .. :try_end_3} :catchall_1
|
||
|
|
||
|
move-result-object v0
|
||
|
|
||
|
.line 192
|
||
|
if-nez v0, :cond_3
|
||
|
|
||
|
.line 202
|
||
|
if-eqz v1, :cond_1
|
||
|
|
||
|
.line 203
|
||
|
:try_start_4
|
||
|
invoke-interface {v1}, Landroid/database/Cursor;->close()V
|
||
|
:try_end_4
|
||
|
.catch Ljava/lang/Exception; {:try_start_4 .. :try_end_4} :catch_0
|
||
|
|
||
|
goto :goto_0
|
||
|
|
||
|
.line 206
|
||
|
:catch_0
|
||
|
move-exception v0
|
||
|
|
||
|
goto :goto_0
|
||
|
|
||
|
.line 195
|
||
|
:cond_3
|
||
|
:try_start_5
|
||
|
invoke-static {v0}, Ljava/lang/Long;->parseLong(Ljava/lang/String;)J
|
||
|
|
||
|
move-result-wide v2
|
||
|
|
||
|
.line 196
|
||
|
invoke-virtual {p0}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
|
||
|
|
||
|
move-result-object v0
|
||
|
|
||
|
invoke-static {v0, v2, v3, p2, v7}, Landroid/provider/MediaStore$Video$Thumbnails;->getThumbnail(Landroid/content/ContentResolver;JILandroid/graphics/BitmapFactory$Options;)Landroid/graphics/Bitmap;
|
||
|
:try_end_5
|
||
|
.catch Ljava/lang/Exception; {:try_start_5 .. :try_end_5} :catch_6
|
||
|
.catchall {:try_start_5 .. :try_end_5} :catchall_1
|
||
|
|
||
|
move-result-object v0
|
||
|
|
||
|
.line 202
|
||
|
if-eqz v1, :cond_4
|
||
|
|
||
|
.line 203
|
||
|
:try_start_6
|
||
|
invoke-interface {v1}, Landroid/database/Cursor;->close()V
|
||
|
:try_end_6
|
||
|
.catch Ljava/lang/Exception; {:try_start_6 .. :try_end_6} :catch_4
|
||
|
|
||
|
:cond_4
|
||
|
:goto_1
|
||
|
move-object v6, v0
|
||
|
|
||
|
.line 210
|
||
|
goto :goto_0
|
||
|
|
||
|
.line 198
|
||
|
:catch_1
|
||
|
move-exception v0
|
||
|
|
||
|
move-object v1, v6
|
||
|
|
||
|
.line 199
|
||
|
:goto_2
|
||
|
:try_start_7
|
||
|
invoke-virtual {v0}, Ljava/lang/Exception;->printStackTrace()V
|
||
|
:try_end_7
|
||
|
.catchall {:try_start_7 .. :try_end_7} :catchall_1
|
||
|
|
||
|
.line 202
|
||
|
if-eqz v1, :cond_5
|
||
|
|
||
|
.line 203
|
||
|
:try_start_8
|
||
|
invoke-interface {v1}, Landroid/database/Cursor;->close()V
|
||
|
:try_end_8
|
||
|
.catch Ljava/lang/Exception; {:try_start_8 .. :try_end_8} :catch_2
|
||
|
|
||
|
:cond_5
|
||
|
move-object v0, v6
|
||
|
|
||
|
.line 207
|
||
|
goto :goto_1
|
||
|
|
||
|
.line 206
|
||
|
:catch_2
|
||
|
move-exception v0
|
||
|
|
||
|
move-object v0, v6
|
||
|
|
||
|
.line 209
|
||
|
goto :goto_1
|
||
|
|
||
|
.line 201
|
||
|
:catchall_0
|
||
|
move-exception v0
|
||
|
|
||
|
.line 202
|
||
|
:goto_3
|
||
|
if-eqz v6, :cond_6
|
||
|
|
||
|
.line 203
|
||
|
:try_start_9
|
||
|
invoke-interface {v6}, Landroid/database/Cursor;->close()V
|
||
|
:try_end_9
|
||
|
.catch Ljava/lang/Exception; {:try_start_9 .. :try_end_9} :catch_5
|
||
|
|
||
|
.line 209
|
||
|
:cond_6
|
||
|
:goto_4
|
||
|
throw v0
|
||
|
|
||
|
.line 206
|
||
|
:catch_3
|
||
|
move-exception v0
|
||
|
|
||
|
goto :goto_0
|
||
|
|
||
|
:catch_4
|
||
|
move-exception v1
|
||
|
|
||
|
goto :goto_1
|
||
|
|
||
|
:catch_5
|
||
|
move-exception v1
|
||
|
|
||
|
goto :goto_4
|
||
|
|
||
|
.line 201
|
||
|
:catchall_1
|
||
|
move-exception v0
|
||
|
|
||
|
move-object v6, v1
|
||
|
|
||
|
goto :goto_3
|
||
|
|
||
|
.line 198
|
||
|
:catch_6
|
||
|
move-exception v0
|
||
|
|
||
|
goto :goto_2
|
||
|
.end method
|
||
|
|
||
|
.method public static makeBitmap(IILjava/lang/String;)Landroid/graphics/Bitmap;
|
||
|
.locals 6
|
||
|
|
||
|
.prologue
|
||
|
const/4 v0, 0x0
|
||
|
|
||
|
const/4 v5, -0x1
|
||
|
|
||
|
.line 337
|
||
|
if-eqz p2, :cond_1
|
||
|
|
||
|
const-string v1, "/"
|
||
|
|
||
|
invoke-virtual {p2, v1}, Ljava/lang/String;->startsWith(Ljava/lang/String;)Z
|
||
|
|
||
|
move-result v1
|
||
|
|
||
|
if-nez v1, :cond_1
|
||
|
|
||
|
.line 338
|
||
|
invoke-static {p0, p1, p2}, Lcom/viatech/gallery/GalleryUtil;->makeNetBitmap(IILjava/lang/String;)Landroid/graphics/Bitmap;
|
||
|
|
||
|
move-result-object v0
|
||
|
|
||
|
.line 370
|
||
|
:cond_0
|
||
|
:goto_0
|
||
|
return-object v0
|
||
|
|
||
|
.line 342
|
||
|
:cond_1
|
||
|
const v1, 0x7fffffff
|
||
|
|
||
|
if-ne p1, v1, :cond_2
|
||
|
|
||
|
.line 344
|
||
|
:try_start_0
|
||
|
new-instance v1, Landroid/graphics/BitmapFactory$Options;
|
||
|
|
||
|
invoke-direct {v1}, Landroid/graphics/BitmapFactory$Options;-><init>()V
|
||
|
|
||
|
.line 345
|
||
|
sget-object v2, Landroid/graphics/Bitmap$Config;->ARGB_8888:Landroid/graphics/Bitmap$Config;
|
||
|
|
||
|
iput-object v2, v1, Landroid/graphics/BitmapFactory$Options;->inPreferredConfig:Landroid/graphics/Bitmap$Config;
|
||
|
|
||
|
.line 346
|
||
|
invoke-static {p2, v1}, Landroid/graphics/BitmapFactory;->decodeFile(Ljava/lang/String;Landroid/graphics/BitmapFactory$Options;)Landroid/graphics/Bitmap;
|
||
|
:try_end_0
|
||
|
.catch Ljava/lang/Throwable; {:try_start_0 .. :try_end_0} :catch_0
|
||
|
|
||
|
move-result-object v0
|
||
|
|
||
|
goto :goto_0
|
||
|
|
||
|
.line 347
|
||
|
:catch_0
|
||
|
move-exception v1
|
||
|
|
||
|
.line 348
|
||
|
const-string v2, "Vpai_Util"
|
||
|
|
||
|
new-instance v3, Ljava/lang/StringBuilder;
|
||
|
|
||
|
invoke-direct {v3}, Ljava/lang/StringBuilder;-><init>()V
|
||
|
|
||
|
const-string v4, "Got exception when decode firstly"
|
||
|
|
||
|
invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
||
|
|
||
|
move-result-object v3
|
||
|
|
||
|
invoke-virtual {v1}, Ljava/lang/Throwable;->getMessage()Ljava/lang/String;
|
||
|
|
||
|
move-result-object v1
|
||
|
|
||
|
invoke-virtual {v3, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
||
|
|
||
|
move-result-object v1
|
||
|
|
||
|
invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
||
|
|
||
|
move-result-object v1
|
||
|
|
||
|
invoke-static {v2, v1}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;)I
|
||
|
|
||
|
.line 349
|
||
|
const/high16 p1, 0x200000
|
||
|
|
||
|
.line 354
|
||
|
:cond_2
|
||
|
:try_start_1
|
||
|
new-instance v1, Landroid/graphics/BitmapFactory$Options;
|
||
|
|
||
|
invoke-direct {v1}, Landroid/graphics/BitmapFactory$Options;-><init>()V
|
||
|
|
||
|
.line 355
|
||
|
const/4 v2, 0x1
|
||
|
|
||
|
iput-boolean v2, v1, Landroid/graphics/BitmapFactory$Options;->inJustDecodeBounds:Z
|
||
|
|
||
|
.line 356
|
||
|
invoke-static {p2, v1}, Landroid/graphics/BitmapFactory;->decodeFile(Ljava/lang/String;Landroid/graphics/BitmapFactory$Options;)Landroid/graphics/Bitmap;
|
||
|
|
||
|
.line 357
|
||
|
iget-boolean v2, v1, Landroid/graphics/BitmapFactory$Options;->mCancel:Z
|
||
|
|
||
|
if-nez v2, :cond_0
|
||
|
|
||
|
iget v2, v1, Landroid/graphics/BitmapFactory$Options;->outWidth:I
|
||
|
|
||
|
if-eq v2, v5, :cond_0
|
||
|
|
||
|
iget v2, v1, Landroid/graphics/BitmapFactory$Options;->outHeight:I
|
||
|
|
||
|
if-eq v2, v5, :cond_0
|
||
|
|
||
|
.line 361
|
||
|
invoke-static {v1, p0, p1}, Lcom/viatech/gallery/GalleryUtil;->computeSampleSize(Landroid/graphics/BitmapFactory$Options;II)I
|
||
|
|
||
|
move-result v2
|
||
|
|
||
|
iput v2, v1, Landroid/graphics/BitmapFactory$Options;->inSampleSize:I
|
||
|
|
||
|
.line 363
|
||
|
const/4 v2, 0x0
|
||
|
|
||
|
iput-boolean v2, v1, Landroid/graphics/BitmapFactory$Options;->inJustDecodeBounds:Z
|
||
|
|
||
|
.line 365
|
||
|
const/4 v2, 0x0
|
||
|
|
||
|
iput-boolean v2, v1, Landroid/graphics/BitmapFactory$Options;->inDither:Z
|
||
|
|
||
|
.line 366
|
||
|
sget-object v2, Landroid/graphics/Bitmap$Config;->ARGB_8888:Landroid/graphics/Bitmap$Config;
|
||
|
|
||
|
iput-object v2, v1, Landroid/graphics/BitmapFactory$Options;->inPreferredConfig:Landroid/graphics/Bitmap$Config;
|
||
|
|
||
|
.line 367
|
||
|
invoke-static {p2, v1}, Landroid/graphics/BitmapFactory;->decodeFile(Ljava/lang/String;Landroid/graphics/BitmapFactory$Options;)Landroid/graphics/Bitmap;
|
||
|
:try_end_1
|
||
|
.catch Ljava/lang/OutOfMemoryError; {:try_start_1 .. :try_end_1} :catch_1
|
||
|
.catchall {:try_start_1 .. :try_end_1} :catchall_0
|
||
|
|
||
|
move-result-object v0
|
||
|
|
||
|
goto :goto_0
|
||
|
|
||
|
.line 368
|
||
|
:catch_1
|
||
|
move-exception v1
|
||
|
|
||
|
.line 369
|
||
|
:try_start_2
|
||
|
const-string v2, "Vpai_Util"
|
||
|
|
||
|
const-string v3, "Got oom exception "
|
||
|
|
||
|
invoke-static {v2, v3, v1}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I
|
||
|
:try_end_2
|
||
|
.catchall {:try_start_2 .. :try_end_2} :catchall_0
|
||
|
|
||
|
goto :goto_0
|
||
|
|
||
|
.line 371
|
||
|
:catchall_0
|
||
|
move-exception v0
|
||
|
|
||
|
.line 373
|
||
|
throw v0
|
||
|
.end method
|
||
|
|
||
|
.method public static makeNetBitmap(IILjava/lang/String;)Landroid/graphics/Bitmap;
|
||
|
.locals 6
|
||
|
|
||
|
.prologue
|
||
|
const/4 v1, 0x0
|
||
|
|
||
|
.line 377
|
||
|
.line 379
|
||
|
const v0, 0x7fffffff
|
||
|
|
||
|
if-ne p1, v0, :cond_0
|
||
|
|
||
|
.line 381
|
||
|
:try_start_0
|
||
|
new-instance v0, Landroid/graphics/BitmapFactory$Options;
|
||
|
|
||
|
invoke-direct {v0}, Landroid/graphics/BitmapFactory$Options;-><init>()V
|
||
|
|
||
|
.line 382
|
||
|
sget-object v2, Landroid/graphics/Bitmap$Config;->ARGB_8888:Landroid/graphics/Bitmap$Config;
|
||
|
|
||
|
iput-object v2, v0, Landroid/graphics/BitmapFactory$Options;->inPreferredConfig:Landroid/graphics/Bitmap$Config;
|
||
|
|
||
|
.line 383
|
||
|
new-instance v2, Ljava/net/URL;
|
||
|
|
||
|
invoke-direct {v2, p2}, Ljava/net/URL;-><init>(Ljava/lang/String;)V
|
||
|
|
||
|
.line 384
|
||
|
invoke-virtual {v2}, Ljava/net/URL;->openStream()Ljava/io/InputStream;
|
||
|
|
||
|
move-result-object v2
|
||
|
|
||
|
.line 385
|
||
|
const/4 v3, 0x0
|
||
|
|
||
|
invoke-static {v2, v3, v0}, Landroid/graphics/BitmapFactory;->decodeStream(Ljava/io/InputStream;Landroid/graphics/Rect;Landroid/graphics/BitmapFactory$Options;)Landroid/graphics/Bitmap;
|
||
|
:try_end_0
|
||
|
.catch Ljava/lang/Throwable; {:try_start_0 .. :try_end_0} :catch_0
|
||
|
|
||
|
move-result-object v0
|
||
|
|
||
|
.line 386
|
||
|
:try_start_1
|
||
|
invoke-virtual {v2}, Ljava/io/InputStream;->close()V
|
||
|
:try_end_1
|
||
|
.catch Ljava/lang/Throwable; {:try_start_1 .. :try_end_1} :catch_3
|
||
|
|
||
|
.line 415
|
||
|
:goto_0
|
||
|
return-object v0
|
||
|
|
||
|
.line 388
|
||
|
:catch_0
|
||
|
move-exception v0
|
||
|
|
||
|
.line 389
|
||
|
:goto_1
|
||
|
const-string v2, "Vpai_Util"
|
||
|
|
||
|
new-instance v3, Ljava/lang/StringBuilder;
|
||
|
|
||
|
invoke-direct {v3}, Ljava/lang/StringBuilder;-><init>()V
|
||
|
|
||
|
const-string v4, "makeNetBitmap error:"
|
||
|
|
||
|
invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
||
|
|
||
|
move-result-object v3
|
||
|
|
||
|
invoke-virtual {v0}, Ljava/lang/Throwable;->getMessage()Ljava/lang/String;
|
||
|
|
||
|
move-result-object v0
|
||
|
|
||
|
invoke-virtual {v3, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
||
|
|
||
|
move-result-object v0
|
||
|
|
||
|
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
||
|
|
||
|
move-result-object v0
|
||
|
|
||
|
invoke-static {v2, v0}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;)I
|
||
|
|
||
|
.line 390
|
||
|
const/high16 p1, 0x200000
|
||
|
|
||
|
.line 395
|
||
|
:cond_0
|
||
|
:try_start_2
|
||
|
new-instance v0, Landroid/graphics/BitmapFactory$Options;
|
||
|
|
||
|
invoke-direct {v0}, Landroid/graphics/BitmapFactory$Options;-><init>()V
|
||
|
|
||
|
.line 396
|
||
|
const/4 v2, 0x1
|
||
|
|
||
|
iput-boolean v2, v0, Landroid/graphics/BitmapFactory$Options;->inJustDecodeBounds:Z
|
||
|
|
||
|
.line 397
|
||
|
const/4 v2, 0x1
|
||
|
|
||
|
iput-boolean v2, v0, Landroid/graphics/BitmapFactory$Options;->inDither:Z
|
||
|
|
||
|
.line 398
|
||
|
sget-object v2, Landroid/graphics/Bitmap$Config;->ARGB_8888:Landroid/graphics/Bitmap$Config;
|
||
|
|
||
|
iput-object v2, v0, Landroid/graphics/BitmapFactory$Options;->inPreferredConfig:Landroid/graphics/Bitmap$Config;
|
||
|
|
||
|
.line 400
|
||
|
new-instance v2, Ljava/net/URL;
|
||
|
|
||
|
invoke-direct {v2, p2}, Ljava/net/URL;-><init>(Ljava/lang/String;)V
|
||
|
|
||
|
.line 401
|
||
|
invoke-virtual {v2}, Ljava/net/URL;->openStream()Ljava/io/InputStream;
|
||
|
|
||
|
move-result-object v3
|
||
|
|
||
|
.line 402
|
||
|
const/4 v4, 0x0
|
||
|
|
||
|
invoke-static {v3, v4, v0}, Landroid/graphics/BitmapFactory;->decodeStream(Ljava/io/InputStream;Landroid/graphics/Rect;Landroid/graphics/BitmapFactory$Options;)Landroid/graphics/Bitmap;
|
||
|
|
||
|
.line 403
|
||
|
invoke-virtual {v3}, Ljava/io/InputStream;->close()V
|
||
|
|
||
|
.line 405
|
||
|
invoke-static {v0, p0, p1}, Lcom/viatech/gallery/GalleryUtil;->computeSampleSize(Landroid/graphics/BitmapFactory$Options;II)I
|
||
|
|
||
|
move-result v3
|
||
|
|
||
|
iput v3, v0, Landroid/graphics/BitmapFactory$Options;->inSampleSize:I
|
||
|
|
||
|
.line 407
|
||
|
const/4 v3, 0x0
|
||
|
|
||
|
iput-boolean v3, v0, Landroid/graphics/BitmapFactory$Options;->inJustDecodeBounds:Z
|
||
|
|
||
|
.line 408
|
||
|
invoke-virtual {v2}, Ljava/net/URL;->openStream()Ljava/io/InputStream;
|
||
|
|
||
|
move-result-object v2
|
||
|
|
||
|
.line 409
|
||
|
const/4 v3, 0x0
|
||
|
|
||
|
.line 410
|
||
|
invoke-static {v2, v3, v0}, Landroid/graphics/BitmapFactory;->decodeStream(Ljava/io/InputStream;Landroid/graphics/Rect;Landroid/graphics/BitmapFactory$Options;)Landroid/graphics/Bitmap;
|
||
|
:try_end_2
|
||
|
.catch Ljava/lang/Exception; {:try_start_2 .. :try_end_2} :catch_2
|
||
|
|
||
|
move-result-object v0
|
||
|
|
||
|
.line 411
|
||
|
:try_start_3
|
||
|
invoke-virtual {v2}, Ljava/io/InputStream;->close()V
|
||
|
:try_end_3
|
||
|
.catch Ljava/lang/Exception; {:try_start_3 .. :try_end_3} :catch_1
|
||
|
|
||
|
goto :goto_0
|
||
|
|
||
|
.line 412
|
||
|
:catch_1
|
||
|
move-exception v1
|
||
|
|
||
|
.line 413
|
||
|
:goto_2
|
||
|
invoke-virtual {v1}, Ljava/lang/Exception;->printStackTrace()V
|
||
|
|
||
|
goto :goto_0
|
||
|
|
||
|
.line 412
|
||
|
:catch_2
|
||
|
move-exception v0
|
||
|
|
||
|
move-object v5, v0
|
||
|
|
||
|
move-object v0, v1
|
||
|
|
||
|
move-object v1, v5
|
||
|
|
||
|
goto :goto_2
|
||
|
|
||
|
.line 388
|
||
|
:catch_3
|
||
|
move-exception v1
|
||
|
|
||
|
move-object v5, v1
|
||
|
|
||
|
move-object v1, v0
|
||
|
|
||
|
move-object v0, v5
|
||
|
|
||
|
goto :goto_1
|
||
|
.end method
|
||
|
|
||
|
.method public static name2DateString(Ljava/lang/String;)Ljava/lang/String;
|
||
|
.locals 3
|
||
|
|
||
|
.prologue
|
||
|
.line 543
|
||
|
const/4 v0, 0x0
|
||
|
|
||
|
const/16 v1, 0x2e
|
||
|
|
||
|
:try_start_0
|
||
|
invoke-virtual {p0, v1}, Ljava/lang/String;->indexOf(I)I
|
||
|
|
||
|
move-result v1
|
||
|
|
||
|
invoke-virtual {p0, v0, v1}, Ljava/lang/String;->substring(II)Ljava/lang/String;
|
||
|
|
||
|
move-result-object v0
|
||
|
|
||
|
.line 544
|
||
|
const-string v1, "[^0-9]"
|
||
|
|
||
|
const-string v2, ""
|
||
|
|
||
|
invoke-virtual {v0, v1, v2}, Ljava/lang/String;->replaceAll(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
|
||
|
|
||
|
move-result-object v0
|
||
|
|
||
|
.line 545
|
||
|
const/4 v1, 0x0
|
||
|
|
||
|
const/16 v2, 0xe
|
||
|
|
||
|
invoke-virtual {v0, v1, v2}, Ljava/lang/String;->substring(II)Ljava/lang/String;
|
||
|
|
||
|
move-result-object v0
|
||
|
|
||
|
.line 546
|
||
|
new-instance v1, Ljava/text/SimpleDateFormat;
|
||
|
|
||
|
const-string v2, "yyyyMMddHHmmss"
|
||
|
|
||
|
invoke-direct {v1, v2}, Ljava/text/SimpleDateFormat;-><init>(Ljava/lang/String;)V
|
||
|
|
||
|
.line 547
|
||
|
invoke-virtual {v1, v0}, Ljava/text/SimpleDateFormat;->parse(Ljava/lang/String;)Ljava/util/Date;
|
||
|
|
||
|
move-result-object v0
|
||
|
|
||
|
.line 548
|
||
|
const-string v2, "yyyy/MM/dd HH:mm:ss"
|
||
|
|
||
|
invoke-virtual {v1, v2}, Ljava/text/SimpleDateFormat;->applyPattern(Ljava/lang/String;)V
|
||
|
|
||
|
.line 549
|
||
|
invoke-virtual {v1, v0}, Ljava/text/SimpleDateFormat;->format(Ljava/util/Date;)Ljava/lang/String;
|
||
|
:try_end_0
|
||
|
.catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0
|
||
|
|
||
|
move-result-object v0
|
||
|
|
||
|
.line 554
|
||
|
:goto_0
|
||
|
return-object v0
|
||
|
|
||
|
.line 551
|
||
|
:catch_0
|
||
|
move-exception v0
|
||
|
|
||
|
.line 552
|
||
|
invoke-virtual {v0}, Ljava/lang/Exception;->printStackTrace()V
|
||
|
|
||
|
.line 554
|
||
|
const/4 v0, 0x0
|
||
|
|
||
|
goto :goto_0
|
||
|
.end method
|
||
|
|
||
|
.method public static name2TimeString(Ljava/lang/String;)Ljava/lang/String;
|
||
|
.locals 3
|
||
|
|
||
|
.prologue
|
||
|
.line 559
|
||
|
const/4 v0, 0x0
|
||
|
|
||
|
const/16 v1, 0x2e
|
||
|
|
||
|
:try_start_0
|
||
|
invoke-virtual {p0, v1}, Ljava/lang/String;->indexOf(I)I
|
||
|
|
||
|
move-result v1
|
||
|
|
||
|
invoke-virtual {p0, v0, v1}, Ljava/lang/String;->substring(II)Ljava/lang/String;
|
||
|
|
||
|
move-result-object v0
|
||
|
|
||
|
.line 560
|
||
|
const-string v1, "[^0-9]"
|
||
|
|
||
|
const-string v2, ""
|
||
|
|
||
|
invoke-virtual {v0, v1, v2}, Ljava/lang/String;->replaceAll(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
|
||
|
|
||
|
move-result-object v0
|
||
|
|
||
|
.line 561
|
||
|
const/4 v1, 0x0
|
||
|
|
||
|
const/16 v2, 0xe
|
||
|
|
||
|
invoke-virtual {v0, v1, v2}, Ljava/lang/String;->substring(II)Ljava/lang/String;
|
||
|
|
||
|
move-result-object v0
|
||
|
|
||
|
.line 562
|
||
|
new-instance v1, Ljava/text/SimpleDateFormat;
|
||
|
|
||
|
const-string v2, "yyyyMMddHHmmss"
|
||
|
|
||
|
invoke-direct {v1, v2}, Ljava/text/SimpleDateFormat;-><init>(Ljava/lang/String;)V
|
||
|
|
||
|
.line 563
|
||
|
invoke-virtual {v1, v0}, Ljava/text/SimpleDateFormat;->parse(Ljava/lang/String;)Ljava/util/Date;
|
||
|
|
||
|
move-result-object v0
|
||
|
|
||
|
.line 564
|
||
|
const-string v2, "HH:mm:ss"
|
||
|
|
||
|
invoke-virtual {v1, v2}, Ljava/text/SimpleDateFormat;->applyPattern(Ljava/lang/String;)V
|
||
|
|
||
|
.line 565
|
||
|
invoke-virtual {v1, v0}, Ljava/text/SimpleDateFormat;->format(Ljava/util/Date;)Ljava/lang/String;
|
||
|
:try_end_0
|
||
|
.catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0
|
||
|
|
||
|
move-result-object v0
|
||
|
|
||
|
.line 570
|
||
|
:goto_0
|
||
|
return-object v0
|
||
|
|
||
|
.line 567
|
||
|
:catch_0
|
||
|
move-exception v0
|
||
|
|
||
|
.line 568
|
||
|
invoke-virtual {v0}, Ljava/lang/Exception;->printStackTrace()V
|
||
|
|
||
|
.line 570
|
||
|
const/4 v0, 0x0
|
||
|
|
||
|
goto :goto_0
|
||
|
.end method
|
||
|
|
||
|
.method public static zoomImg(Landroid/graphics/Bitmap;IIZ)Landroid/graphics/Bitmap;
|
||
|
.locals 7
|
||
|
|
||
|
.prologue
|
||
|
const/4 v1, 0x0
|
||
|
|
||
|
.line 264
|
||
|
if-nez p0, :cond_1
|
||
|
|
||
|
.line 265
|
||
|
const/4 p0, 0x0
|
||
|
|
||
|
.line 281
|
||
|
:cond_0
|
||
|
:goto_0
|
||
|
return-object p0
|
||
|
|
||
|
.line 268
|
||
|
:cond_1
|
||
|
invoke-virtual {p0}, Landroid/graphics/Bitmap;->getWidth()I
|
||
|
|
||
|
move-result v3
|
||
|
|
||
|
.line 269
|
||
|
invoke-virtual {p0}, Landroid/graphics/Bitmap;->getHeight()I
|
||
|
|
||
|
move-result v4
|
||
|
|
||
|
.line 270
|
||
|
if-gt v3, p1, :cond_2
|
||
|
|
||
|
if-le v4, p2, :cond_0
|
||
|
|
||
|
.line 273
|
||
|
:cond_2
|
||
|
int-to-float v0, p1
|
||
|
|
||
|
int-to-float v2, v3
|
||
|
|
||
|
div-float/2addr v0, v2
|
||
|
|
||
|
.line 274
|
||
|
int-to-float v2, p2
|
||
|
|
||
|
int-to-float v5, v4
|
||
|
|
||
|
div-float/2addr v2, v5
|
||
|
|
||
|
.line 275
|
||
|
new-instance v5, Landroid/graphics/Matrix;
|
||
|
|
||
|
invoke-direct {v5}, Landroid/graphics/Matrix;-><init>()V
|
||
|
|
||
|
.line 276
|
||
|
invoke-virtual {v5, v0, v2}, Landroid/graphics/Matrix;->postScale(FF)Z
|
||
|
|
||
|
.line 277
|
||
|
const/4 v6, 0x1
|
||
|
|
||
|
move-object v0, p0
|
||
|
|
||
|
move v2, v1
|
||
|
|
||
|
invoke-static/range {v0 .. v6}, Landroid/graphics/Bitmap;->createBitmap(Landroid/graphics/Bitmap;IIIILandroid/graphics/Matrix;Z)Landroid/graphics/Bitmap;
|
||
|
|
||
|
move-result-object v0
|
||
|
|
||
|
.line 278
|
||
|
if-eqz p0, :cond_3
|
||
|
|
||
|
invoke-virtual {p0}, Landroid/graphics/Bitmap;->isRecycled()Z
|
||
|
|
||
|
move-result v1
|
||
|
|
||
|
if-nez v1, :cond_3
|
||
|
|
||
|
if-eq p0, v0, :cond_3
|
||
|
|
||
|
.line 279
|
||
|
invoke-virtual {p0}, Landroid/graphics/Bitmap;->recycle()V
|
||
|
|
||
|
:cond_3
|
||
|
move-object p0, v0
|
||
|
|
||
|
.line 281
|
||
|
goto :goto_0
|
||
|
.end method
|