KSearchStringTreeHelper.smali

.class public Lcom/cleanmaster/junk/util/KSearchStringTreeHelper;
.super Ljava/lang/Object;
.source "KSearchStringTreeHelper.java"


# static fields
.field private static final WEI_CHAT_FILE_PATH:Ljava/lang/String; = "/storage/emulated/0/tencent/MicroMsg"

.field private static mContext:Landroid/content/Context;

.field private static mIsInit:Z

.field private static mIsRunning:Z

.field private static mMediaInfoList:Ljava/util/ArrayList;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/ArrayList",
            "<",
            "Lcom/cleanmaster/junk/bean/FilePathInfo;",
            ">;"
        }
    .end annotation
.end field

.field private static mMediaStoreObserve:Landroid/database/ContentObserver;

.field private static mWaitTime:I


# direct methods
.method static constructor <clinit>()V
    .registers 2

    .prologue
    const/4 v0, 0x0

    .line 20
    sput-boolean v0, Lcom/cleanmaster/junk/util/KSearchStringTreeHelper;->mIsInit:Z

    .line 21
    sput-boolean v0, Lcom/cleanmaster/junk/util/KSearchStringTreeHelper;->mIsRunning:Z

    .line 22
    sput v0, Lcom/cleanmaster/junk/util/KSearchStringTreeHelper;->mWaitTime:I

    .line 208
    new-instance v0, Lcom/cleanmaster/junk/util/KSearchStringTreeHelper$1;

    const/4 v1, 0x0

    invoke-direct {v0, v1}, Lcom/cleanmaster/junk/util/KSearchStringTreeHelper$1;-><init>(Landroid/os/Handler;)V

    sput-object v0, Lcom/cleanmaster/junk/util/KSearchStringTreeHelper;->mMediaStoreObserve:Landroid/database/ContentObserver;

    return-void
.end method

.method public constructor <init>()V
    .registers 1

    .prologue
    .line 18
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method

.method private static checkInit()Z
    .registers 1

    .prologue
    .line 217
    sget-boolean v0, Lcom/cleanmaster/junk/util/KSearchStringTreeHelper;->mIsInit:Z

    if-nez v0, :cond_9

    .line 218
    sget-object v0, Lcom/cleanmaster/junk/util/KSearchStringTreeHelper;->mContext:Landroid/content/Context;

    invoke-static {v0}, Lcom/cleanmaster/junk/util/KSearchStringTreeHelper;->initSearchTree(Landroid/content/Context;)V

    .line 220
    :cond_9
    sget-boolean v0, Lcom/cleanmaster/junk/util/KSearchStringTreeHelper;->mIsInit:Z

    return v0
.end method

.method public static findListByPath(Ljava/lang/String;JZ)Ljava/util/ArrayList;
    .registers 11
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/lang/String;",
            "JZ)",
            "Ljava/util/ArrayList",
            "<",
            "Lcom/cleanmaster/junk/bean/FilePathInfo;",
            ">;"
        }
    .end annotation

    .prologue
    const/4 v6, 0x1

    const/4 v4, 0x0

    const/4 v2, -0x1

    .line 171
    new-instance v0, Ljava/util/ArrayList;

    invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V

    .line 172
    invoke-static {}, Lcom/cleanmaster/junk/util/KSearchStringTreeHelper;->waitInit()Z

    move-result v1

    if-nez v1, :cond_f

    .line 191
    :cond_e
    :goto_e
    return-object v0

    .line 175
    :cond_f
    invoke-static {}, Lcom/cleanmaster/junk/util/KSearchStringTreeHelper;->checkInit()Z

    move-result v1

    if-eqz v1, :cond_e

    .line 178
    invoke-static {p0}, Lcom/cleanmaster/junk/util/KSearchStringTreeHelper;->findPrefixStringPosition(Ljava/lang/String;)[I

    move-result-object v3

    .line 179
    if-eqz v3, :cond_e

    aget v1, v3, v4

    if-eq v1, v2, :cond_e

    aget v1, v3, v6

    if-eq v1, v2, :cond_e

    .line 180
    new-instance v2, Ljava/util/ArrayList;

    invoke-direct {v2}, Ljava/util/ArrayList;-><init>()V

    .line 181
    aget v0, v3, v4

    move v1, v0

    :goto_2b
    aget v0, v3, v6

    if-ge v1, v0, :cond_5c

    .line 183
    sget-object v0, Lcom/cleanmaster/junk/util/KSearchStringTreeHelper;->mMediaInfoList:Ljava/util/ArrayList;

    invoke-virtual {v0, v1}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/cleanmaster/junk/bean/FilePathInfo;

    iget-wide v4, v0, Lcom/cleanmaster/junk/bean/FilePathInfo;->modifyTime:J

    .line 184
    if-eqz p3, :cond_4c

    cmp-long v0, v4, p1

    if-gez v0, :cond_4c

    .line 185
    sget-object v0, Lcom/cleanmaster/junk/util/KSearchStringTreeHelper;->mMediaInfoList:Ljava/util/ArrayList;

    invoke-virtual {v0, v1}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;

    move-result-object v0

    invoke-virtual {v2, v0}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z

    .line 181
    :cond_48
    :goto_48
    add-int/lit8 v0, v1, 0x1

    move v1, v0

    goto :goto_2b

    .line 186
    :cond_4c
    if-nez p3, :cond_48

    cmp-long v0, v4, p1

    if-lez v0, :cond_48

    .line 187
    sget-object v0, Lcom/cleanmaster/junk/util/KSearchStringTreeHelper;->mMediaInfoList:Ljava/util/ArrayList;

    invoke-virtual {v0, v1}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;

    move-result-object v0

    invoke-virtual {v2, v0}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z

    goto :goto_48

    :cond_5c
    move-object v0, v2

    goto :goto_e
.end method

.method public static findListByPath(Ljava/lang/String;Lcom/cm/plugincluster/junkengine/util/INameFilter;)Ljava/util/ArrayList;
    .registers 11
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/lang/String;",
            "Lcom/cm/plugincluster/junkengine/util/INameFilter;",
            ")",
            "Ljava/util/ArrayList",
            "<",
            "Lcom/cleanmaster/junk/bean/FilePathInfo;",
            ">;"
        }
    .end annotation

    .prologue
    const/4 v8, 0x1

    const/4 v7, -0x1

    const/4 v6, 0x0

    .line 114
    new-instance v2, Ljava/util/ArrayList;

    invoke-direct {v2}, Ljava/util/ArrayList;-><init>()V

    .line 115
    invoke-static {}, Lcom/cleanmaster/junk/util/KSearchStringTreeHelper;->waitInit()Z

    move-result v0

    if-nez v0, :cond_10

    move-object v0, v2

    .line 139
    :goto_f
    return-object v0

    .line 118
    :cond_10
    invoke-static {}, Lcom/cleanmaster/junk/util/KSearchStringTreeHelper;->checkInit()Z

    move-result v0

    if-nez v0, :cond_18

    move-object v0, v2

    .line 119
    goto :goto_f

    .line 121
    :cond_18
    invoke-static {p0}, Lcom/cleanmaster/junk/util/KSearchStringTreeHelper;->findPrefixStringPosition(Ljava/lang/String;)[I

    move-result-object v3

    .line 125
    if-eqz v3, :cond_65

    aget v0, v3, v6

    if-eq v0, v7, :cond_65

    aget v0, v3, v8

    if-eq v0, v7, :cond_65

    .line 126
    aget v0, v3, v6

    move v1, v0

    :goto_29
    aget v0, v3, v8

    if-ge v1, v0, :cond_65

    .line 127
    const/16 v0, 0x2f

    invoke-virtual {p0, v0}, Ljava/lang/String;->lastIndexOf(I)I

    move-result v4

    .line 128
    if-eq v4, v7, :cond_47

    .line 129
    sget-object v0, Lcom/cleanmaster/junk/util/KSearchStringTreeHelper;->mMediaInfoList:Ljava/util/ArrayList;

    invoke-virtual {v0, v1}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/cleanmaster/junk/bean/FilePathInfo;

    iget-object v0, v0, Lcom/cleanmaster/junk/bean/FilePathInfo;->format:Ljava/lang/String;

    const-string v5, "12289"

    invoke-virtual {v0, v5}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v0

    if-eqz v0, :cond_4b

    .line 126
    :cond_47
    :goto_47
    add-int/lit8 v0, v1, 0x1

    move v1, v0

    goto :goto_29

    .line 132
    :cond_4b
    invoke-virtual {p0, v6, v4}, Ljava/lang/String;->substring(II)Ljava/lang/String;

    move-result-object v0

    add-int/lit8 v4, v4, 0x1

    invoke-virtual {p0, v4}, Ljava/lang/String;->substring(I)Ljava/lang/String;

    move-result-object v4

    invoke-interface {p1, v0, v4, v6}, Lcom/cm/plugincluster/junkengine/util/INameFilter;->accept(Ljava/lang/String;Ljava/lang/String;Z)Z

    move-result v0

    .line 133
    if-eqz v0, :cond_47

    .line 134
    sget-object v0, Lcom/cleanmaster/junk/util/KSearchStringTreeHelper;->mMediaInfoList:Ljava/util/ArrayList;

    invoke-virtual {v0, v1}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;

    move-result-object v0

    invoke-virtual {v2, v0}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z

    goto :goto_47

    :cond_65
    move-object v0, v2

    .line 139
    goto :goto_f
.end method

.method public static findMatchList(Ljava/lang/String;Ljava/lang/String;)Ljava/util/ArrayList;
    .registers 11
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/lang/String;",
            "Ljava/lang/String;",
            ")",
            "Ljava/util/ArrayList",
            "<",
            "Lcom/cleanmaster/junk/bean/FilePathInfo;",
            ">;"
        }
    .end annotation

    .prologue
    const/4 v8, 0x1

    const/4 v6, 0x0

    const/4 v1, -0x1

    .line 143
    new-instance v2, Ljava/util/ArrayList;

    invoke-direct {v2}, Ljava/util/ArrayList;-><init>()V

    .line 144
    invoke-static {}, Lcom/cleanmaster/junk/util/KSearchStringTreeHelper;->waitInit()Z

    move-result v0

    if-nez v0, :cond_10

    move-object v0, v2

    .line 167
    :goto_f
    return-object v0

    .line 147
    :cond_10
    invoke-static {}, Lcom/cleanmaster/junk/util/KSearchStringTreeHelper;->checkInit()Z

    move-result v0

    if-nez v0, :cond_18

    move-object v0, v2

    .line 148
    goto :goto_f

    .line 150
    :cond_18
    invoke-static {p0}, Lcom/cleanmaster/junk/util/KSearchStringTreeHelper;->findPrefixStringPosition(Ljava/lang/String;)[I

    move-result-object v3

    .line 152
    invoke-static {p0}, Lcom/cleanmaster/junk/util/FileUtils;->addSlash(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v4

    .line 153
    if-eqz v3, :cond_6f

    aget v0, v3, v6

    if-eq v0, v1, :cond_6f

    aget v0, v3, v8

    if-eq v0, v1, :cond_6f

    .line 154
    invoke-static {p1}, Ljava/util/regex/Pattern;->compile(Ljava/lang/String;)Ljava/util/regex/Pattern;

    move-result-object v0

    .line 155
    const-string v1, ""

    invoke-virtual {v0, v1}, Ljava/util/regex/Pattern;->matcher(Ljava/lang/CharSequence;)Ljava/util/regex/Matcher;

    move-result-object v5

    .line 156
    aget v0, v3, v6

    move v1, v0

    :goto_37
    aget v0, v3, v8

    if-ge v1, v0, :cond_6f

    .line 157
    sget-object v0, Lcom/cleanmaster/junk/util/KSearchStringTreeHelper;->mMediaInfoList:Ljava/util/ArrayList;

    invoke-virtual {v0, v1}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/cleanmaster/junk/bean/FilePathInfo;

    iget-object v0, v0, Lcom/cleanmaster/junk/bean/FilePathInfo;->path:Ljava/lang/String;

    .line 158
    invoke-virtual {v0}, Ljava/lang/String;->length()I

    move-result v6

    invoke-virtual {v4}, Ljava/lang/String;->length()I

    move-result v7

    if-ge v6, v7, :cond_53

    .line 156
    :cond_4f
    :goto_4f
    add-int/lit8 v0, v1, 0x1

    move v1, v0

    goto :goto_37

    .line 161
    :cond_53
    invoke-virtual {v4}, Ljava/lang/String;->length()I

    move-result v6

    invoke-virtual {v0, v6}, Ljava/lang/String;->substring(I)Ljava/lang/String;

    move-result-object v0

    invoke-virtual {v5, v0}, Ljava/util/regex/Matcher;->reset(Ljava/lang/CharSequence;)Ljava/util/regex/Matcher;

    move-result-object v0

    invoke-virtual {v0}, Ljava/util/regex/Matcher;->matches()Z

    move-result v0

    .line 162
    if-eqz v0, :cond_4f

    .line 163
    sget-object v0, Lcom/cleanmaster/junk/util/KSearchStringTreeHelper;->mMediaInfoList:Ljava/util/ArrayList;

    invoke-virtual {v0, v1}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;

    move-result-object v0

    invoke-virtual {v2, v0}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z

    goto :goto_4f

    :cond_6f
    move-object v0, v2

    .line 167
    goto :goto_f
.end method

.method private static findPrefixStringPosition(Ljava/lang/String;)[I
    .registers 2

    .prologue
    .line 195
    sget-object v0, Lcom/cleanmaster/junk/util/KSearchStringTreeHelper;->mMediaInfoList:Ljava/util/ArrayList;

    invoke-static {v0, p0}, Lcom/cleanmaster/junk/scan/KSearchPrefixString;->findPrefixStringPosition(Ljava/util/List;Ljava/lang/String;)[I

    move-result-object v0

    return-object v0
.end method

.method private static initListFromMediaStore(Landroid/content/Context;)Ljava/util/ArrayList;
    .registers 9
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Landroid/content/Context;",
            ")",
            "Ljava/util/ArrayList",
            "<",
            "Lcom/cleanmaster/junk/bean/FilePathInfo;",
            ">;"
        }
    .end annotation

    .prologue
    const/4 v5, 0x3

    const/4 v6, 0x0

    const/4 v4, 0x2

    const/4 v3, 0x1

    const/4 v1, 0x0

    .line 45
    .line 47
    const/4 v0, 0x5

    new-array v2, v0, [Ljava/lang/String;

    const-string v0, "_data"

    aput-object v0, v2, v1

    const-string v0, "format"

    aput-object v0, v2, v3

    const-string v0, "date_modified"

    aput-object v0, v2, v4

    const-string v0, "_size"

    aput-object v0, v2, v5

    const/4 v0, 0x4

    const-string v1, "mime_type"

    aput-object v1, v2, v0

    .line 54
    const-string v3, "_data > ? AND _data < ? and title!=\'.nomedia\'"

    .line 56
    :try_start_1f
    invoke-virtual {p0}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;

    move-result-object v0

    const-string v1, "external"

    .line 57
    invoke-static {v1}, Landroid/provider/MediaStore$Files;->getContentUri(Ljava/lang/String;)Landroid/net/Uri;

    move-result-object v1

    const/4 v4, 0x2

    new-array v4, v4, [Ljava/lang/String;

    const/4 v5, 0x0

    const-string v7, "/storage/emulated/0/tencent/MicroMsg"

    .line 60
    invoke-static {v7}, Lcom/cleanmaster/junk/util/FileUtils;->addSlash(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v7

    aput-object v7, v4, v5

    const/4 v5, 0x1

    const-string v7, "/storage/emulated/0/tencent/MicroMsg"

    invoke-static {v7}, Lcom/cleanmaster/junk/util/FileUtils;->replaceEndSlashBy0(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v7

    aput-object v7, v4, v5

    const/4 v5, 0x0

    .line 57
    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_42
    .catch Ljava/lang/Exception; {:try_start_1f .. :try_end_42} :catch_b3
    .catch Ljava/lang/OutOfMemoryError; {:try_start_1f .. :try_end_42} :catch_9b
    .catchall {:try_start_1f .. :try_end_42} :catchall_a4

    move-result-object v1

    .line 63
    if-eqz v1, :cond_94

    .line 64
    :try_start_45
    new-instance v0, Ljava/util/ArrayList;

    invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V
    :try_end_4a
    .catch Ljava/lang/Exception; {:try_start_45 .. :try_end_4a} :catch_b6
    .catch Ljava/lang/OutOfMemoryError; {:try_start_45 .. :try_end_4a} :catch_ae
    .catchall {:try_start_45 .. :try_end_4a} :catchall_ac

    .line 65
    :goto_4a
    :try_start_4a
    invoke-interface {v1}, Landroid/database/Cursor;->moveToNext()Z

    move-result v2

    if-eqz v2, :cond_95

    .line 66
    new-instance v3, Lcom/cleanmaster/junk/bean/FilePathInfo;

    invoke-direct {v3}, Lcom/cleanmaster/junk/bean/FilePathInfo;-><init>()V

    .line 67
    const/4 v2, 0x0

    invoke-interface {v1, v2}, Landroid/database/Cursor;->getString(I)Ljava/lang/String;

    move-result-object v2

    .line 68
    invoke-static {v2}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z

    move-result v4

    if-eqz v4, :cond_62

    .line 69
    const-string v2, ""

    .line 71
    :cond_62
    iput-object v2, v3, Lcom/cleanmaster/junk/bean/FilePathInfo;->path:Ljava/lang/String;

    .line 72
    const/4 v2, 0x1

    invoke-interface {v1, v2}, Landroid/database/Cursor;->getString(I)Ljava/lang/String;

    move-result-object v2

    iput-object v2, v3, Lcom/cleanmaster/junk/bean/FilePathInfo;->format:Ljava/lang/String;

    .line 73
    const/4 v2, 0x2

    invoke-interface {v1, v2}, Landroid/database/Cursor;->getLong(I)J

    move-result-wide v4

    iput-wide v4, v3, Lcom/cleanmaster/junk/bean/FilePathInfo;->modifyTime:J

    .line 74
    const/4 v2, 0x3

    invoke-interface {v1, v2}, Landroid/database/Cursor;->getLong(I)J

    move-result-wide v4

    iput-wide v4, v3, Lcom/cleanmaster/junk/bean/FilePathInfo;->size:J

    .line 75
    const/4 v2, 0x4

    invoke-interface {v1, v2}, Landroid/database/Cursor;->getString(I)Ljava/lang/String;

    move-result-object v2

    invoke-static {v2}, Lcom/cleanmaster/junk/bean/FilePathInfo;->MediaTypeByMimeStr(Ljava/lang/String;)I

    move-result v2

    iput v2, v3, Lcom/cleanmaster/junk/bean/FilePathInfo;->mediaType:I

    .line 76
    sget-byte v2, Lcom/cleanmaster/junk/bean/FilePathInfo;->SIZEINFO_SRC_MEDIASTORE:B

    iput-byte v2, v3, Lcom/cleanmaster/junk/bean/FilePathInfo;->sizeInfoSrc:B

    .line 77
    invoke-virtual {v0, v3}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
    :try_end_8b
    .catch Ljava/lang/Exception; {:try_start_4a .. :try_end_8b} :catch_8c
    .catch Ljava/lang/OutOfMemoryError; {:try_start_4a .. :try_end_8b} :catch_b1
    .catchall {:try_start_4a .. :try_end_8b} :catchall_ac

    goto :goto_4a

    .line 81
    :catch_8c
    move-exception v2

    move-object v6, v1

    .line 84
    :goto_8e
    if-eqz v6, :cond_93

    .line 85
    invoke-interface {v6}, Landroid/database/Cursor;->close()V

    .line 88
    :cond_93
    :goto_93
    return-object v0

    :cond_94
    move-object v0, v6

    .line 84
    :cond_95
    if-eqz v1, :cond_93

    .line 85
    invoke-interface {v1}, Landroid/database/Cursor;->close()V

    goto :goto_93

    .line 82
    :catch_9b
    move-exception v0

    move-object v0, v6

    move-object v1, v6

    .line 84
    :goto_9e
    if-eqz v1, :cond_93

    .line 85
    invoke-interface {v1}, Landroid/database/Cursor;->close()V

    goto :goto_93

    .line 84
    :catchall_a4
    move-exception v0

    move-object v1, v6

    :goto_a6
    if-eqz v1, :cond_ab

    .line 85
    invoke-interface {v1}, Landroid/database/Cursor;->close()V

    :cond_ab
    throw v0

    .line 84
    :catchall_ac
    move-exception v0

    goto :goto_a6

    .line 82
    :catch_ae
    move-exception v0

    move-object v0, v6

    goto :goto_9e

    :catch_b1
    move-exception v2

    goto :goto_9e

    .line 81
    :catch_b3
    move-exception v0

    move-object v0, v6

    goto :goto_8e

    :catch_b6
    move-exception v0

    move-object v0, v6

    move-object v6, v1

    goto :goto_8e
.end method

.method public static declared-synchronized initSearchTree(Landroid/content/Context;)V
    .registers 4

    .prologue
    .line 27
    const-class v1, Lcom/cleanmaster/junk/util/KSearchStringTreeHelper;

    monitor-enter v1

    :try_start_3
    invoke-virtual {p0}, Landroid/content/Context;->getApplicationContext()Landroid/content/Context;

    move-result-object v0

    sput-object v0, Lcom/cleanmaster/junk/util/KSearchStringTreeHelper;->mContext:Landroid/content/Context;

    .line 28
    sget-boolean v0, Lcom/cleanmaster/junk/util/KSearchStringTreeHelper;->mIsInit:Z
    :try_end_b
    .catchall {:try_start_3 .. :try_end_b} :catchall_30

    if-eqz v0, :cond_f

    .line 42
    :cond_d
    :goto_d
    monitor-exit v1

    return-void

    .line 31
    :cond_f
    const/4 v0, 0x1

    :try_start_10
    sput-boolean v0, Lcom/cleanmaster/junk/util/KSearchStringTreeHelper;->mIsRunning:Z

    .line 32
    invoke-static {p0}, Lcom/cleanmaster/junk/util/KSearchStringTreeHelper;->initListFromMediaStore(Landroid/content/Context;)Ljava/util/ArrayList;

    move-result-object v0

    sput-object v0, Lcom/cleanmaster/junk/util/KSearchStringTreeHelper;->mMediaInfoList:Ljava/util/ArrayList;

    .line 33
    const/4 v0, 0x0

    sput-boolean v0, Lcom/cleanmaster/junk/util/KSearchStringTreeHelper;->mIsRunning:Z

    .line 34
    sget-object v0, Lcom/cleanmaster/junk/util/KSearchStringTreeHelper;->mMediaInfoList:Ljava/util/ArrayList;
    :try_end_1d
    .catchall {:try_start_10 .. :try_end_1d} :catchall_30

    if-eqz v0, :cond_d

    .line 36
    :try_start_1f
    sget-object v0, Lcom/cleanmaster/junk/util/KSearchStringTreeHelper;->mMediaInfoList:Ljava/util/ArrayList;

    new-instance v2, Lcom/cleanmaster/junk/bean/FilePathInfo;

    invoke-direct {v2}, Lcom/cleanmaster/junk/bean/FilePathInfo;-><init>()V

    invoke-static {v0, v2}, Ljava/util/Collections;->sort(Ljava/util/List;Ljava/util/Comparator;)V
    :try_end_29
    .catch Ljava/lang/OutOfMemoryError; {:try_start_1f .. :try_end_29} :catch_33
    .catchall {:try_start_1f .. :try_end_29} :catchall_30

    .line 39
    :goto_29
    const/4 v0, 0x1

    :try_start_2a
    sput-boolean v0, Lcom/cleanmaster/junk/util/KSearchStringTreeHelper;->mIsInit:Z

    .line 40
    invoke-static {p0}, Lcom/cleanmaster/junk/util/KSearchStringTreeHelper;->registerMediaStoreListener(Landroid/content/Context;)V
    :try_end_2f
    .catchall {:try_start_2a .. :try_end_2f} :catchall_30

    goto :goto_d

    .line 27
    :catchall_30
    move-exception v0

    monitor-exit v1

    throw v0

    .line 37
    :catch_33
    move-exception v0

    goto :goto_29
.end method

.method private static registerMediaStoreListener(Landroid/content/Context;)V
    .registers 5

    .prologue
    .line 199
    invoke-virtual {p0}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;

    move-result-object v0

    const-string v1, "external"

    invoke-static {v1}, Landroid/provider/MediaStore$Files;->getContentUri(Ljava/lang/String;)Landroid/net/Uri;

    move-result-object v1

    const/4 v2, 0x0

    sget-object v3, Lcom/cleanmaster/junk/util/KSearchStringTreeHelper;->mMediaStoreObserve:Landroid/database/ContentObserver;

    invoke-virtual {v0, v1, v2, v3}, Landroid/content/ContentResolver;->registerContentObserver(Landroid/net/Uri;ZLandroid/database/ContentObserver;)V

    .line 200
    return-void
.end method

.method public static reset()V
    .registers 1

    .prologue
    const/4 v0, 0x0

    .line 92
    sput-boolean v0, Lcom/cleanmaster/junk/util/KSearchStringTreeHelper;->mIsInit:Z

    .line 93
    sput-boolean v0, Lcom/cleanmaster/junk/util/KSearchStringTreeHelper;->mIsRunning:Z

    .line 94
    return-void
.end method

.method public static unregisterMediaStoreListener(Landroid/content/Context;)V
    .registers 3

    .prologue
    .line 203
    sget-object v0, Lcom/cleanmaster/junk/util/KSearchStringTreeHelper;->mMediaStoreObserve:Landroid/database/ContentObserver;

    if-eqz v0, :cond_d

    .line 204
    invoke-virtual {p0}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;

    move-result-object v0

    sget-object v1, Lcom/cleanmaster/junk/util/KSearchStringTreeHelper;->mMediaStoreObserve:Landroid/database/ContentObserver;

    invoke-virtual {v0, v1}, Landroid/content/ContentResolver;->unregisterContentObserver(Landroid/database/ContentObserver;)V

    .line 206
    :cond_d
    return-void
.end method

.method private static waitInit()Z
    .registers 6

    .prologue
    const/4 v0, 0x0

    .line 97
    const/16 v1, 0x10

    .line 98
    const/16 v2, 0x7d0

    .line 99
    :cond_5
    sget-boolean v3, Lcom/cleanmaster/junk/util/KSearchStringTreeHelper;->mIsRunning:Z

    if-eqz v3, :cond_17

    .line 101
    :try_start_9
    sget v3, Lcom/cleanmaster/junk/util/KSearchStringTreeHelper;->mWaitTime:I

    add-int/2addr v3, v1

    sput v3, Lcom/cleanmaster/junk/util/KSearchStringTreeHelper;->mWaitTime:I

    .line 102
    int-to-long v4, v1

    invoke-static {v4, v5}, Ljava/lang/Thread;->sleep(J)V

    .line 103
    sget v3, Lcom/cleanmaster/junk/util/KSearchStringTreeHelper;->mWaitTime:I
    :try_end_14
    .catch Ljava/lang/Exception; {:try_start_9 .. :try_end_14} :catch_19

    if-le v3, v2, :cond_5

    .line 110
    :goto_16
    return v0

    :cond_17
    const/4 v0, 0x1

    goto :goto_16

    .line 106
    :catch_19
    move-exception v1

    goto :goto_16
.end method