j.smali

.class final Lcom/opensource/svgaplayer/j;
.super Ljava/lang/Object;
.source "SVGAParser.kt"

# interfaces
.implements Ljava/lang/Runnable;


# annotations
.annotation system Ldalvik/annotation/EnclosingMethod;
    value = Lcom/opensource/svgaplayer/SVGAParser$b;->a(Ljava/net/URL;Lkotlin/jvm/a/l;Lkotlin/jvm/a/l;)Lkotlin/jvm/a/a;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x18
    name = null
.end annotation


# instance fields
.field final synthetic a:Lcom/opensource/svgaplayer/SVGAParser$b;

.field final synthetic b:Ljava/net/URL;

.field final synthetic c:Lkotlin/jvm/internal/Ref$BooleanRef;

.field final synthetic d:Lkotlin/jvm/a/l;

.field final synthetic e:Lkotlin/jvm/a/l;


# direct methods
.method constructor <init>(Lcom/opensource/svgaplayer/SVGAParser$b;Ljava/net/URL;Lkotlin/jvm/internal/Ref$BooleanRef;Lkotlin/jvm/a/l;Lkotlin/jvm/a/l;)V
    .registers 6

    iput-object p1, p0, Lcom/opensource/svgaplayer/j;->a:Lcom/opensource/svgaplayer/SVGAParser$b;

    iput-object p2, p0, Lcom/opensource/svgaplayer/j;->b:Ljava/net/URL;

    iput-object p3, p0, Lcom/opensource/svgaplayer/j;->c:Lkotlin/jvm/internal/Ref$BooleanRef;

    iput-object p4, p0, Lcom/opensource/svgaplayer/j;->d:Lkotlin/jvm/a/l;

    iput-object p5, p0, Lcom/opensource/svgaplayer/j;->e:Lkotlin/jvm/a/l;

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

    return-void
.end method


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

    const-string v0, "SVGAParser"

    .line 1
    :try_start_2
    invoke-static {}, Landroid/net/http/HttpResponseCache;->getInstalled()Landroid/net/http/HttpResponseCache;

    move-result-object v1

    if-nez v1, :cond_1a

    iget-object v1, p0, Lcom/opensource/svgaplayer/j;->a:Lcom/opensource/svgaplayer/SVGAParser$b;

    invoke-virtual {v1}, Lcom/opensource/svgaplayer/SVGAParser$b;->a()Z

    move-result v1

    if-nez v1, :cond_1a

    const-string v1, "SVGAParser can not handle cache before install HttpResponseCache. see https://github.com/yyued/SVGAPlayer-Android#cache"

    .line 2
    invoke-static {v0, v1}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;)I

    const-string v1, "\u5728\u914d\u7f6e HttpResponseCache \u524d SVGAParser \u65e0\u6cd5\u7f13\u5b58. \u67e5\u770b https://github.com/yyued/SVGAPlayer-Android#cache "

    .line 3
    invoke-static {v0, v1}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;)I

    .line 4
    :cond_1a
    iget-object v0, p0, Lcom/opensource/svgaplayer/j;->b:Ljava/net/URL;

    invoke-virtual {v0}, Ljava/net/URL;->openConnection()Ljava/net/URLConnection;

    move-result-object v0

    instance-of v1, v0, Ljava/net/HttpURLConnection;

    const/4 v2, 0x0

    if-nez v1, :cond_26

    move-object v0, v2

    :cond_26
    check-cast v0, Ljava/net/HttpURLConnection;

    if-eqz v0, :cond_ae

    const/16 v1, 0x4e20

    .line 5
    invoke-virtual {v0, v1}, Ljava/net/HttpURLConnection;->setConnectTimeout(I)V

    const-string v1, "GET"

    .line 6
    invoke-virtual {v0, v1}, Ljava/net/HttpURLConnection;->setRequestMethod(Ljava/lang/String;)V

    .line 7
    invoke-virtual {v0}, Ljava/net/HttpURLConnection;->connect()V

    .line 8
    invoke-virtual {v0}, Ljava/net/HttpURLConnection;->getInputStream()Ljava/io/InputStream;

    move-result-object v0
    :try_end_3b
    .catch Ljava/lang/Exception; {:try_start_2 .. :try_end_3b} :catch_a5

    .line 9
    :try_start_3b
    new-instance v1, Ljava/io/ByteArrayOutputStream;

    invoke-direct {v1}, Ljava/io/ByteArrayOutputStream;-><init>()V
    :try_end_40
    .catch Ljava/lang/Throwable; {:try_start_3b .. :try_end_40} :catch_9e
    .catchall {:try_start_3b .. :try_end_40} :catchall_9c

    const/16 v3, 0x1000

    .line 10
    :try_start_42
    new-array v4, v3, [B

    .line 11
    :goto_44
    iget-object v5, p0, Lcom/opensource/svgaplayer/j;->c:Lkotlin/jvm/internal/Ref$BooleanRef;

    iget-boolean v5, v5, Lkotlin/jvm/internal/Ref$BooleanRef;->element:Z

    if-eqz v5, :cond_4b

    goto :goto_53

    :cond_4b
    const/4 v5, 0x0

    .line 12
    invoke-virtual {v0, v4, v5, v3}, Ljava/io/InputStream;->read([BII)I

    move-result v6

    const/4 v7, -0x1

    if-ne v6, v7, :cond_8b

    .line 13
    :goto_53
    iget-object v3, p0, Lcom/opensource/svgaplayer/j;->c:Lkotlin/jvm/internal/Ref$BooleanRef;

    iget-boolean v3, v3, Lkotlin/jvm/internal/Ref$BooleanRef;->element:Z
    :try_end_57
    .catch Ljava/lang/Throwable; {:try_start_42 .. :try_end_57} :catch_92
    .catchall {:try_start_42 .. :try_end_57} :catchall_8f

    if-eqz v3, :cond_60

    .line 14
    :try_start_59
    invoke-static {v1, v2}, Lkotlin/io/a;->a(Ljava/io/Closeable;Ljava/lang/Throwable;)V
    :try_end_5c
    .catch Ljava/lang/Throwable; {:try_start_59 .. :try_end_5c} :catch_9e
    .catchall {:try_start_59 .. :try_end_5c} :catchall_9c

    :try_start_5c
    invoke-static {v0, v2}, Lkotlin/io/a;->a(Ljava/io/Closeable;Ljava/lang/Throwable;)V
    :try_end_5f
    .catch Ljava/lang/Exception; {:try_start_5c .. :try_end_5f} :catch_a5

    return-void

    .line 15
    :cond_60
    :try_start_60
    new-instance v3, Ljava/io/ByteArrayInputStream;

    invoke-virtual {v1}, Ljava/io/ByteArrayOutputStream;->toByteArray()[B

    move-result-object v4

    invoke-direct {v3, v4}, Ljava/io/ByteArrayInputStream;-><init>([B)V
    :try_end_69
    .catch Ljava/lang/Throwable; {:try_start_60 .. :try_end_69} :catch_92
    .catchall {:try_start_60 .. :try_end_69} :catchall_8f

    .line 16
    :try_start_69
    iget-object v4, p0, Lcom/opensource/svgaplayer/j;->d:Lkotlin/jvm/a/l;

    invoke-interface {v4, v3}, Lkotlin/jvm/a/l;->invoke(Ljava/lang/Object;)Ljava/lang/Object;

    .line 17
    sget-object v4, Lkotlin/n;->a:Lkotlin/n;
    :try_end_70
    .catch Ljava/lang/Throwable; {:try_start_69 .. :try_end_70} :catch_81
    .catchall {:try_start_69 .. :try_end_70} :catchall_7e

    .line 18
    :try_start_70
    invoke-static {v3, v2}, Lkotlin/io/a;->a(Ljava/io/Closeable;Ljava/lang/Throwable;)V

    .line 19
    sget-object v3, Lkotlin/n;->a:Lkotlin/n;
    :try_end_75
    .catch Ljava/lang/Throwable; {:try_start_70 .. :try_end_75} :catch_92
    .catchall {:try_start_70 .. :try_end_75} :catchall_8f

    .line 20
    :try_start_75
    invoke-static {v1, v2}, Lkotlin/io/a;->a(Ljava/io/Closeable;Ljava/lang/Throwable;)V

    .line 21
    sget-object v1, Lkotlin/n;->a:Lkotlin/n;
    :try_end_7a
    .catch Ljava/lang/Throwable; {:try_start_75 .. :try_end_7a} :catch_9e
    .catchall {:try_start_75 .. :try_end_7a} :catchall_9c

    .line 22
    :try_start_7a
    invoke-static {v0, v2}, Lkotlin/io/a;->a(Ljava/io/Closeable;Ljava/lang/Throwable;)V
    :try_end_7d
    .catch Ljava/lang/Exception; {:try_start_7a .. :try_end_7d} :catch_a5

    goto :goto_ae

    :catchall_7e
    move-exception v4

    move-object v5, v2

    goto :goto_87

    :catch_81
    move-exception v4

    .line 23
    :try_start_82
    throw v4
    :try_end_83
    .catchall {:try_start_82 .. :try_end_83} :catchall_83

    :catchall_83
    move-exception v5

    move-object v8, v5

    move-object v5, v4

    move-object v4, v8

    :goto_87
    :try_start_87
    invoke-static {v3, v5}, Lkotlin/io/a;->a(Ljava/io/Closeable;Ljava/lang/Throwable;)V

    throw v4

    .line 24
    :cond_8b
    invoke-virtual {v1, v4, v5, v6}, Ljava/io/ByteArrayOutputStream;->write([BII)V
    :try_end_8e
    .catch Ljava/lang/Throwable; {:try_start_87 .. :try_end_8e} :catch_92
    .catchall {:try_start_87 .. :try_end_8e} :catchall_8f

    goto :goto_44

    :catchall_8f
    move-exception v3

    move-object v4, v2

    goto :goto_98

    :catch_92
    move-exception v3

    .line 25
    :try_start_93
    throw v3
    :try_end_94
    .catchall {:try_start_93 .. :try_end_94} :catchall_94

    :catchall_94
    move-exception v4

    move-object v8, v4

    move-object v4, v3

    move-object v3, v8

    :goto_98
    :try_start_98
    invoke-static {v1, v4}, Lkotlin/io/a;->a(Ljava/io/Closeable;Ljava/lang/Throwable;)V

    throw v3
    :try_end_9c
    .catch Ljava/lang/Throwable; {:try_start_98 .. :try_end_9c} :catch_9e
    .catchall {:try_start_98 .. :try_end_9c} :catchall_9c

    :catchall_9c
    move-exception v1

    goto :goto_a1

    :catch_9e
    move-exception v1

    move-object v2, v1

    .line 26
    :try_start_a0
    throw v2
    :try_end_a1
    .catchall {:try_start_a0 .. :try_end_a1} :catchall_9c

    :goto_a1
    :try_start_a1
    invoke-static {v0, v2}, Lkotlin/io/a;->a(Ljava/io/Closeable;Ljava/lang/Throwable;)V

    throw v1
    :try_end_a5
    .catch Ljava/lang/Exception; {:try_start_a1 .. :try_end_a5} :catch_a5

    :catch_a5
    move-exception v0

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

    .line 28
    iget-object v1, p0, Lcom/opensource/svgaplayer/j;->e:Lkotlin/jvm/a/l;

    invoke-interface {v1, v0}, Lkotlin/jvm/a/l;->invoke(Ljava/lang/Object;)Ljava/lang/Object;

    :cond_ae
    :goto_ae
    return-void
.end method