h.smali

.class final Lretrofit2/h;
.super Ljava/lang/Object;

# interfaces
.implements Lretrofit2/b;


# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lretrofit2/h$a;,
        Lretrofit2/h$b;
    }
.end annotation

.annotation system Ldalvik/annotation/Signature;
    value = {
        "<T:",
        "Ljava/lang/Object;",
        ">",
        "Ljava/lang/Object;",
        "Lretrofit2/b",
        "<TT;>;"
    }
.end annotation


# instance fields
.field private final a:Lretrofit2/n;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Lretrofit2/n",
            "<TT;*>;"
        }
    .end annotation
.end field

.field private final b:[Ljava/lang/Object;

.field private volatile c:Z

.field private d:Lokhttp3/Call;

.field private e:Ljava/lang/Throwable;

.field private f:Z


# direct methods
.method constructor <init>(Lretrofit2/n;[Ljava/lang/Object;)V
    .registers 3
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Lretrofit2/n",
            "<TT;*>;[",
            "Ljava/lang/Object;",
            ")V"
        }
    .end annotation

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

    iput-object p1, p0, Lretrofit2/h;->a:Lretrofit2/n;

    iput-object p2, p0, Lretrofit2/h;->b:[Ljava/lang/Object;

    return-void
.end method

.method private e()Lokhttp3/Call;
    .registers 3

    iget-object v0, p0, Lretrofit2/h;->a:Lretrofit2/n;

    iget-object v1, p0, Lretrofit2/h;->b:[Ljava/lang/Object;

    invoke-virtual {v0, v1}, Lretrofit2/n;->a([Ljava/lang/Object;)Lokhttp3/Request;

    move-result-object v0

    iget-object v1, p0, Lretrofit2/h;->a:Lretrofit2/n;

    iget-object v1, v1, Lretrofit2/n;->c:Lokhttp3/Call$Factory;

    invoke-interface {v1, v0}, Lokhttp3/Call$Factory;->newCall(Lokhttp3/Request;)Lokhttp3/Call;

    move-result-object v0

    if-nez v0, :cond_1b

    new-instance v0, Ljava/lang/NullPointerException;

    const-string/jumbo v1, "Call.Factory returned null."

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

    throw v0

    :cond_1b
    return-object v0
.end method


# virtual methods
.method a(Lokhttp3/Response;)Lretrofit2/l;
    .registers 8
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Lokhttp3/Response;",
            ")",
            "Lretrofit2/l",
            "<TT;>;"
        }
    .end annotation

    invoke-virtual {p1}, Lokhttp3/Response;->body()Lokhttp3/ResponseBody;

    move-result-object v1

    invoke-virtual {p1}, Lokhttp3/Response;->newBuilder()Lokhttp3/Response$Builder;

    move-result-object v0

    new-instance v2, Lretrofit2/h$b;

    invoke-virtual {v1}, Lokhttp3/ResponseBody;->contentType()Lokhttp3/MediaType;

    move-result-object v3

    invoke-virtual {v1}, Lokhttp3/ResponseBody;->contentLength()J

    move-result-wide v4

    invoke-direct {v2, v3, v4, v5}, Lretrofit2/h$b;-><init>(Lokhttp3/MediaType;J)V

    invoke-virtual {v0, v2}, Lokhttp3/Response$Builder;->body(Lokhttp3/ResponseBody;)Lokhttp3/Response$Builder;

    move-result-object v0

    invoke-virtual {v0}, Lokhttp3/Response$Builder;->build()Lokhttp3/Response;

    move-result-object v0

    invoke-virtual {v0}, Lokhttp3/Response;->code()I

    move-result v2

    const/16 v3, 0xc8

    if-lt v2, v3, :cond_29

    const/16 v3, 0x12c

    if-lt v2, v3, :cond_3a

    :cond_29
    :try_start_29
    invoke-static {v1}, Lretrofit2/o;->a(Lokhttp3/ResponseBody;)Lokhttp3/ResponseBody;

    move-result-object v2

    invoke-static {v2, v0}, Lretrofit2/l;->a(Lokhttp3/ResponseBody;Lokhttp3/Response;)Lretrofit2/l;
    :try_end_30
    .catchall {:try_start_29 .. :try_end_30} :catchall_35

    move-result-object v0

    invoke-virtual {v1}, Lokhttp3/ResponseBody;->close()V

    :goto_34
    return-object v0

    :catchall_35
    move-exception v0

    invoke-virtual {v1}, Lokhttp3/ResponseBody;->close()V

    throw v0

    :cond_3a
    const/16 v3, 0xcc

    if-eq v2, v3, :cond_42

    const/16 v3, 0xcd

    if-ne v2, v3, :cond_4b

    :cond_42
    invoke-virtual {v1}, Lokhttp3/ResponseBody;->close()V

    const/4 v1, 0x0

    invoke-static {v1, v0}, Lretrofit2/l;->a(Ljava/lang/Object;Lokhttp3/Response;)Lretrofit2/l;

    move-result-object v0

    goto :goto_34

    :cond_4b
    new-instance v2, Lretrofit2/h$a;

    invoke-direct {v2, v1}, Lretrofit2/h$a;-><init>(Lokhttp3/ResponseBody;)V

    :try_start_50
    iget-object v1, p0, Lretrofit2/h;->a:Lretrofit2/n;

    invoke-virtual {v1, v2}, Lretrofit2/n;->a(Lokhttp3/ResponseBody;)Ljava/lang/Object;

    move-result-object v1

    invoke-static {v1, v0}, Lretrofit2/l;->a(Ljava/lang/Object;Lokhttp3/Response;)Lretrofit2/l;
    :try_end_59
    .catch Ljava/lang/RuntimeException; {:try_start_50 .. :try_end_59} :catch_5b

    move-result-object v0

    goto :goto_34

    :catch_5b
    move-exception v0

    invoke-virtual {v2}, Lretrofit2/h$a;->a()V

    throw v0
.end method

.method public a(Lretrofit2/d;)V
    .registers 5
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Lretrofit2/d",
            "<TT;>;)V"
        }
    .end annotation

    if-nez p1, :cond_b

    new-instance v0, Ljava/lang/NullPointerException;

    const-string/jumbo v1, "callback == null"

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

    throw v0

    :cond_b
    monitor-enter p0

    :try_start_c
    iget-boolean v0, p0, Lretrofit2/h;->f:Z

    if-eqz v0, :cond_1c

    new-instance v0, Ljava/lang/IllegalStateException;

    const-string/jumbo v1, "Already executed."

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

    throw v0

    :catchall_19
    move-exception v0

    monitor-exit p0
    :try_end_1b
    .catchall {:try_start_c .. :try_end_1b} :catchall_19

    throw v0

    :cond_1c
    const/4 v0, 0x1

    :try_start_1d
    iput-boolean v0, p0, Lretrofit2/h;->f:Z

    iget-object v2, p0, Lretrofit2/h;->d:Lokhttp3/Call;

    iget-object v0, p0, Lretrofit2/h;->e:Ljava/lang/Throwable;
    :try_end_23
    .catchall {:try_start_1d .. :try_end_23} :catchall_19

    if-nez v2, :cond_49

    if-nez v0, :cond_49

    :try_start_27
    invoke-direct {p0}, Lretrofit2/h;->e()Lokhttp3/Call;

    move-result-object v1

    iput-object v1, p0, Lretrofit2/h;->d:Lokhttp3/Call;
    :try_end_2d
    .catch Ljava/lang/Throwable; {:try_start_27 .. :try_end_2d} :catch_34
    .catchall {:try_start_27 .. :try_end_2d} :catchall_19

    :goto_2d
    :try_start_2d
    monitor-exit p0
    :try_end_2e
    .catchall {:try_start_2d .. :try_end_2e} :catchall_19

    if-eqz v0, :cond_39

    invoke-interface {p1, p0, v0}, Lretrofit2/d;->onFailure(Lretrofit2/b;Ljava/lang/Throwable;)V

    :goto_33
    return-void

    :catch_34
    move-exception v0

    :try_start_35
    iput-object v0, p0, Lretrofit2/h;->e:Ljava/lang/Throwable;
    :try_end_37
    .catchall {:try_start_35 .. :try_end_37} :catchall_19

    move-object v1, v2

    goto :goto_2d

    :cond_39
    iget-boolean v0, p0, Lretrofit2/h;->c:Z

    if-eqz v0, :cond_40

    invoke-interface {v1}, Lokhttp3/Call;->cancel()V

    :cond_40
    new-instance v0, Lretrofit2/h$1;

    invoke-direct {v0, p0, p1}, Lretrofit2/h$1;-><init>(Lretrofit2/h;Lretrofit2/d;)V

    invoke-interface {v1, v0}, Lokhttp3/Call;->enqueue(Lokhttp3/Callback;)V

    goto :goto_33

    :cond_49
    move-object v1, v2

    goto :goto_2d
.end method

.method public a()Z
    .registers 3

    const/4 v0, 0x1

    iget-boolean v1, p0, Lretrofit2/h;->c:Z

    if-eqz v1, :cond_6

    :goto_5
    return v0

    :cond_6
    monitor-enter p0

    :try_start_7
    iget-object v1, p0, Lretrofit2/h;->d:Lokhttp3/Call;

    if-eqz v1, :cond_18

    iget-object v1, p0, Lretrofit2/h;->d:Lokhttp3/Call;

    invoke-interface {v1}, Lokhttp3/Call;->isCanceled()Z

    move-result v1

    if-eqz v1, :cond_18

    :goto_13
    monitor-exit p0

    goto :goto_5

    :catchall_15
    move-exception v0

    monitor-exit p0
    :try_end_17
    .catchall {:try_start_7 .. :try_end_17} :catchall_15

    throw v0

    :cond_18
    const/4 v0, 0x0

    goto :goto_13
.end method

.method public synthetic b()Lretrofit2/b;
    .registers 2

    invoke-virtual {p0}, Lretrofit2/h;->d()Lretrofit2/h;

    move-result-object v0

    return-object v0
.end method

.method public declared-synchronized c()Lokhttp3/Request;
    .registers 4

    monitor-enter p0

    :try_start_1
    iget-object v0, p0, Lretrofit2/h;->d:Lokhttp3/Call;

    if-eqz v0, :cond_b

    invoke-interface {v0}, Lokhttp3/Call;->request()Lokhttp3/Request;
    :try_end_8
    .catchall {:try_start_1 .. :try_end_8} :catchall_20

    move-result-object v0

    :goto_9
    monitor-exit p0

    return-object v0

    :cond_b
    :try_start_b
    iget-object v0, p0, Lretrofit2/h;->e:Ljava/lang/Throwable;

    if-eqz v0, :cond_28

    iget-object v0, p0, Lretrofit2/h;->e:Ljava/lang/Throwable;

    instance-of v0, v0, Ljava/io/IOException;

    if-eqz v0, :cond_23

    new-instance v0, Ljava/lang/RuntimeException;

    const-string/jumbo v1, "Unable to create request."

    iget-object v2, p0, Lretrofit2/h;->e:Ljava/lang/Throwable;

    invoke-direct {v0, v1, v2}, Ljava/lang/RuntimeException;-><init>(Ljava/lang/String;Ljava/lang/Throwable;)V

    throw v0
    :try_end_20
    .catchall {:try_start_b .. :try_end_20} :catchall_20

    :catchall_20
    move-exception v0

    monitor-exit p0

    throw v0

    :cond_23
    :try_start_23
    iget-object v0, p0, Lretrofit2/h;->e:Ljava/lang/Throwable;

    check-cast v0, Ljava/lang/RuntimeException;

    throw v0
    :try_end_28
    .catchall {:try_start_23 .. :try_end_28} :catchall_20

    :cond_28
    :try_start_28
    invoke-direct {p0}, Lretrofit2/h;->e()Lokhttp3/Call;

    move-result-object v0

    iput-object v0, p0, Lretrofit2/h;->d:Lokhttp3/Call;

    invoke-interface {v0}, Lokhttp3/Call;->request()Lokhttp3/Request;
    :try_end_31
    .catch Ljava/lang/RuntimeException; {:try_start_28 .. :try_end_31} :catch_33
    .catch Ljava/io/IOException; {:try_start_28 .. :try_end_31} :catch_37
    .catchall {:try_start_28 .. :try_end_31} :catchall_20

    move-result-object v0

    goto :goto_9

    :catch_33
    move-exception v0

    :try_start_34
    iput-object v0, p0, Lretrofit2/h;->e:Ljava/lang/Throwable;

    throw v0

    :catch_37
    move-exception v0

    iput-object v0, p0, Lretrofit2/h;->e:Ljava/lang/Throwable;

    new-instance v1, Ljava/lang/RuntimeException;

    const-string/jumbo v2, "Unable to create request."

    invoke-direct {v1, v2, v0}, Ljava/lang/RuntimeException;-><init>(Ljava/lang/String;Ljava/lang/Throwable;)V

    throw v1
    :try_end_43
    .catchall {:try_start_34 .. :try_end_43} :catchall_20
.end method

.method public synthetic clone()Ljava/lang/Object;
    .registers 2

    invoke-virtual {p0}, Lretrofit2/h;->d()Lretrofit2/h;

    move-result-object v0

    return-object v0
.end method

.method public d()Lretrofit2/h;
    .registers 4
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "()",
            "Lretrofit2/h",
            "<TT;>;"
        }
    .end annotation

    new-instance v0, Lretrofit2/h;

    iget-object v1, p0, Lretrofit2/h;->a:Lretrofit2/n;

    iget-object v2, p0, Lretrofit2/h;->b:[Ljava/lang/Object;

    invoke-direct {v0, v1, v2}, Lretrofit2/h;-><init>(Lretrofit2/n;[Ljava/lang/Object;)V

    return-object v0
.end method