cf.smali

.class final Lcom/bytedance/embedapplog/cf;
.super Ljava/lang/Object;
.source "SourceFile"


# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lcom/bytedance/embedapplog/cf$b;,
        Lcom/bytedance/embedapplog/cf$a;
    }
.end annotation

.annotation system Ldalvik/annotation/Signature;
    value = {
        "<SERVICE:",
        "Ljava/lang/Object;",
        "RESU",
        "LT:Ljava/lang/Object;",
        ">",
        "Ljava/lang/Object;"
    }
.end annotation


# instance fields
.field private final a:Ljava/util/concurrent/CountDownLatch;

.field private final b:Landroid/content/Intent;

.field private final c:Lcom/bytedance/embedapplog/cf$b;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Lcom/bytedance/embedapplog/cf$b",
            "<TSERVICE;TRESU",
            "LT;",
            ">;"
        }
    .end annotation
.end field

.field private final d:Landroid/content/Context;


# direct methods
.method constructor <init>(Landroid/content/Context;Landroid/content/Intent;Lcom/bytedance/embedapplog/cf$b;)V
    .registers 6
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Landroid/content/Context;",
            "Landroid/content/Intent;",
            "Lcom/bytedance/embedapplog/cf$b",
            "<TSERVICE;TRESU",
            "LT;",
            ">;)V"
        }
    .end annotation

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

    .line 25
    iput-object p1, p0, Lcom/bytedance/embedapplog/cf;->d:Landroid/content/Context;

    .line 26
    iput-object p2, p0, Lcom/bytedance/embedapplog/cf;->b:Landroid/content/Intent;

    .line 27
    iput-object p3, p0, Lcom/bytedance/embedapplog/cf;->c:Lcom/bytedance/embedapplog/cf$b;

    .line 28
    new-instance v0, Ljava/util/concurrent/CountDownLatch;

    const/4 v1, 0x1

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

    iput-object v0, p0, Lcom/bytedance/embedapplog/cf;->a:Ljava/util/concurrent/CountDownLatch;

    .line 29
    return-void
.end method

.method private a(Lcom/bytedance/embedapplog/cf$a;)V
    .registers 3
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Lcom/bytedance/embedapplog/cf",
            "<TSERVICE;TRESU",
            "LT;",
            ">.a;)V"
        }
    .end annotation

    .prologue
    .line 56
    if-eqz p1, :cond_7

    .line 57
    :try_start_2
    iget-object v0, p0, Lcom/bytedance/embedapplog/cf;->d:Landroid/content/Context;

    invoke-virtual {v0, p1}, Landroid/content/Context;->unbindService(Landroid/content/ServiceConnection;)V
    :try_end_7
    .catch Ljava/lang/Throwable; {:try_start_2 .. :try_end_7} :catch_8

    .line 62
    :cond_7
    :goto_7
    return-void

    .line 59
    :catch_8
    move-exception v0

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

    goto :goto_7
.end method


# virtual methods
.method a()Ljava/lang/Object;
    .registers 6
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "()TRESU",
            "LT;"
        }
    .end annotation

    .prologue
    const/4 v0, 0x0

    .line 33
    invoke-static {}, Landroid/os/Looper;->getMainLooper()Landroid/os/Looper;

    move-result-object v1

    invoke-static {}, Landroid/os/Looper;->myLooper()Landroid/os/Looper;

    move-result-object v2

    if-ne v1, v2, :cond_c

    .line 51
    :goto_b
    return-object v0

    .line 41
    :cond_c
    :try_start_c
    new-instance v2, Lcom/bytedance/embedapplog/cf$a;

    iget-object v1, p0, Lcom/bytedance/embedapplog/cf;->a:Ljava/util/concurrent/CountDownLatch;

    iget-object v3, p0, Lcom/bytedance/embedapplog/cf;->c:Lcom/bytedance/embedapplog/cf$b;

    invoke-direct {v2, p0, v1, v3}, Lcom/bytedance/embedapplog/cf$a;-><init>(Lcom/bytedance/embedapplog/cf;Ljava/util/concurrent/CountDownLatch;Lcom/bytedance/embedapplog/cf$b;)V

    .line 42
    iget-object v1, p0, Lcom/bytedance/embedapplog/cf;->d:Landroid/content/Context;

    iget-object v3, p0, Lcom/bytedance/embedapplog/cf;->b:Landroid/content/Intent;

    const/4 v4, 0x1

    invoke-virtual {v1, v3, v2, v4}, Landroid/content/Context;->bindService(Landroid/content/Intent;Landroid/content/ServiceConnection;I)Z

    .line 43
    iget-object v1, p0, Lcom/bytedance/embedapplog/cf;->a:Ljava/util/concurrent/CountDownLatch;

    invoke-virtual {v1}, Ljava/util/concurrent/CountDownLatch;->await()V
    :try_end_22
    .catch Ljava/lang/Throwable; {:try_start_c .. :try_end_22} :catch_2e
    .catchall {:try_start_c .. :try_end_22} :catchall_37

    .line 45
    :try_start_22
    iget-object v1, p0, Lcom/bytedance/embedapplog/cf;->c:Lcom/bytedance/embedapplog/cf$b;

    iget-object v3, v2, Lcom/bytedance/embedapplog/cf$a;->a:Ljava/lang/Object;

    invoke-interface {v1, v3}, Lcom/bytedance/embedapplog/cf$b;->a(Ljava/lang/Object;)Ljava/lang/Object;
    :try_end_29
    .catch Ljava/lang/Throwable; {:try_start_22 .. :try_end_29} :catch_40
    .catchall {:try_start_22 .. :try_end_29} :catchall_3e

    move-result-object v0

    .line 49
    invoke-direct {p0, v2}, Lcom/bytedance/embedapplog/cf;->a(Lcom/bytedance/embedapplog/cf$a;)V

    goto :goto_b

    .line 46
    :catch_2e
    move-exception v1

    move-object v2, v0

    .line 47
    :goto_30
    :try_start_30
    invoke-virtual {v1}, Ljava/lang/Throwable;->printStackTrace()V
    :try_end_33
    .catchall {:try_start_30 .. :try_end_33} :catchall_3e

    .line 49
    invoke-direct {p0, v2}, Lcom/bytedance/embedapplog/cf;->a(Lcom/bytedance/embedapplog/cf$a;)V

    goto :goto_b

    :catchall_37
    move-exception v1

    move-object v2, v0

    move-object v0, v1

    :goto_3a
    invoke-direct {p0, v2}, Lcom/bytedance/embedapplog/cf;->a(Lcom/bytedance/embedapplog/cf$a;)V

    throw v0

    :catchall_3e
    move-exception v0

    goto :goto_3a

    .line 46
    :catch_40
    move-exception v1

    goto :goto_30
.end method