今奥全景相机
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.

1557 lines
38 KiB

.class public Lcom/viatech/gallery/FileScanner;
.super Ljava/lang/Object;
.source "FileScanner.java"
# annotations
.annotation system Ldalvik/annotation/MemberClasses;
value = {
Lcom/viatech/gallery/FileScanner$HeaderIdReq;,
Lcom/viatech/gallery/FileScanner$SearchReq;,
Lcom/viatech/gallery/FileScanner$FileSortReq;,
Lcom/viatech/gallery/FileScanner$FileScannerReq;
}
.end annotation
# static fields
.field public static final RESULT_TYPE_SCANNER:I = 0x1
.field public static final RESULT_TYPE_SEARCH:I = 0x2
.field public static final RESULT_TYPE_SORT:I = 0x3
.field public static final SORY_BY_NAME:I = 0x1
.field public static final SORY_BY_NAME_TIME_DOWN:I = 0x6
.field public static final SORY_BY_SIZE_DOWN:I = 0x5
.field public static final SORY_BY_SIZE_UP:I = 0x4
.field public static final SORY_BY_TIME_DOWN:I = 0x3
.field public static final SORY_BY_TIME_UP:I = 0x2
.field private static final TAG:Ljava/lang/String; = "Vpai_FileScanner"
.field static mFileComByName:Ljava/util/Comparator;
.annotation system Ldalvik/annotation/Signature;
value = {
"Ljava/util/Comparator",
"<",
"Lcom/viatech/gallery/FileInfo;",
">;"
}
.end annotation
.end field
.field static mFileComByNameTimeDown:Ljava/util/Comparator;
.annotation system Ldalvik/annotation/Signature;
value = {
"Ljava/util/Comparator",
"<",
"Lcom/viatech/gallery/FileInfo;",
">;"
}
.end annotation
.end field
.field static mFileComBySizeDown:Ljava/util/Comparator;
.annotation system Ldalvik/annotation/Signature;
value = {
"Ljava/util/Comparator",
"<",
"Lcom/viatech/gallery/FileInfo;",
">;"
}
.end annotation
.end field
.field static mFileComBySizeUp:Ljava/util/Comparator;
.annotation system Ldalvik/annotation/Signature;
value = {
"Ljava/util/Comparator",
"<",
"Lcom/viatech/gallery/FileInfo;",
">;"
}
.end annotation
.end field
.field static mFileComByTimeDown:Ljava/util/Comparator;
.annotation system Ldalvik/annotation/Signature;
value = {
"Ljava/util/Comparator",
"<",
"Lcom/viatech/gallery/FileInfo;",
">;"
}
.end annotation
.end field
.field static mFileComByTimeUp:Ljava/util/Comparator;
.annotation system Ldalvik/annotation/Signature;
value = {
"Ljava/util/Comparator",
"<",
"Lcom/viatech/gallery/FileInfo;",
">;"
}
.end annotation
.end field
.field private static mSortType:I
# instance fields
.field private mHandler:Landroid/os/Handler;
.field private mLastScannerReq:Lcom/viatech/gallery/FileScanner$FileScannerReq;
.field private mScannerThread:Lcom/viatech/common/util/WorkThread;
# direct methods
.method static constructor <clinit>()V
.locals 1
.prologue
.line 39
new-instance v0, Lcom/viatech/gallery/FileScanner$1;
invoke-direct {v0}, Lcom/viatech/gallery/FileScanner$1;-><init>()V
sput-object v0, Lcom/viatech/gallery/FileScanner;->mFileComByName:Ljava/util/Comparator;
.line 44
new-instance v0, Lcom/viatech/gallery/FileScanner$2;
invoke-direct {v0}, Lcom/viatech/gallery/FileScanner$2;-><init>()V
sput-object v0, Lcom/viatech/gallery/FileScanner;->mFileComBySizeUp:Ljava/util/Comparator;
.line 52
new-instance v0, Lcom/viatech/gallery/FileScanner$3;
invoke-direct {v0}, Lcom/viatech/gallery/FileScanner$3;-><init>()V
sput-object v0, Lcom/viatech/gallery/FileScanner;->mFileComBySizeDown:Ljava/util/Comparator;
.line 60
new-instance v0, Lcom/viatech/gallery/FileScanner$4;
invoke-direct {v0}, Lcom/viatech/gallery/FileScanner$4;-><init>()V
sput-object v0, Lcom/viatech/gallery/FileScanner;->mFileComByTimeUp:Ljava/util/Comparator;
.line 68
new-instance v0, Lcom/viatech/gallery/FileScanner$5;
invoke-direct {v0}, Lcom/viatech/gallery/FileScanner$5;-><init>()V
sput-object v0, Lcom/viatech/gallery/FileScanner;->mFileComByTimeDown:Ljava/util/Comparator;
.line 76
new-instance v0, Lcom/viatech/gallery/FileScanner$6;
invoke-direct {v0}, Lcom/viatech/gallery/FileScanner$6;-><init>()V
sput-object v0, Lcom/viatech/gallery/FileScanner;->mFileComByNameTimeDown:Ljava/util/Comparator;
.line 85
const/4 v0, 0x3
sput v0, Lcom/viatech/gallery/FileScanner;->mSortType:I
return-void
.end method
.method public constructor <init>()V
.locals 1
.prologue
.line 90
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
.line 91
new-instance v0, Landroid/os/Handler;
invoke-direct {v0}, Landroid/os/Handler;-><init>()V
iput-object v0, p0, Lcom/viatech/gallery/FileScanner;->mHandler:Landroid/os/Handler;
.line 92
return-void
.end method
.method static synthetic access$000(Lcom/viatech/gallery/FileScanner;)Lcom/viatech/gallery/FileScanner$FileScannerReq;
.locals 1
.prologue
.line 28
iget-object v0, p0, Lcom/viatech/gallery/FileScanner;->mLastScannerReq:Lcom/viatech/gallery/FileScanner$FileScannerReq;
return-object v0
.end method
.method static synthetic access$002(Lcom/viatech/gallery/FileScanner;Lcom/viatech/gallery/FileScanner$FileScannerReq;)Lcom/viatech/gallery/FileScanner$FileScannerReq;
.locals 0
.prologue
.line 28
iput-object p1, p0, Lcom/viatech/gallery/FileScanner;->mLastScannerReq:Lcom/viatech/gallery/FileScanner$FileScannerReq;
return-object p1
.end method
.method static synthetic access$200()I
.locals 1
.prologue
.line 28
sget v0, Lcom/viatech/gallery/FileScanner;->mSortType:I
return v0
.end method
.method static synthetic access$300(I)Ljava/util/Comparator;
.locals 1
.prologue
.line 28
invoke-static {p0}, Lcom/viatech/gallery/FileScanner;->getDirSortComp(I)Ljava/util/Comparator;
move-result-object v0
return-object v0
.end method
.method static synthetic access$400(Ljava/lang/String;)Ljava/lang/String;
.locals 1
.prologue
.line 28
invoke-static {p0}, Lcom/viatech/gallery/FileScanner;->fileSizeMsg(Ljava/lang/String;)Ljava/lang/String;
move-result-object v0
return-object v0
.end method
.method static synthetic access$500(I)Ljava/util/Comparator;
.locals 1
.prologue
.line 28
invoke-static {p0}, Lcom/viatech/gallery/FileScanner;->getFileSortComp(I)Ljava/util/Comparator;
move-result-object v0
return-object v0
.end method
.method static synthetic access$700(Lcom/viatech/gallery/FileScanner;)Landroid/os/Handler;
.locals 1
.prologue
.line 28
iget-object v0, p0, Lcom/viatech/gallery/FileScanner;->mHandler:Landroid/os/Handler;
return-object v0
.end method
.method private 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 129
new-instance v1, Ljava/io/File;
invoke-direct {v1, p0}, Ljava/io/File;-><init>(Ljava/lang/String;)V
.line 131
const-string v0, ""
.line 132
if-eqz v1, :cond_0
invoke-virtual {v1}, Ljava/io/File;->isFile()Z
move-result v2
if-eqz v2, :cond_0
.line 133
invoke-virtual {v1}, Ljava/io/File;->length()J
move-result-wide v2
.line 134
const-wide/32 v4, 0x40000000
cmp-long v1, v2, v4
if-ltz v1, :cond_1
.line 135
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 136
invoke-virtual {v0, v1}, Ljava/lang/String;->indexOf(Ljava/lang/String;)I
move-result v0
.line 137
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 153
:cond_0
:goto_0
return-object v0
.line 139
:cond_1
const-wide/32 v4, 0x100000
cmp-long v1, v2, v4
if-ltz v1, :cond_2
.line 140
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 141
invoke-virtual {v0, v1}, Ljava/lang/String;->indexOf(Ljava/lang/String;)I
move-result v0
.line 142
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 144
:cond_2
cmp-long v1, v2, v10
if-ltz v1, :cond_3
.line 145
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 146
invoke-virtual {v0, v1}, Ljava/lang/String;->indexOf(Ljava/lang/String;)I
move-result v0
.line 147
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 149
:cond_3
cmp-long v1, v2, v10
if-gez v1, :cond_0
.line 150
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 private static getDirSortComp(I)Ljava/util/Comparator;
.locals 1
.annotation system Ldalvik/annotation/Signature;
value = {
"(I)",
"Ljava/util/Comparator",
"<",
"Lcom/viatech/gallery/FileInfo;",
">;"
}
.end annotation
.prologue
.line 95
packed-switch p0, :pswitch_data_0
.line 105
sget-object v0, Lcom/viatech/gallery/FileScanner;->mFileComByName:Ljava/util/Comparator;
:goto_0
return-object v0
.line 97
:pswitch_0
sget-object v0, Lcom/viatech/gallery/FileScanner;->mFileComByName:Ljava/util/Comparator;
goto :goto_0
.line 99
:pswitch_1
sget-object v0, Lcom/viatech/gallery/FileScanner;->mFileComByTimeDown:Ljava/util/Comparator;
goto :goto_0
.line 101
:pswitch_2
sget-object v0, Lcom/viatech/gallery/FileScanner;->mFileComByTimeUp:Ljava/util/Comparator;
goto :goto_0
.line 95
nop
:pswitch_data_0
.packed-switch 0x1
:pswitch_0
:pswitch_2
:pswitch_1
.end packed-switch
.end method
.method private static getFileSortComp(I)Ljava/util/Comparator;
.locals 1
.annotation system Ldalvik/annotation/Signature;
value = {
"(I)",
"Ljava/util/Comparator",
"<",
"Lcom/viatech/gallery/FileInfo;",
">;"
}
.end annotation
.prologue
.line 109
packed-switch p0, :pswitch_data_0
.line 125
sget-object v0, Lcom/viatech/gallery/FileScanner;->mFileComByName:Ljava/util/Comparator;
:goto_0
return-object v0
.line 111
:pswitch_0
sget-object v0, Lcom/viatech/gallery/FileScanner;->mFileComByName:Ljava/util/Comparator;
goto :goto_0
.line 113
:pswitch_1
sget-object v0, Lcom/viatech/gallery/FileScanner;->mFileComBySizeDown:Ljava/util/Comparator;
goto :goto_0
.line 115
:pswitch_2
sget-object v0, Lcom/viatech/gallery/FileScanner;->mFileComBySizeUp:Ljava/util/Comparator;
goto :goto_0
.line 117
:pswitch_3
sget-object v0, Lcom/viatech/gallery/FileScanner;->mFileComByTimeDown:Ljava/util/Comparator;
goto :goto_0
.line 119
:pswitch_4
sget-object v0, Lcom/viatech/gallery/FileScanner;->mFileComByTimeUp:Ljava/util/Comparator;
goto :goto_0
.line 121
:pswitch_5
sget-object v0, Lcom/viatech/gallery/FileScanner;->mFileComByNameTimeDown:Ljava/util/Comparator;
goto :goto_0
.line 109
:pswitch_data_0
.packed-switch 0x1
:pswitch_0
:pswitch_4
:pswitch_3
:pswitch_2
:pswitch_1
:pswitch_5
.end packed-switch
.end method
.method public static name2Date(Ljava/lang/String;)J
.locals 6
.prologue
const-wide/16 v0, 0x0
.line 214
if-nez p0, :cond_1
.line 235
:cond_0
:goto_0
return-wide v0
.line 217
:cond_1
const/4 v2, 0x0
const/16 v3, 0x2e
:try_start_0
invoke-virtual {p0, v3}, Ljava/lang/String;->indexOf(I)I
move-result v3
invoke-virtual {p0, v2, v3}, Ljava/lang/String;->substring(II)Ljava/lang/String;
move-result-object p0
.line 218
invoke-static {p0}, Lcom/viatech/gallery/FileScanner;->stripNameRootRand(Ljava/lang/String;)Ljava/lang/String;
move-result-object p0
.line 219
const-string v2, "[^0-9]"
const-string v3, ""
invoke-virtual {p0, v2, v3}, Ljava/lang/String;->replaceAll(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
move-result-object p0
.line 222
invoke-virtual {p0}, Ljava/lang/String;->length()I
move-result v2
const/16 v3, 0xe
if-ne v2, v3, :cond_2
.line 223
new-instance v2, Ljava/text/SimpleDateFormat;
const-string v3, "yyyyMMddHHmmss"
invoke-direct {v2, v3}, Ljava/text/SimpleDateFormat;-><init>(Ljava/lang/String;)V
.line 230
:goto_1
invoke-virtual {v2, p0}, Ljava/text/SimpleDateFormat;->parse(Ljava/lang/String;)Ljava/util/Date;
move-result-object v2
.line 231
invoke-virtual {v2}, Ljava/util/Date;->getTime()J
move-result-wide v0
goto :goto_0
.line 224
:cond_2
invoke-virtual {p0}, Ljava/lang/String;->length()I
move-result v2
const/16 v3, 0x10
if-ne v2, v3, :cond_0
.line 225
new-instance v2, Ljava/text/SimpleDateFormat;
const-string v3, "yyyyMMddHHmmssSS"
invoke-direct {v2, v3}, Ljava/text/SimpleDateFormat;-><init>(Ljava/lang/String;)V
:try_end_0
.catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0
goto :goto_1
.line 232
:catch_0
move-exception v2
.line 233
const-string v3, "Vpai_FileScanner"
new-instance v4, Ljava/lang/StringBuilder;
invoke-direct {v4}, Ljava/lang/StringBuilder;-><init>()V
const-string v5, "Name"
invoke-virtual {v4, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v4
invoke-virtual {v4, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v4
const-string v5, ", Excepption:"
invoke-virtual {v4, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v4
invoke-virtual {v2}, Ljava/lang/Exception;->getMessage()Ljava/lang/String;
move-result-object v2
invoke-virtual {v4, v2}, 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
invoke-static {v3, v2}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I
goto :goto_0
.end method
.method public static newRandNameRoot(Ljava/lang/String;)Ljava/lang/String;
.locals 4
.prologue
.line 201
new-instance v0, Ljava/lang/StringBuilder;
invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V
invoke-virtual {v0, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v0
const-string v1, "-"
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v0
new-instance v1, Ljava/util/Random;
invoke-direct {v1}, Ljava/util/Random;-><init>()V
invoke-virtual {v1}, Ljava/util/Random;->nextLong()J
move-result-wide v2
invoke-static {v2, v3}, Ljava/lang/Long;->toOctalString(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
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v0
return-object v0
.end method
.method public static readJSONArray(Lorg/json/JSONArray;Z)Ljava/util/ArrayList;
.locals 9
.annotation system Ldalvik/annotation/Signature;
value = {
"(",
"Lorg/json/JSONArray;",
"Z)",
"Ljava/util/ArrayList",
"<",
"Lcom/viatech/gallery/FileInfo;",
">;"
}
.end annotation
.prologue
const/4 v8, 0x1
const/4 v0, 0x0
.line 157
new-instance v1, Ljava/util/ArrayList;
invoke-direct {v1}, Ljava/util/ArrayList;-><init>()V
.line 159
const-string v2, "Vpai_FileScanner"
new-instance v3, Ljava/lang/StringBuilder;
invoke-direct {v3}, Ljava/lang/StringBuilder;-><init>()V
const-string v4, "readJSONArray() array= "
invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v3
invoke-virtual {p0}, Lorg/json/JSONArray;->toString()Ljava/lang/String;
move-result-object v4
invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v3
invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v3
invoke-static {v2, v3}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I
.line 161
:goto_0
:try_start_0
invoke-virtual {p0}, Lorg/json/JSONArray;->length()I
move-result v2
if-ge v0, v2, :cond_6
.line 162
invoke-virtual {p0, v0}, Lorg/json/JSONArray;->getJSONObject(I)Lorg/json/JSONObject;
move-result-object v2
.line 163
new-instance v3, Lcom/viatech/gallery/FileInfo;
invoke-direct {v3}, Lcom/viatech/gallery/FileInfo;-><init>()V
.line 164
const-string v4, "filename"
invoke-virtual {v2, v4}, Lorg/json/JSONObject;->optString(Ljava/lang/String;)Ljava/lang/String;
move-result-object v4
iput-object v4, v3, Lcom/viatech/gallery/FileInfo;->name:Ljava/lang/String;
.line 166
const-string v4, "size"
invoke-virtual {v2, v4}, Lorg/json/JSONObject;->optLong(Ljava/lang/String;)J
move-result-wide v4
iput-wide v4, v3, Lcom/viatech/gallery/FileInfo;->lsize:J
.line 167
const/4 v4, 0x0
iput-boolean v4, v3, Lcom/viatech/gallery/FileInfo;->isDirectory:Z
.line 168
iget-object v4, v3, Lcom/viatech/gallery/FileInfo;->name:Ljava/lang/String;
invoke-static {v4}, Lcom/viatech/gallery/FileScanner;->name2Date(Ljava/lang/String;)J
move-result-wide v4
iput-wide v4, v3, Lcom/viatech/gallery/FileInfo;->modifytime:J
.line 169
iget-wide v4, v3, Lcom/viatech/gallery/FileInfo;->modifytime:J
const-wide/16 v6, 0x0
cmp-long v4, v4, v6
if-nez v4, :cond_0
.line 170
const-string v4, "modifytime"
invoke-virtual {v2, v4}, Lorg/json/JSONObject;->optLong(Ljava/lang/String;)J
move-result-wide v4
const-wide/16 v6, 0x3e8
mul-long/2addr v4, v6
iput-wide v4, v3, Lcom/viatech/gallery/FileInfo;->modifytime:J
.line 173
:cond_0
iget-object v4, v3, Lcom/viatech/gallery/FileInfo;->name:Ljava/lang/String;
invoke-static {v4}, Lcom/viatech/common/util/FileMediaType;->getMediaType(Ljava/lang/String;)I
move-result v4
iput v4, v3, Lcom/viatech/gallery/FileInfo;->fileType:I
.line 174
const-string v4, "url"
const/4 v5, 0x0
invoke-virtual {v2, v4, v5}, Lorg/json/JSONObject;->optString(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
move-result-object v4
iput-object v4, v3, Lcom/viatech/gallery/FileInfo;->url:Ljava/lang/String;
.line 175
iget-object v4, v3, Lcom/viatech/gallery/FileInfo;->url:Ljava/lang/String;
if-eqz v4, :cond_1
.line 176
invoke-static {}, Lcom/viatech/camera/RemoteCameraConnectManager;->curDevice()Lcom/viatech/device/VPaiDevice;
move-result-object v4
iget-object v5, v3, Lcom/viatech/gallery/FileInfo;->url:Ljava/lang/String;
invoke-virtual {v4, v5}, Lcom/viatech/device/VPaiDevice;->getDownloadUrl(Ljava/lang/String;)Ljava/lang/String;
move-result-object v4
iput-object v4, v3, Lcom/viatech/gallery/FileInfo;->url:Ljava/lang/String;
.line 178
:cond_1
const-string v4, "thumbnailurl"
const/4 v5, 0x0
invoke-virtual {v2, v4, v5}, Lorg/json/JSONObject;->optString(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
move-result-object v2
iput-object v2, v3, Lcom/viatech/gallery/FileInfo;->thumbnailUrl:Ljava/lang/String;
.line 179
iget-object v2, v3, Lcom/viatech/gallery/FileInfo;->thumbnailUrl:Ljava/lang/String;
if-eqz v2, :cond_2
.line 180
invoke-static {}, Lcom/viatech/camera/RemoteCameraConnectManager;->curDevice()Lcom/viatech/device/VPaiDevice;
move-result-object v2
iget-object v4, v3, Lcom/viatech/gallery/FileInfo;->thumbnailUrl:Ljava/lang/String;
invoke-virtual {v2, v4}, Lcom/viatech/device/VPaiDevice;->getDownloadUrl(Ljava/lang/String;)Ljava/lang/String;
move-result-object v2
iput-object v2, v3, Lcom/viatech/gallery/FileInfo;->thumbnailUrl:Ljava/lang/String;
.line 182
:cond_2
iget v2, v3, Lcom/viatech/gallery/FileInfo;->fileType:I
if-eq v2, v8, :cond_3
iget v2, v3, Lcom/viatech/gallery/FileInfo;->fileType:I
const/4 v4, 0x2
if-ne v2, v4, :cond_5
.line 184
:cond_3
invoke-virtual {v3}, Lcom/viatech/gallery/FileInfo;->getFullPath()Ljava/lang/String;
move-result-object v2
invoke-static {v2}, Lcom/viatech/util/Util;->isFileExist(Ljava/lang/String;)Z
move-result v2
if-eqz v2, :cond_4
.line 185
const/4 v2, 0x1
iput-boolean v2, v3, Lcom/viatech/gallery/FileInfo;->downloaded:Z
.line 187
:cond_4
invoke-virtual {v1, v3}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
.line 188
const-string v2, "Vpai_FileScanner"
new-instance v4, Ljava/lang/StringBuilder;
invoke-direct {v4}, Ljava/lang/StringBuilder;-><init>()V
const-string v5, "List add: name="
invoke-virtual {v4, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v4
iget-object v3, v3, Lcom/viatech/gallery/FileInfo;->name:Ljava/lang/String;
invoke-virtual {v4, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v3
invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v3
invoke-static {v2, v3}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I
:try_end_0
.catch Lorg/json/JSONException; {:try_start_0 .. :try_end_0} :catch_0
.line 161
:cond_5
add-int/lit8 v0, v0, 0x1
goto/16 :goto_0
.line 191
:catch_0
move-exception v0
.line 192
const-string v2, "Vpai_FileScanner"
new-instance v3, Ljava/lang/StringBuilder;
invoke-direct {v3}, Ljava/lang/StringBuilder;-><init>()V
const-string v4, "JSONException = "
invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v3
invoke-virtual {v3, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)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;->i(Ljava/lang/String;Ljava/lang/String;)I
.line 195
:cond_6
sget v0, Lcom/viatech/gallery/FileScanner;->mSortType:I
invoke-static {v0}, Lcom/viatech/gallery/FileScanner;->getFileSortComp(I)Ljava/util/Comparator;
move-result-object v0
invoke-static {v1, v0}, Ljava/util/Collections;->sort(Ljava/util/List;Ljava/util/Comparator;)V
.line 197
return-object v1
.end method
.method public static stripNameRootRand(Ljava/lang/String;)Ljava/lang/String;
.locals 2
.prologue
const/16 v1, 0x2d
.line 206
invoke-virtual {p0, v1}, Ljava/lang/String;->lastIndexOf(I)I
move-result v0
.line 207
if-lez v0, :cond_0
.line 208
const/4 v0, 0x0
invoke-virtual {p0, v1}, Ljava/lang/String;->lastIndexOf(I)I
move-result v1
invoke-virtual {p0, v0, v1}, Ljava/lang/String;->substring(II)Ljava/lang/String;
move-result-object p0
.line 210
:cond_0
return-object p0
.end method
# virtual methods
.method public generateHeaderId(Ljava/util/List;)V
.locals 2
.annotation system Ldalvik/annotation/Signature;
value = {
"(",
"Ljava/util/List",
"<",
"Lcom/viatech/gallery/FileInfo;",
">;)V"
}
.end annotation
.prologue
.line 637
if-nez p1, :cond_1
.line 648
:cond_0
:goto_0
return-void
.line 640
:cond_1
iget-object v0, p0, Lcom/viatech/gallery/FileScanner;->mScannerThread:Lcom/viatech/common/util/WorkThread;
if-nez v0, :cond_2
.line 641
new-instance v0, Lcom/viatech/common/util/WorkThread;
invoke-direct {v0}, Lcom/viatech/common/util/WorkThread;-><init>()V
iput-object v0, p0, Lcom/viatech/gallery/FileScanner;->mScannerThread:Lcom/viatech/common/util/WorkThread;
.line 642
iget-object v0, p0, Lcom/viatech/gallery/FileScanner;->mScannerThread:Lcom/viatech/common/util/WorkThread;
invoke-virtual {v0}, Lcom/viatech/common/util/WorkThread;->start()V
.line 644
:cond_2
new-instance v0, Lcom/viatech/gallery/FileScanner$HeaderIdReq;
invoke-direct {v0, p0, p1}, Lcom/viatech/gallery/FileScanner$HeaderIdReq;-><init>(Lcom/viatech/gallery/FileScanner;Ljava/util/List;)V
.line 645
iget-object v1, p0, Lcom/viatech/gallery/FileScanner;->mScannerThread:Lcom/viatech/common/util/WorkThread;
invoke-virtual {v1, v0}, Lcom/viatech/common/util/WorkThread;->isDuplicateWorking(Lcom/viatech/common/util/Match4Req;)Z
move-result v1
if-nez v1, :cond_0
.line 646
iget-object v1, p0, Lcom/viatech/gallery/FileScanner;->mScannerThread:Lcom/viatech/common/util/WorkThread;
invoke-virtual {v1, v0}, Lcom/viatech/common/util/WorkThread;->addReq(Lcom/viatech/common/util/WorkReq;)V
goto :goto_0
.end method
.method public getScanneringPath()Ljava/lang/String;
.locals 1
.prologue
.line 302
iget-object v0, p0, Lcom/viatech/gallery/FileScanner;->mLastScannerReq:Lcom/viatech/gallery/FileScanner$FileScannerReq;
if-eqz v0, :cond_0
.line 303
iget-object v0, p0, Lcom/viatech/gallery/FileScanner;->mLastScannerReq:Lcom/viatech/gallery/FileScanner$FileScannerReq;
iget-object v0, v0, Lcom/viatech/gallery/FileScanner$FileScannerReq;->mScanPath:Ljava/lang/String;
.line 304
:goto_0
return-object v0
:cond_0
const/4 v0, 0x0
goto :goto_0
.end method
.method public onDestroy()V
.locals 1
.prologue
.line 315
iget-object v0, p0, Lcom/viatech/gallery/FileScanner;->mScannerThread:Lcom/viatech/common/util/WorkThread;
if-eqz v0, :cond_0
.line 316
iget-object v0, p0, Lcom/viatech/gallery/FileScanner;->mScannerThread:Lcom/viatech/common/util/WorkThread;
invoke-virtual {v0}, Lcom/viatech/common/util/WorkThread;->exit()V
.line 318
:cond_0
const/4 v0, 0x0
iput-object v0, p0, Lcom/viatech/gallery/FileScanner;->mScannerThread:Lcom/viatech/common/util/WorkThread;
.line 319
return-void
.end method
.method public onResult(ILjava/lang/String;Ljava/util/ArrayList;)V
.locals 0
.annotation system Ldalvik/annotation/Signature;
value = {
"(I",
"Ljava/lang/String;",
"Ljava/util/ArrayList",
"<",
"Lcom/viatech/gallery/FileInfo;",
">;)V"
}
.end annotation
.prologue
.line 246
return-void
.end method
.method public onResultList(Ljava/util/List;)V
.locals 0
.annotation system Ldalvik/annotation/Signature;
value = {
"(",
"Ljava/util/List",
"<",
"Lcom/viatech/gallery/FileInfo;",
">;)V"
}
.end annotation
.prologue
.line 656
return-void
.end method
.method public searchFileByName(Ljava/lang/String;Ljava/lang/String;)V
.locals 2
.prologue
.line 288
if-eqz p1, :cond_0
if-nez p2, :cond_1
.line 299
:cond_0
:goto_0
return-void
.line 291
:cond_1
iget-object v0, p0, Lcom/viatech/gallery/FileScanner;->mScannerThread:Lcom/viatech/common/util/WorkThread;
if-nez v0, :cond_2
.line 292
new-instance v0, Lcom/viatech/common/util/WorkThread;
invoke-direct {v0}, Lcom/viatech/common/util/WorkThread;-><init>()V
iput-object v0, p0, Lcom/viatech/gallery/FileScanner;->mScannerThread:Lcom/viatech/common/util/WorkThread;
.line 293
iget-object v0, p0, Lcom/viatech/gallery/FileScanner;->mScannerThread:Lcom/viatech/common/util/WorkThread;
invoke-virtual {v0}, Lcom/viatech/common/util/WorkThread;->start()V
.line 295
:cond_2
new-instance v0, Lcom/viatech/gallery/FileScanner$SearchReq;
invoke-direct {v0, p0, p1, p2}, Lcom/viatech/gallery/FileScanner$SearchReq;-><init>(Lcom/viatech/gallery/FileScanner;Ljava/lang/String;Ljava/lang/String;)V
.line 296
iget-object v1, p0, Lcom/viatech/gallery/FileScanner;->mScannerThread:Lcom/viatech/common/util/WorkThread;
invoke-virtual {v1, v0}, Lcom/viatech/common/util/WorkThread;->isDuplicateWorking(Lcom/viatech/common/util/Match4Req;)Z
move-result v1
if-nez v1, :cond_0
.line 297
iget-object v1, p0, Lcom/viatech/gallery/FileScanner;->mScannerThread:Lcom/viatech/common/util/WorkThread;
invoke-virtual {v1, v0}, Lcom/viatech/common/util/WorkThread;->addReq(Lcom/viatech/common/util/WorkReq;)V
goto :goto_0
.end method
.method public setSortType(ILjava/util/ArrayList;Ljava/lang/String;)V
.locals 2
.annotation system Ldalvik/annotation/Signature;
value = {
"(I",
"Ljava/util/ArrayList",
"<",
"Lcom/viatech/gallery/FileInfo;",
">;",
"Ljava/lang/String;",
")V"
}
.end annotation
.prologue
.line 249
sput p1, Lcom/viatech/gallery/FileScanner;->mSortType:I
.line 250
if-nez p2, :cond_1
.line 261
:cond_0
:goto_0
return-void
.line 253
:cond_1
iget-object v0, p0, Lcom/viatech/gallery/FileScanner;->mScannerThread:Lcom/viatech/common/util/WorkThread;
if-nez v0, :cond_2
.line 254
new-instance v0, Lcom/viatech/common/util/WorkThread;
invoke-direct {v0}, Lcom/viatech/common/util/WorkThread;-><init>()V
iput-object v0, p0, Lcom/viatech/gallery/FileScanner;->mScannerThread:Lcom/viatech/common/util/WorkThread;
.line 255
iget-object v0, p0, Lcom/viatech/gallery/FileScanner;->mScannerThread:Lcom/viatech/common/util/WorkThread;
invoke-virtual {v0}, Lcom/viatech/common/util/WorkThread;->start()V
.line 257
:cond_2
new-instance v0, Lcom/viatech/gallery/FileScanner$FileSortReq;
invoke-direct {v0, p0, p1, p2, p3}, Lcom/viatech/gallery/FileScanner$FileSortReq;-><init>(Lcom/viatech/gallery/FileScanner;ILjava/util/ArrayList;Ljava/lang/String;)V
.line 258
iget-object v1, p0, Lcom/viatech/gallery/FileScanner;->mScannerThread:Lcom/viatech/common/util/WorkThread;
invoke-virtual {v1, v0}, Lcom/viatech/common/util/WorkThread;->isDuplicateWorking(Lcom/viatech/common/util/Match4Req;)Z
move-result v1
if-nez v1, :cond_0
.line 259
iget-object v1, p0, Lcom/viatech/gallery/FileScanner;->mScannerThread:Lcom/viatech/common/util/WorkThread;
invoke-virtual {v1, v0}, Lcom/viatech/common/util/WorkThread;->addReq(Lcom/viatech/common/util/WorkReq;)V
goto :goto_0
.end method
.method public startScanner(Ljava/lang/String;IZ)V
.locals 6
.prologue
.line 269
if-nez p1, :cond_1
.line 285
:cond_0
:goto_0
return-void
.line 272
:cond_1
iget-object v0, p0, Lcom/viatech/gallery/FileScanner;->mScannerThread:Lcom/viatech/common/util/WorkThread;
if-nez v0, :cond_2
.line 273
new-instance v0, Lcom/viatech/common/util/WorkThread;
invoke-direct {v0}, Lcom/viatech/common/util/WorkThread;-><init>()V
iput-object v0, p0, Lcom/viatech/gallery/FileScanner;->mScannerThread:Lcom/viatech/common/util/WorkThread;
.line 274
iget-object v0, p0, Lcom/viatech/gallery/FileScanner;->mScannerThread:Lcom/viatech/common/util/WorkThread;
invoke-virtual {v0}, Lcom/viatech/common/util/WorkThread;->start()V
.line 277
:cond_2
new-instance v0, Lcom/viatech/gallery/FileScanner$FileScannerReq;
iget-object v3, p0, Lcom/viatech/gallery/FileScanner;->mHandler:Landroid/os/Handler;
move-object v1, p0
move-object v2, p1
move v4, p2
move v5, p3
invoke-direct/range {v0 .. v5}, Lcom/viatech/gallery/FileScanner$FileScannerReq;-><init>(Lcom/viatech/gallery/FileScanner;Ljava/lang/String;Landroid/os/Handler;IZ)V
.line 278
iget-object v1, p0, Lcom/viatech/gallery/FileScanner;->mScannerThread:Lcom/viatech/common/util/WorkThread;
invoke-virtual {v1, v0}, Lcom/viatech/common/util/WorkThread;->isDuplicateWorking(Lcom/viatech/common/util/Match4Req;)Z
move-result v1
if-nez v1, :cond_0
.line 279
iget-object v1, p0, Lcom/viatech/gallery/FileScanner;->mScannerThread:Lcom/viatech/common/util/WorkThread;
invoke-virtual {v1}, Lcom/viatech/common/util/WorkThread;->cancelReqsList()V
.line 280
iget-object v1, p0, Lcom/viatech/gallery/FileScanner;->mScannerThread:Lcom/viatech/common/util/WorkThread;
invoke-virtual {v1, v0}, Lcom/viatech/common/util/WorkThread;->addReq(Lcom/viatech/common/util/WorkReq;)V
.line 283
iput-object v0, p0, Lcom/viatech/gallery/FileScanner;->mLastScannerReq:Lcom/viatech/gallery/FileScanner$FileScannerReq;
goto :goto_0
.end method
.method public startScanner(Ljava/lang/String;Z)V
.locals 1
.prologue
.line 264
const v0, 0xffff
invoke-virtual {p0, p1, v0, p2}, Lcom/viatech/gallery/FileScanner;->startScanner(Ljava/lang/String;IZ)V
.line 265
return-void
.end method
.method public stopScanner()V
.locals 1
.prologue
.line 308
iget-object v0, p0, Lcom/viatech/gallery/FileScanner;->mScannerThread:Lcom/viatech/common/util/WorkThread;
if-eqz v0, :cond_0
.line 309
iget-object v0, p0, Lcom/viatech/gallery/FileScanner;->mScannerThread:Lcom/viatech/common/util/WorkThread;
invoke-virtual {v0}, Lcom/viatech/common/util/WorkThread;->cancelReqsList()V
.line 311
:cond_0
const/4 v0, 0x0
iput-object v0, p0, Lcom/viatech/gallery/FileScanner;->mLastScannerReq:Lcom/viatech/gallery/FileScanner$FileScannerReq;
.line 312
return-void
.end method