b.smali

.class public final Lcom/subgraph/orchid/c/b;
.super Ljava/lang/Object;
.source "DashboardConnection.java"

# interfaces
.implements Ljava/lang/Runnable;


# instance fields
.field final bBy:Lcom/subgraph/orchid/c/a;

.field private final bGG:Ljava/util/concurrent/ScheduledExecutorService;

.field final socket:Ljava/net/Socket;


# direct methods
.method public constructor <init>(Lcom/subgraph/orchid/c/a;Ljava/net/Socket;)V
    .registers 5

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

    .line 22
    iput-object p1, p0, Lcom/subgraph/orchid/c/b;->bBy:Lcom/subgraph/orchid/c/a;

    .line 23
    iput-object p2, p0, Lcom/subgraph/orchid/c/b;->socket:Ljava/net/Socket;

    .line 24
    new-instance v0, Ljava/util/concurrent/ScheduledThreadPoolExecutor;

    const/4 v1, 0x1

    invoke-direct {v0, v1}, Ljava/util/concurrent/ScheduledThreadPoolExecutor;-><init>(I)V

    iput-object v0, p0, Lcom/subgraph/orchid/c/b;->bGG:Ljava/util/concurrent/ScheduledExecutorService;

    .line 25
    return-void
.end method

.method static b(Ljava/io/Writer;)V
    .registers 2

    .prologue
    .line 94
    const/16 v0, 0x1b

    invoke-virtual {p0, v0}, Ljava/io/Writer;->append(C)Ljava/io/Writer;

    .line 95
    const/16 v0, 0x5b

    invoke-virtual {p0, v0}, Ljava/io/Writer;->append(C)Ljava/io/Writer;

    .line 96
    return-void
.end method

.method private j(Ljava/io/InputStream;)V
    .registers 7

    .prologue
    const/4 v4, 0x2

    const/4 v3, 0x1

    const/4 v2, 0x4

    .line 52
    :goto_3
    invoke-virtual {p1}, Ljava/io/InputStream;->read()I

    move-result v0

    const/4 v1, -0x1

    if-eq v0, v1, :cond_45

    .line 53
    sparse-switch v0, :sswitch_data_46

    goto :goto_3

    .line 2071
    :sswitch_e
    iget-object v0, p0, Lcom/subgraph/orchid/c/b;->bBy:Lcom/subgraph/orchid/c/a;

    invoke-virtual {v0, v4}, Lcom/subgraph/orchid/c/a;->isEnabled(I)Z

    move-result v0

    if-eqz v0, :cond_1d

    .line 2072
    iget-object v0, p0, Lcom/subgraph/orchid/c/b;->bBy:Lcom/subgraph/orchid/c/a;

    const/4 v1, 0x3

    invoke-virtual {v0, v1}, Lcom/subgraph/orchid/c/a;->eR(I)V

    goto :goto_3

    .line 2073
    :cond_1d
    iget-object v0, p0, Lcom/subgraph/orchid/c/b;->bBy:Lcom/subgraph/orchid/c/a;

    invoke-virtual {v0, v3}, Lcom/subgraph/orchid/c/a;->isEnabled(I)Z

    move-result v0

    if-eqz v0, :cond_2b

    .line 2074
    iget-object v0, p0, Lcom/subgraph/orchid/c/b;->bBy:Lcom/subgraph/orchid/c/a;

    invoke-virtual {v0, v4}, Lcom/subgraph/orchid/c/a;->eQ(I)V

    goto :goto_3

    .line 2076
    :cond_2b
    iget-object v0, p0, Lcom/subgraph/orchid/c/b;->bBy:Lcom/subgraph/orchid/c/a;

    invoke-virtual {v0, v3}, Lcom/subgraph/orchid/c/a;->eQ(I)V

    goto :goto_3

    .line 2081
    :sswitch_31
    iget-object v0, p0, Lcom/subgraph/orchid/c/b;->bBy:Lcom/subgraph/orchid/c/a;

    invoke-virtual {v0, v2}, Lcom/subgraph/orchid/c/a;->isEnabled(I)Z

    move-result v0

    if-eqz v0, :cond_3f

    .line 2082
    iget-object v0, p0, Lcom/subgraph/orchid/c/b;->bBy:Lcom/subgraph/orchid/c/a;

    invoke-virtual {v0, v2}, Lcom/subgraph/orchid/c/a;->eR(I)V

    goto :goto_3

    .line 2084
    :cond_3f
    iget-object v0, p0, Lcom/subgraph/orchid/c/b;->bBy:Lcom/subgraph/orchid/c/a;

    invoke-virtual {v0, v2}, Lcom/subgraph/orchid/c/a;->eQ(I)V

    goto :goto_3

    .line 64
    :cond_45
    return-void

    .line 53
    :sswitch_data_46
    .sparse-switch
        0x63 -> :sswitch_e
        0x70 -> :sswitch_31
    .end sparse-switch
.end method


# virtual methods
.method public final run()V
    .registers 10

    .prologue
    const/4 v8, 0x1

    .line 28
    const/4 v7, 0x0

    .line 30
    :try_start_2
    new-instance v2, Ljava/io/PrintWriter;

    iget-object v0, p0, Lcom/subgraph/orchid/c/b;->socket:Ljava/net/Socket;

    invoke-virtual {v0}, Ljava/net/Socket;->getOutputStream()Ljava/io/OutputStream;

    move-result-object v0

    invoke-direct {v2, v0}, Ljava/io/PrintWriter;-><init>(Ljava/io/OutputStream;)V

    .line 31
    iget-object v0, p0, Lcom/subgraph/orchid/c/b;->bGG:Ljava/util/concurrent/ScheduledExecutorService;

    .line 1124
    new-instance v1, Lcom/subgraph/orchid/c/b$1;

    invoke-direct {v1, p0, v2}, Lcom/subgraph/orchid/c/b$1;-><init>(Lcom/subgraph/orchid/c/b;Ljava/io/PrintWriter;)V

    .line 31
    const-wide/16 v2, 0x0

    const-wide/16 v4, 0x3e8

    sget-object v6, Ljava/util/concurrent/TimeUnit;->MILLISECONDS:Ljava/util/concurrent/TimeUnit;

    invoke-interface/range {v0 .. v6}, Ljava/util/concurrent/ScheduledExecutorService;->scheduleAtFixedRate(Ljava/lang/Runnable;JJLjava/util/concurrent/TimeUnit;)Ljava/util/concurrent/ScheduledFuture;
    :try_end_1d
    .catch Ljava/io/IOException; {:try_start_2 .. :try_end_1d} :catch_32
    .catchall {:try_start_2 .. :try_end_1d} :catchall_44

    move-result-object v0

    .line 32
    :try_start_1e
    iget-object v1, p0, Lcom/subgraph/orchid/c/b;->socket:Ljava/net/Socket;

    invoke-virtual {v1}, Ljava/net/Socket;->getInputStream()Ljava/io/InputStream;

    move-result-object v1

    invoke-direct {p0, v1}, Lcom/subgraph/orchid/c/b;->j(Ljava/io/InputStream;)V
    :try_end_27
    .catch Ljava/io/IOException; {:try_start_1e .. :try_end_27} :catch_56
    .catchall {:try_start_1e .. :try_end_27} :catchall_52

    .line 36
    if-eqz v0, :cond_2c

    .line 37
    invoke-interface {v0, v8}, Ljava/util/concurrent/ScheduledFuture;->cancel(Z)Z

    .line 39
    :cond_2c
    iget-object v0, p0, Lcom/subgraph/orchid/c/b;->bGG:Ljava/util/concurrent/ScheduledExecutorService;

    invoke-interface {v0}, Ljava/util/concurrent/ScheduledExecutorService;->shutdown()V

    .line 40
    :goto_31
    return-void

    .line 34
    :catch_32
    move-exception v0

    move-object v0, v7

    :goto_34
    :try_start_34
    iget-object v1, p0, Lcom/subgraph/orchid/c/b;->socket:Ljava/net/Socket;
    :try_end_36
    .catchall {:try_start_34 .. :try_end_36} :catchall_52

    .line 2045
    :try_start_36
    invoke-virtual {v1}, Ljava/net/Socket;->close()V
    :try_end_39
    .catch Ljava/io/IOException; {:try_start_36 .. :try_end_39} :catch_50
    .catchall {:try_start_36 .. :try_end_39} :catchall_52

    .line 36
    :goto_39
    if-eqz v0, :cond_3e

    .line 37
    invoke-interface {v0, v8}, Ljava/util/concurrent/ScheduledFuture;->cancel(Z)Z

    .line 39
    :cond_3e
    iget-object v0, p0, Lcom/subgraph/orchid/c/b;->bGG:Ljava/util/concurrent/ScheduledExecutorService;

    invoke-interface {v0}, Ljava/util/concurrent/ScheduledExecutorService;->shutdown()V

    goto :goto_31

    .line 36
    :catchall_44
    move-exception v0

    :goto_45
    if-eqz v7, :cond_4a

    .line 37
    invoke-interface {v7, v8}, Ljava/util/concurrent/ScheduledFuture;->cancel(Z)Z

    .line 39
    :cond_4a
    iget-object v1, p0, Lcom/subgraph/orchid/c/b;->bGG:Ljava/util/concurrent/ScheduledExecutorService;

    invoke-interface {v1}, Ljava/util/concurrent/ScheduledExecutorService;->shutdown()V

    throw v0

    :catch_50
    move-exception v1

    goto :goto_39

    .line 36
    :catchall_52
    move-exception v1

    move-object v7, v0

    move-object v0, v1

    goto :goto_45

    .line 34
    :catch_56
    move-exception v1

    goto :goto_34
.end method