e.smali

.class public Lcom/plug/services/e;
.super Ljava/lang/Object;
.source "ProPluginInfoGetter.java"


# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lcom/plug/services/e$b;,
        Lcom/plug/services/e$a;
    }
.end annotation


# static fields
.field private static a:Landroid/os/HandlerThread;

.field private static b:Landroid/os/Handler;

.field private static c:Landroid/os/HandlerThread;

.field private static d:Landroid/os/Handler;

.field private static final e:[Ljava/lang/String;

.field private static final f:Ljava/util/HashMap;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/HashMap",
            "<",
            "Ljava/lang/String;",
            "Lcom/plug/services/a;",
            ">;"
        }
    .end annotation
.end field


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

    .prologue
    const/4 v0, 0x0

    const/4 v1, 0x0

    .line 18
    sput-object v1, Lcom/plug/services/e;->a:Landroid/os/HandlerThread;

    .line 19
    sput-object v1, Lcom/plug/services/e;->b:Landroid/os/Handler;

    .line 20
    sput-object v1, Lcom/plug/services/e;->c:Landroid/os/HandlerThread;

    .line 21
    sput-object v1, Lcom/plug/services/e;->d:Landroid/os/Handler;

    .line 23
    const/4 v1, 0x3

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

    const-string v2, "main"

    aput-object v2, v1, v0

    const/4 v2, 0x1

    const-string v3, "service"

    aput-object v3, v1, v2

    const/4 v2, 0x2

    const-string v3, "worker"

    aput-object v3, v1, v2

    sput-object v1, Lcom/plug/services/e;->e:[Ljava/lang/String;

    .line 28
    new-instance v1, Ljava/util/HashMap;

    sget-object v2, Lcom/plug/services/e;->e:[Ljava/lang/String;

    array-length v2, v2

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

    sput-object v1, Lcom/plug/services/e;->f:Ljava/util/HashMap;

    .line 31
    sget-object v1, Lcom/plug/services/e;->e:[Ljava/lang/String;

    array-length v2, v1

    :goto_2a
    if-ge v0, v2, :cond_6f

    aget-object v3, v1, v0

    .line 32
    const-string v4, "main"

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

    move-result v4

    if-eqz v4, :cond_45

    .line 33
    sget-object v4, Lcom/plug/services/e;->f:Ljava/util/HashMap;

    new-instance v5, Lcom/plug/services/a;

    const-class v6, Lcom/plug/services/MainProPluginService;

    invoke-direct {v5, v6}, Lcom/plug/services/a;-><init>(Ljava/lang/Class;)V

    invoke-virtual {v4, v3, v5}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    .line 31
    :cond_42
    :goto_42
    add-int/lit8 v0, v0, 0x1

    goto :goto_2a

    .line 34
    :cond_45
    const-string v4, "service"

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

    move-result v4

    if-eqz v4, :cond_5a

    .line 35
    sget-object v4, Lcom/plug/services/e;->f:Ljava/util/HashMap;

    new-instance v5, Lcom/plug/services/a;

    const-class v6, Lcom/plug/services/ServProPluginService;

    invoke-direct {v5, v6}, Lcom/plug/services/a;-><init>(Ljava/lang/Class;)V

    invoke-virtual {v4, v3, v5}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    goto :goto_42

    .line 36
    :cond_5a
    const-string v4, "worker"

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

    move-result v4

    if-eqz v4, :cond_42

    .line 37
    sget-object v4, Lcom/plug/services/e;->f:Ljava/util/HashMap;

    new-instance v5, Lcom/plug/services/a;

    const-class v6, Lcom/plug/services/WorkProPluginService;

    invoke-direct {v5, v6}, Lcom/plug/services/a;-><init>(Ljava/lang/Class;)V

    invoke-virtual {v4, v3, v5}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    goto :goto_42

    .line 40
    :cond_6f
    return-void
.end method

.method private static a(Ljava/lang/String;)Ljava/lang/String;
    .registers 3

    .prologue
    .line 121
    const-string v0, ":"

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

    move-result v0

    .line 122
    const/4 v1, -0x1

    if-ne v0, v1, :cond_c

    .line 123
    const-string v0, "main"

    .line 127
    :goto_b
    return-object v0

    .line 125
    :cond_c
    add-int/lit8 v0, v0, 0x1

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

    move-result-object v0

    goto :goto_b
.end method

.method public static a(Landroid/content/Context;I)Ljava/util/HashMap;
    .registers 5
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Landroid/content/Context;",
            "I)",
            "Ljava/util/HashMap",
            "<",
            "Ljava/lang/String;",
            "Lcom/plug/services/IProPluginInfo;",
            ">;"
        }
    .end annotation

    .prologue
    .line 56
    const/4 v0, 0x1

    new-array v0, v0, [Ljava/util/HashMap;

    .line 57
    new-instance v1, Ljava/lang/Object;

    invoke-direct {v1}, Ljava/lang/Object;-><init>()V

    .line 58
    monitor-enter v1

    .line 59
    :try_start_9
    new-instance v2, Lcom/plug/services/f;

    invoke-direct {v2, v0, v1}, Lcom/plug/services/f;-><init>([Ljava/util/HashMap;Ljava/lang/Object;)V

    invoke-static {p0, p1, v2}, Lcom/plug/services/e;->a(Landroid/content/Context;ILcom/plug/services/e$a;)V
    :try_end_11
    .catchall {:try_start_9 .. :try_end_11} :catchall_1e

    .line 69
    :try_start_11
    invoke-virtual {v1}, Ljava/lang/Object;->wait()V
    :try_end_14
    .catch Ljava/lang/InterruptedException; {:try_start_11 .. :try_end_14} :catch_19
    .catchall {:try_start_11 .. :try_end_14} :catchall_1e

    .line 73
    :goto_14
    const/4 v2, 0x0

    :try_start_15
    aget-object v0, v0, v2

    monitor-exit v1

    return-object v0

    .line 70
    :catch_19
    move-exception v2

    .line 71
    invoke-virtual {v2}, Ljava/lang/InterruptedException;->printStackTrace()V

    goto :goto_14

    .line 74
    :catchall_1e
    move-exception v0

    monitor-exit v1
    :try_end_20
    .catchall {:try_start_15 .. :try_end_20} :catchall_1e

    throw v0
.end method

.method private static declared-synchronized a()V
    .registers 3

    .prologue
    .line 167
    const-class v1, Lcom/plug/services/e;

    monitor-enter v1

    :try_start_3
    sget-object v0, Lcom/plug/services/e;->a:Landroid/os/HandlerThread;

    if-nez v0, :cond_22

    .line 168
    new-instance v0, Landroid/os/HandlerThread;

    const-string v2, "GetProPluginInfo"

    invoke-direct {v0, v2}, Landroid/os/HandlerThread;-><init>(Ljava/lang/String;)V

    sput-object v0, Lcom/plug/services/e;->a:Landroid/os/HandlerThread;

    .line 169
    sget-object v0, Lcom/plug/services/e;->a:Landroid/os/HandlerThread;

    invoke-virtual {v0}, Landroid/os/HandlerThread;->start()V

    .line 170
    new-instance v0, Landroid/os/Handler;

    sget-object v2, Lcom/plug/services/e;->a:Landroid/os/HandlerThread;

    invoke-virtual {v2}, Landroid/os/HandlerThread;->getLooper()Landroid/os/Looper;

    move-result-object v2

    invoke-direct {v0, v2}, Landroid/os/Handler;-><init>(Landroid/os/Looper;)V

    sput-object v0, Lcom/plug/services/e;->b:Landroid/os/Handler;
    :try_end_22
    .catchall {:try_start_3 .. :try_end_22} :catchall_24

    .line 172
    :cond_22
    monitor-exit v1

    return-void

    .line 167
    :catchall_24
    move-exception v0

    monitor-exit v1

    throw v0
.end method

.method public static a(Landroid/content/Context;ILcom/plug/services/e$a;)V
    .registers 6

    .prologue
    .line 80
    invoke-virtual {p0}, Landroid/content/Context;->getPackageName()Ljava/lang/String;

    move-result-object v0

    .line 81
    invoke-static {}, Lcom/plug/services/e;->b()V

    .line 82
    sget-object v1, Lcom/plug/services/e;->d:Landroid/os/Handler;

    new-instance v2, Lcom/plug/services/g;

    invoke-direct {v2, p0, p1, p2, v0}, Lcom/plug/services/g;-><init>(Landroid/content/Context;ILcom/plug/services/e$a;Ljava/lang/String;)V

    invoke-virtual {v1, v2}, Landroid/os/Handler;->post(Ljava/lang/Runnable;)Z

    .line 88
    return-void
.end method

.method static synthetic a(Landroid/content/Context;ILcom/plug/services/e$a;Ljava/lang/String;)V
    .registers 4

    .prologue
    .line 14
    invoke-static {p0, p1, p2, p3}, Lcom/plug/services/e;->b(Landroid/content/Context;ILcom/plug/services/e$a;Ljava/lang/String;)V

    return-void
.end method

.method static synthetic a(Landroid/content/Context;Lcom/plug/services/a;Ljava/lang/String;Lcom/plug/services/e$b;)V
    .registers 4

    .prologue
    .line 14
    invoke-static {p0, p1, p2, p3}, Lcom/plug/services/e;->c(Landroid/content/Context;Lcom/plug/services/a;Ljava/lang/String;Lcom/plug/services/e$b;)V

    return-void
.end method

.method private static declared-synchronized b()V
    .registers 3

    .prologue
    .line 175
    const-class v1, Lcom/plug/services/e;

    monitor-enter v1

    :try_start_3
    sget-object v0, Lcom/plug/services/e;->c:Landroid/os/HandlerThread;

    if-nez v0, :cond_22

    .line 176
    new-instance v0, Landroid/os/HandlerThread;

    const-string v2, "GetProPluginTask"

    invoke-direct {v0, v2}, Landroid/os/HandlerThread;-><init>(Ljava/lang/String;)V

    sput-object v0, Lcom/plug/services/e;->c:Landroid/os/HandlerThread;

    .line 177
    sget-object v0, Lcom/plug/services/e;->c:Landroid/os/HandlerThread;

    invoke-virtual {v0}, Landroid/os/HandlerThread;->start()V

    .line 178
    new-instance v0, Landroid/os/Handler;

    sget-object v2, Lcom/plug/services/e;->c:Landroid/os/HandlerThread;

    invoke-virtual {v2}, Landroid/os/HandlerThread;->getLooper()Landroid/os/Looper;

    move-result-object v2

    invoke-direct {v0, v2}, Landroid/os/Handler;-><init>(Landroid/os/Looper;)V

    sput-object v0, Lcom/plug/services/e;->d:Landroid/os/Handler;
    :try_end_22
    .catchall {:try_start_3 .. :try_end_22} :catchall_24

    .line 180
    :cond_22
    monitor-exit v1

    return-void

    .line 175
    :catchall_24
    move-exception v0

    monitor-exit v1

    throw v0
.end method

.method private static b(Landroid/content/Context;ILcom/plug/services/e$a;Ljava/lang/String;)V
    .registers 9

    .prologue
    .line 95
    :try_start_0
    new-instance v1, Lcom/plug/services/e$b;

    const/4 v0, 0x0

    invoke-direct {v1, v0}, Lcom/plug/services/e$b;-><init>(Lcom/plug/services/f;)V

    .line 96
    const/4 v0, 0x0

    iput v0, v1, Lcom/plug/services/e$b;->a:I

    .line 97
    new-instance v0, Ljava/util/HashMap;

    sget-object v2, Lcom/plug/services/e;->e:[Ljava/lang/String;

    array-length v2, v2

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

    iput-object v0, v1, Lcom/plug/services/e$b;->c:Ljava/util/HashMap;

    .line 98
    iput-object p2, v1, Lcom/plug/services/e$b;->d:Lcom/plug/services/e$a;

    .line 99
    iput p1, v1, Lcom/plug/services/e$b;->b:I

    .line 101
    const-string v0, "activity"

    .line 102
    invoke-virtual {p0, v0}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Landroid/app/ActivityManager;

    .line 103
    invoke-virtual {v0}, Landroid/app/ActivityManager;->getRunningAppProcesses()Ljava/util/List;

    move-result-object v0

    invoke-interface {v0}, Ljava/util/List;->iterator()Ljava/util/Iterator;

    move-result-object v2

    :cond_27
    :goto_27
    invoke-interface {v2}, Ljava/util/Iterator;->hasNext()Z

    move-result v0

    if-eqz v0, :cond_59

    invoke-interface {v2}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Landroid/app/ActivityManager$RunningAppProcessInfo;

    .line 104
    iget-object v3, v0, Landroid/app/ActivityManager$RunningAppProcessInfo;->processName:Ljava/lang/String;

    invoke-virtual {v3, p3}, Ljava/lang/String;->contains(Ljava/lang/CharSequence;)Z

    move-result v3

    if-eqz v3, :cond_27

    .line 107
    iget-object v0, v0, Landroid/app/ActivityManager$RunningAppProcessInfo;->processName:Ljava/lang/String;

    invoke-static {v0}, Lcom/plug/services/e;->a(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v3

    .line 108
    sget-object v0, Lcom/plug/services/e;->f:Ljava/util/HashMap;

    invoke-virtual {v0, v3}, Ljava/util/HashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/plug/services/a;

    .line 109
    if-eqz v0, :cond_27

    .line 110
    iget v4, v1, Lcom/plug/services/e$b;->a:I

    add-int/lit8 v4, v4, 0x1

    iput v4, v1, Lcom/plug/services/e$b;->a:I

    .line 111
    invoke-static {p0, v0, v3, v1}, Lcom/plug/services/e;->b(Landroid/content/Context;Lcom/plug/services/a;Ljava/lang/String;Lcom/plug/services/e$b;)V
    :try_end_54
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_54} :catch_55

    goto :goto_27

    .line 114
    :catch_55
    move-exception v0

    .line 115
    invoke-virtual {v0}, Ljava/lang/Exception;->printStackTrace()V

    .line 117
    :cond_59
    return-void
.end method

.method private static b(Landroid/content/Context;Lcom/plug/services/a;Ljava/lang/String;Lcom/plug/services/e$b;)V
    .registers 8

    .prologue
    .line 134
    if-nez p1, :cond_3

    .line 146
    :cond_2
    :goto_2
    return-void

    .line 137
    :cond_3
    invoke-static {}, Lcom/plug/services/e;->a()V

    .line 138
    sget-object v0, Lcom/plug/services/e;->b:Landroid/os/Handler;

    if-eqz v0, :cond_2

    .line 139
    sget-object v0, Lcom/plug/services/e;->b:Landroid/os/Handler;

    new-instance v1, Lcom/plug/services/h;

    invoke-direct {v1, p0, p1, p2, p3}, Lcom/plug/services/h;-><init>(Landroid/content/Context;Lcom/plug/services/a;Ljava/lang/String;Lcom/plug/services/e$b;)V

    const-wide/16 v2, 0xc8

    invoke-virtual {v0, v1, v2, v3}, Landroid/os/Handler;->postDelayed(Ljava/lang/Runnable;J)Z

    goto :goto_2
.end method

.method private static c(Landroid/content/Context;Lcom/plug/services/a;Ljava/lang/String;Lcom/plug/services/e$b;)V
    .registers 5

    .prologue
    .line 152
    new-instance v0, Lcom/plug/services/i;

    invoke-direct {v0, p3, p2, p1}, Lcom/plug/services/i;-><init>(Lcom/plug/services/e$b;Ljava/lang/String;Lcom/plug/services/a;)V

    invoke-virtual {p1, p0, v0}, Lcom/plug/services/a;->a(Landroid/content/Context;Lcom/plug/services/a$a;)V

    .line 164
    return-void
.end method